[go: up one dir, main page]

CN100432944C - Computer system - Google Patents

Computer system Download PDF

Info

Publication number
CN100432944C
CN100432944C CNB2005101079789A CN200510107978A CN100432944C CN 100432944 C CN100432944 C CN 100432944C CN B2005101079789 A CNB2005101079789 A CN B2005101079789A CN 200510107978 A CN200510107978 A CN 200510107978A CN 100432944 C CN100432944 C CN 100432944C
Authority
CN
China
Prior art keywords
independent processing
message
computer system
processing devices
processing device
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CNB2005101079789A
Other languages
Chinese (zh)
Other versions
CN1940874A (en
Inventor
荆继武
杨慕涵
王晶
杜皎
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
University of Chinese Academy of Sciences
Institute of Information Engineering of CAS
Original Assignee
University of Chinese Academy of Sciences
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by University of Chinese Academy of Sciences filed Critical University of Chinese Academy of Sciences
Priority to CNB2005101079789A priority Critical patent/CN100432944C/en
Publication of CN1940874A publication Critical patent/CN1940874A/en
Application granted granted Critical
Publication of CN100432944C publication Critical patent/CN100432944C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Computer And Data Communications (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明公开了一种新的计算机系统,包括:多个独立处理装置,其中,每个独立处理装置均用于独立完成对硬件资源的管理和访问以及实现一个应用功能,并独占所需硬件资源,多个独立处理装置之间的通信通过消息传递来实现;以及交换装置,用于实现对多个独立处理装置的调度、监控、和实现多个独立处理装置之间的消息传递;其中交换装置包括:调度器,用于实现对多个独立处理装置的调度;消息传递器,用于实现多个独立处理装置之间的消息传递;监控器,用于监控多个独立处理装置;以及交换装置还储存待处理消息队列和独立处理装置的参数。

Figure 200510107978

The invention discloses a new computer system, which includes: a plurality of independent processing devices, wherein each independent processing device is used to independently manage and access hardware resources and realize an application function, and monopolize the required hardware resources , the communication between a plurality of independent processing devices is realized through message transmission; and the switching device is used to realize the scheduling and monitoring of a plurality of independent processing devices, and realize the message transmission between a plurality of independent processing devices; wherein the switching device Including: a scheduler, used to realize the scheduling of multiple independent processing devices; a message passer, used to realize message transmission among multiple independent processing devices; a monitor, used to monitor multiple independent processing devices; and a switching device Parameters for queues of pending messages and individual processing means are also stored.

Figure 200510107978

Description

计算机系统 computer system

技术领域 technical field

本发明涉及一种计算机系统,具体而言,涉及一种嵌入式或者控制用的计算机系统,例如交换机、路由器、或网络防火墙。The present invention relates to a computer system, in particular to an embedded or control computer system, such as a switch, a router, or a network firewall.

背景技术 Background technique

现有的计算机系统包括传统的计算机系统、微内核计算机系统、外内核计算机系统等。Existing computer systems include traditional computer systems, microkernel computer systems, and exokernel computer systems.

1、传统的计算机系统1. Traditional computer systems

如图1所示,现有的计算机系统由系统程序和应用程序组成。系统程序为应用程序提供一个统一的平台,其包括:操作系统,其是在硬件的基础上加载的一层软件,用于管理整个系统,并为应用程序提供接口;其他系统程序,其在操作系统的上一层,其中有编译器、编辑器以及类似的独立于应用的程序,但这些程序运行在用户态,可以被用户修改。系统程序的上面是应用程序,应用程序由用户编写,在系统程序的基础上实现用户所需要的功能。操作系统是一个控制和管理计算机硬件和软件资源、组织计算机工作流程并且为应用程序提供服务和支持的庞大而复杂的系统。操作系统是计算机系统中负责支撑应用程序运行环境以及用户操作环境的系统软件,同时也是计算机系统的核心与基石。它的职责通常包括对硬件的直接监管、对各种计算资源(如内存、处理器时间等)的管理、以及提供诸如作业管理之类的面向应用程序的服务等等。As shown in Figure 1, an existing computer system consists of system programs and application programs. System programs provide a unified platform for applications, including: operating system, which is a layer of software loaded on the basis of hardware, used to manage the entire system and provide interfaces for application programs; other system programs, which operate The upper layer of the system, in which there are compilers, editors, and similar application-independent programs, but these programs run in user mode and can be modified by users. Above the system program is the application program, which is written by the user and realizes the functions required by the user on the basis of the system program. An operating system is a large and complex system that controls and manages computer hardware and software resources, organizes computer workflow, and provides services and support for application programs. The operating system is the system software responsible for supporting the operating environment of the application program and the operating environment of the user in the computer system, and it is also the core and cornerstone of the computer system. Its responsibilities usually include direct supervision of hardware, management of various computing resources (such as memory, processor time, etc.), and providing application-oriented services such as job management, etc.

在现有的计算机系统中,应用程序同操作系统通信并请求服务,是通过系统调用进行的,即通过系统调用命令中断现行程序,而转去执行操作系统中相应的子程序,以完成特定的系统功能,完成后,控制又返回到发出系统调用命令之后的一条指令,被中断的程序将继续执行下去。比如,在这一过程中把系统调用参数放到指定位置,如寄存器,然后发出TRAP指令给操作系统。在TRAP之后,操作系统取得控制,它考察参数是否有效,如果是,完成所请求的工作。当工作完成后,在寄存器中给出状态代码,通知成功还是失败,然后执行一条RETURN FROM TRAP的指令,把控制权返回给。In the existing computer system, the application program communicates with the operating system and requests services through system calls, that is, the current program is interrupted by the system call command, and the corresponding subroutine in the operating system is executed to complete a specific task. After the system function is completed, the control returns to an instruction after the system call command is issued, and the interrupted program will continue to execute. For example, in this process, the system call parameters are placed in a specified location, such as a register, and then a TRAP instruction is issued to the operating system. After TRAP, the operating system takes control, it checks whether the parameters are valid, and if so, completes the requested work. When the work is completed, the status code is given in the register to notify success or failure, and then a RETURN FROM TRAP instruction is executed to return control to the TRAP.

传统的计算机系统虽然通过系统调用,使得应用程序和操作系统之间可以实现效率较高的通信,但是因为操作系统不仅管理整个计算机系统的硬件资源和软件资源,而且为应用程序提供服务和支持,使得操作系统庞大而复杂。事实证明,现有的传统式操作系统因为其庞大的代码和复杂的功能,漏洞较多,有不少被攻击的隐患,而且不利于维护。Although the traditional computer system enables efficient communication between the application program and the operating system through system calls, the operating system not only manages the hardware resources and software resources of the entire computer system, but also provides services and support for the application program. Make the operating system large and complex. Facts have proved that the existing traditional operating system has many loopholes due to its huge code and complex functions, there are many hidden dangers of being attacked, and it is not conducive to maintenance.

传统的整体内核操作系统是许多过程的集合,每个过程都可以任意调用其他过程,每个过程都有定义好的接口,互相间的调用不受约束。这样,当操作系统中的一个过程或者说一个功能组件被无意或恶意的破坏后,很容易影响其他的功能组件,造成整个系统的崩溃。The traditional overall kernel operating system is a collection of many processes, each process can call other processes arbitrarily, each process has a defined interface, and the calls between each other are not restricted. In this way, when a process or a functional component in the operating system is damaged unintentionally or maliciously, it is easy to affect other functional components and cause the entire system to crash.

2、微内核计算机系统2. Microkernel computer system

微内核是二十世纪八十年代产生出来的较新的内核结构,强调结构性部件与功能性部件的分离。微内核结构由一个非常简单的硬件抽象层和一组比较关键的原语或系统调用组成,这些原语仅仅包括了建立一个系统必需的几个部分,如线程管理,地址空间和进程间通信等。所有其他服务,包括各种设备的驱动程序、内存管理、文件系统等,都和一般应用进程一样运行在用户模式,请求服务的客户进程通过IPC请求服务组件的服务。每个服务组件都运行在自己的进程空间,彼此隔离,这样的设计使内核中最核心的部分的设计更简单。一个服务组件的失效并不会导致整个系统的崩溃,内核需要做的,仅仅是重新启动这个组件,而不必影响其它的部分。The microkernel is a relatively new kernel structure produced in the 1980s, emphasizing the separation of structural components and functional components. The microkernel structure consists of a very simple hardware abstraction layer and a set of key primitives or system calls. These primitives include only a few parts necessary to build a system, such as thread management, address space, and interprocess communication. . All other services, including various device drivers, memory management, file systems, etc., run in the user mode like general application processes, and the client process that requests the service requests the service of the service component through IPC. Each service component runs in its own process space and is isolated from each other. This design makes the design of the core part of the kernel easier. The failure of a service component will not cause the entire system to crash. What the kernel needs to do is just restart this component without affecting other parts.

微内核虽然相对于传统的整体式内核来说有诸多优点,但是也同样存在很多问题,比如IPC耗时较多是影响微内核计算机系统效率的最重要问题。Although the microkernel has many advantages compared to the traditional monolithic kernel, there are also many problems. For example, the time-consuming IPC is the most important problem affecting the efficiency of the microkernel computer system.

2.1)第一代微内核2.1) The first generation microkernel

微内核的概念是由Richard Rashid在卡内基梅隆大学开发Mach操作系统时提出的,目标是建立一个基于消息传送机制的最小内核。参见图2,示出了根据现有技术的Mach微内核的结构图。Mach微内核为例,该微内核提供了进程管理、线程管理、内存管理、通信和I/O服务的功能,把传统操作系统提供的其他功能(如:文件管理、目录管理)移出内核,在用户空间控制和管理。Mach采用消息传递方式通信,通信功能由Mach核心中的IPC机制实现。The concept of the microkernel was proposed by Richard Rashid when he developed the Mach operating system at Carnegie Mellon University. The goal is to establish a minimal kernel based on the message passing mechanism. Referring to FIG. 2 , it shows a structure diagram of a Mach microkernel according to the prior art. Take the Mach microkernel as an example. This microkernel provides the functions of process management, thread management, memory management, communication and I/O services, and removes other functions provided by traditional operating systems (such as file management and directory management) from the kernel. User space control and management. Mach uses message passing to communicate, and the communication function is realized by the IPC mechanism in the core of Mach.

但是,包括Mach在内的第一代微内核设计有一个重要缺点:由于微内核使用进程来隔离系统组件,这些组件之间的通信通过消息传递来实现。组件间的每次通信都是一个IPC过程,其性能一般低于传统操作系统的系统调用的性能。由于微内核操作系统的IPC是通过消息传送机制实现的,而传统操作系统的系统调用一般是通过类似trap的方法实现。相比于trap方法,通过消息传送机制实现完成一次IPC操作较慢,这是由于需要创建消息、发送消息、进程切换等更多的步骤。这些步骤使得微内核操作系统的消息传送部分成为一个瓶颈,其性能大大低于传统操作系统的系统调用部分。例如,在Mach 3上,一个基于消息传送机制的类RPC调用在486-DX50上引入了230μs的开销,而一个传统Unix系统的系统调用在同一硬件上仅仅引入了20μs的开销。这就是说,传统Unix系统的系统调用比Mach 3的类RPC调用快10倍。这些性能下降除了是由于消息传送机制过多的步骤引起外,还和微内核设计导致的过多用户态和核心态之间的切换以及过多的不同地址空间之间的切换有关。一个研究表明不同地址空间之间的切换导致较高的Cache未命中率是导致性能下降的重要原因。However, first-generation microkernel designs, including Mach, had an important shortcoming: since microkernels used processes to isolate system components, communication between these components was achieved by message passing. Each communication between components is an IPC process, and its performance is generally lower than that of system calls in traditional operating systems. Because the IPC of the microkernel operating system is implemented through a message transmission mechanism, the system call of a traditional operating system is generally implemented through a method similar to trap. Compared with the trap method, it is slower to complete an IPC operation through the message transmission mechanism, because more steps such as creating a message, sending a message, and switching between processes are required. These steps make the message passing part of the microkernel operating system a bottleneck, whose performance is much lower than the system call part of the traditional operating system. For example, on Mach 3, a message-passing-based RPC-like call introduces an overhead of 230 μs on a 486-DX50, while a traditional Unix system call introduces only 20 μs on the same hardware. That is to say, the system call of the traditional Unix system is 10 times faster than the RPC-like call of Mach 3. These performance degradations are not only caused by too many steps in the message transmission mechanism, but also related to the excessive switching between user mode and kernel mode and too many switching between different address spaces caused by the microkernel design. A study shows that switching between different address spaces leads to a high Cache miss rate is an important reason for performance degradation.

2.2)第二代微内核2.2) The second generation microkernel

解决微内核设计性能问题的一个方法是扩大微内核并把一些关键的服务程序和驱动程序重新加入到内核中去,从而减少系统在用户态和核心态之间的切换以及系统在不同地址空间之间的切换。这方面的例子有Mach操作系统和Chorus操作系统。但是,扩大内核的方法大大削弱了微内核思想带来的优点——扩大的内核降低了系统的扩充性、灵活性和可靠性。One way to solve the performance problem of microkernel design is to expand the microkernel and re-add some key service programs and drivers to the kernel, thereby reducing the switching between the user state and the kernel state and the system switching between different address spaces. switch between. Examples of this are Mach OS and Chorus OS. However, the method of enlarging the kernel greatly weakens the advantages brought by the idea of microkernel - the enlarging kernel reduces the scalability, flexibility and reliability of the system.

与扩大内核的思路相反,解决微内核性能问题的另一条思路是进一步减少内核的大小并对尽力对IPC进行优化。这种思路导致了被称为第二代微内核的一些新的内核设计的出现。在这些新的微内核中,L4微内核是一个著名的例子。Contrary to the idea of expanding the kernel, another way to solve the microkernel performance problem is to further reduce the size of the kernel and optimize the IPC as much as possible. This line of thinking led to some new kernel designs known as second-generation microkernels. Among these new microkernels, the L4 microkernel is a famous example.

图3是根据现有技术的L4微内核的结构图。参见图3,L4内核只提供基本的地址空间管理,线程创建,销毁,消息传递等基本操作功能,其它如驱动程序、文件操作,网络协议处理等都交给用户态应用处理。L4微内核的中断处理方式是把硬件中断处理成IPC消息,微内核把硬件当作是一些能够发送IPC消息给相关处理代码的线程,而把中断服务程序当作是一些正在接收这些IPC消息的线程。当一个硬件中断发生时,微内核会为这个中断产生一条消息并把此消息发送到和此中断相关联的用户进程中,然后由用户进程中的负责接收这条IPC消息的线程来处理这个硬件中断。这样,内核只负责产生中断消息,而不用涉及到具体的中断处理,从而使得中断处理的具体策略和内核隔离开来。Fig. 3 is a structure diagram of an L4 microkernel according to the prior art. Referring to Figure 3, the L4 kernel only provides basic address space management, thread creation, destruction, message passing and other basic operating functions, and other functions such as driver programs, file operations, and network protocol processing are handed over to user-mode applications for processing. The interrupt handling method of the L4 microkernel is to process hardware interrupts into IPC messages. The microkernel regards hardware as threads that can send IPC messages to related processing codes, and treats interrupt service routines as some threads that are receiving these IPC messages. thread. When a hardware interrupt occurs, the microkernel generates a message for the interrupt and sends the message to the user process associated with the interrupt, and then the thread in the user process responsible for receiving the IPC message handles the hardware interruption. In this way, the kernel is only responsible for generating interrupt messages without involving specific interrupt processing, so that the specific strategy of interrupt processing is isolated from the kernel.

L4的地址空间管理原语负责内存地址空间的映射,支持三个操作:Grant(给出)、Map(映射)和Flush(收回),进程之间通过IPC完成以上三个操作,比如最开始,所有的内存都给一个进程,其他新来的进程,可以向他申请内存。The address space management primitive of L4 is responsible for the mapping of the memory address space and supports three operations: Grant (given), Map (mapped) and Flush (taken back). The above three operations are completed through IPC between processes. For example, at the beginning, All the memory is given to one process, and other new processes can apply for memory from him.

L4的硬件中断处理以及内存管理都是通过IPC实现的,也就是说与第一代微内核相比,L4并没有减少IPC,而是通过对IPC进行优化来提高效率。L4通过以下方法来提高IPC效率的,首先在IPC中的小消息通过寄存器传递,可以大大提高效率;大消息用Map映射机制;另外每个线程都有一个内核堆栈(kernel stack)可以降低缓存(cache)的未命中率。L4's hardware interrupt processing and memory management are implemented through IPC, that is to say, compared with the first-generation microkernel, L4 does not reduce IPC, but improves efficiency by optimizing IPC. L4 improves the efficiency of IPC through the following methods. First, small messages in IPC are passed through registers, which can greatly improve efficiency; large messages use the Map mapping mechanism; in addition, each thread has a kernel stack (kernel stack) to reduce the cache ( cache) miss rate.

总之,第一代微内核的主要瓶颈是IPC耗时较多造成系统效率不高;而以L4为代表的第二代微内核致力于减小IPC耗时,在系统效率提高方面与第一代相比有了一定的改进。但是,不论是第一代微内核还是第二代微内核,IPC都是非常多的,即使使IPC耗时降到很小,也只能在一定程度上提高效率。另外,IPC越多,安全隐患越多,越不容易对系统进行安全监控。In short, the main bottleneck of the first-generation microkernel is that IPC takes too much time, resulting in low system efficiency; while the second-generation microkernel represented by L4 is dedicated to reducing IPC time-consuming, and is comparable to the first-generation microkernel in terms of system efficiency improvement. There has been a certain improvement compared to. However, whether it is the first-generation microkernel or the second-generation microkernel, there are many IPCs. Even if the IPC time consumption is reduced to a small amount, the efficiency can only be improved to a certain extent. In addition, the more IPCs, the more security risks, and the less easy it is to monitor the system security.

3、外内核计算机系统3. External core computer system

传统的内核设计(包括整体内核和微内核)都对硬件作了抽象,把硬件资源隐藏在硬件抽象层下。比方说,在这些系统中,如果分配一段物理存储,应用程序并不知道它的实际位置。而外内核不抽象硬件资源,而是把资源导出,比如是让应用程序向外内核请求一块“特定”的物理空间,一块“特定”的磁盘块等等。外内核使用三种操作安全的导出硬件资源:一种是把应用程序和资源安全绑定在一起,实现方法是通过给每个资源分配一个能判定使用者权限的口令,每次使用资源时,外内核先进行权限检查;第二是对已经分配的资源使用可见回收协议,在该协议中,应用程序接到资源不足的通报,可以自己作出放弃哪些资源这类的决定;最后是使用强制终止协议,对于不接收撤回的应用程序使用强制性解除安全绑定。Traditional kernel designs (including monolithic kernels and microkernels) abstract hardware and hide hardware resources under the hardware abstraction layer. For example, in these systems, if a piece of physical storage is allocated, the application does not know its actual location. The outer kernel does not abstract hardware resources, but exports resources, such as allowing applications to request a "specific" physical space, a "specific" disk block, and so on from the outer kernel. The external kernel uses three kinds of safe operation to export hardware resources: one is to bind the application program and resources together securely, and the realization method is to assign a password to each resource that can determine the user's authority, and each time the resource is used, The outer kernel first checks the permissions; the second is to use the visible recycling protocol for the allocated resources. In this protocol, the application program receives a notification of insufficient resources and can make its own decisions about which resources to give up; the last is to use forced termination. protocol to use mandatory unbind security for applications that do not receive recalls.

外内核的目标是:把系统保护和资源管理分开。外内核只负责系统保护和系统资源复用相关的服务,保证被请求的资源当前是空闲的,应用程序就允许直接存取它。因为不对硬件资源进行抽象,外内核通过增加额外的运行库支持来为用户程序提供完整的功能,这些运行库运行在外内核之上,使用下层外内核的接口,为应用程序实现上层的抽象,而且大部分运行库的代码运行在使用它的应用程序的地址空间中。The goal of the outer kernel is to separate system protection from resource management. The outer kernel is only responsible for the services related to system protection and system resource reuse, ensuring that the requested resource is currently idle, and the application program is allowed to directly access it. Because the hardware resources are not abstracted, the outer kernel provides complete functions for user programs by adding additional runtime support. These runtime libraries run on the outer kernel, use the interface of the lower outer kernel, and realize the upper layer abstraction for the application program, and Most of the runtime code runs in the address space of the application that uses it.

参见图4,示出了根据现有技术的Aegis外内核的结构图。Aegis是一个外内核操作系统实例。在Aegis中,系统调度是通过时间片流转机制实现的,每一个应用程序与一个时间片相对应。Aegis把CPU当成一个线性失量,用位置标识使用时间片的顺序和收回时机,用位置信息在应用程序执行时间的满足和吞吐率延迟间权衡。举例来说,对于一个需要长时间运行的计算程序,给它分配连续的时间片以减轻程序切换过程切换程序上下文的消耗。而对于交换性强的应用程序,Aegis为它提供长度相同的时间片,以最大化其反应速度。系统通过限定应用程序保存上下文环境的时间确保公平,每一个对时间片提出要求的下一个中断都会由时间计数器记录下来。对于任意的应用程序来说,它们都要为在保存应用程序环境时多消耗的每一个时间片在接下来的时间片申请内付出代价。如果应用程序用到的时间超出预定值,系统就消灭其运行环境。Aegis也有比较友好的方法,系统会代为应用程序保存其上下文环境。Referring to FIG. 4 , it shows a structural diagram of an Aegis exo-core according to the prior art. Aegis is an instance of an out-of-kernel operating system. In Aegis, system scheduling is realized through the time slice flow mechanism, and each application corresponds to a time slice. Aegis regards the CPU as a linear quantity, uses the position to identify the order of using time slices and the timing of reclaiming, and uses the position information to balance the satisfaction of application execution time and throughput delay. For example, for a calculation program that needs to run for a long time, it is allocated continuous time slices to reduce the consumption of program context switching during program switching. For applications with strong switching, Aegis provides time slices of the same length to maximize its response speed. The system ensures fairness by limiting the time that the application saves the context environment, and every next interrupt that requires a time slice will be recorded by the time counter. For any application, they pay for each additional time slice saved in the application environment in the next time slice application. If the application takes more than a predetermined amount of time, the system destroys its running environment. Aegis also has a more friendly method, the system will save its context on behalf of the application.

Aegis的处理器环境是一个存储将事件发送给应用程序时所需信息的结构。由于Aegis必须把与资源相关的事件与资源所以者相关联,所有的资源消耗都和这个环境发生相关联。Aegis主要管理四种事件:异常,中断,受保护的控制转移和地址变换。Aegis也与这四种事件相对应有四种处理器环境。Aegis' processor context is a structure that stores the information needed to send events to the application. Since Aegis must associate resource-related events with the resource owner, all resource consumption is associated with this environment occurrence. Aegis mainly manages four kinds of events: exception, interrupt, protected control transfer and address change. Aegis also has four processor environments corresponding to these four events.

为有效的实现操作系统的进程间通讯功能,Aegis提供一种受保护的控制权交替机制。从操作上看,受保护的控制权转换在调用端把程序计数器赋成一个固定的值,用于标识处理器环境中的当下时间片,并安装调用端处理器环境上下文环境的元素(地址上下文标识符,地址空间标签和处理器状态字)。In order to effectively implement the inter-process communication function of the operating system, Aegis provides a protected control alternation mechanism. From an operational point of view, a protected transfer of control assigns the program counter to a fixed value at the calling end, which is used to identify the current time slice in the processor context, and installs the elements of the calling end processor context context (address context identifier, address space label, and processor status word).

由上面的介绍可知,外内核的设计思想是,内核为应用程序导出硬件资源,而不是提供一组抽象,它的责任是通过一定的机制保证硬件资源的安全复用。应用程序直接向外内核请求硬件资源的使用,内核本身只保证被请求的资源当前是空闲的,应用程序就被允许直接存取它。外内核虽然没有负责对硬件资源的管理,但是它不仅要为应用程序导出硬件资源,还要通过比较复杂的协议保证硬件资源被安全复用,比如安全绑定、可见回收协议和强制终止协议。这样一种运行模式,和其他微内核相比,虽然可以使应用程序对硬件资源的访问和使用有更高的效率,但是比较复杂的安全机制还是会消耗一定的系统资源,从而降低系统运行的效率;另外,应用程序对硬件资源的复用,也会具有一定的安全隐患,为了保证安全性,就使系统对管理硬件资源复用的机制提出比较高的要求。对硬件资源复用管理程序的维护也有很高的要求,因为这个程序的错误将会导致整个系统不能正常运行。From the above introduction, we can see that the design idea of the outer kernel is that the kernel exports hardware resources for applications, rather than providing a set of abstractions. Its responsibility is to ensure the safe reuse of hardware resources through a certain mechanism. The application program directly requests the use of hardware resources from the external kernel, and the kernel itself only guarantees that the requested resource is currently free, and the application program is allowed to directly access it. Although the external kernel is not responsible for the management of hardware resources, it not only exports hardware resources for applications, but also ensures that hardware resources are reused safely through more complex protocols, such as security binding, visible recycling protocol, and forced termination protocol. Such an operating mode, compared with other microkernels, can make applications more efficient in accessing and using hardware resources, but more complex security mechanisms will still consume certain system resources, thus reducing the operating time of the system. Efficiency; In addition, the multiplexing of hardware resources by applications will also have certain security risks. In order to ensure security, the system puts forward relatively high requirements on the mechanism for managing the multiplexing of hardware resources. There are also high requirements for the maintenance of the hardware resource multiplexing management program, because errors in this program will cause the entire system to fail to operate normally.

外内核的这种设计思想,主要是为了在外内核之上建立一个操作系统运行库,应用程序可以运行在运行库之上,系统的大部分服务和抽象都在用户级的库中实现。而本发明的设计思想是,应用程序和硬件资源是绑定的,系统中不存在硬件资源复用的问题。应用程序不通过任何“中介”直接对和自己绑定的硬件资源进行管理和访问,这就使系统不仅具有比Aegis更高的效率,还有更好的安全性,适合应用在对安全性要求高的专用系统中,比如网络防火墙、路由器等等。The design idea of the outer kernel is mainly to build an operating system runtime library on the outer kernel. Applications can run on the runtime library, and most services and abstractions of the system are implemented in user-level libraries. However, the design concept of the present invention is that application programs and hardware resources are bound, and there is no problem of multiplexing hardware resources in the system. The application directly manages and accesses the hardware resources bound to itself without any "intermediary", which makes the system not only have higher efficiency than Aegis, but also better security, suitable for applications that require security High dedicated systems, such as network firewalls, routers, and so on.

发明内容 Contents of the invention

因此,本发明旨在克服现有技术的计算机系统的上述缺陷,提供了一种新的计算机系统实现方法,以及利用该方法实现的计算机系统,以实现更高的效率、更好的稳定性、和更好的安全性,适合应用在对安全性要求高的专用系统中,比如网络防火墙、路由器、或网络防火墙等等。Therefore, the present invention aims at overcoming the above-mentioned defect of the computer system of prior art, provides a kind of new computer system realization method, and the computer system realized by this method, to realize higher efficiency, better stability, And better security, suitable for application in special systems with high security requirements, such as network firewalls, routers, or network firewalls, etc.

本发明的其它优点、目的和特征将至少部分地在随后的说明书中阐述,部分地在本领域普通技术人员分析以下内容的基础上变得显而易见,或者通过实施本发明而了解。本发明的目的和其它优点可通过在说明书、权利要求、以及附图中所特别指出的结构来实现和达到。Other advantages, objects and features of the present invention will at least partly be set forth in the ensuing description, and partly become apparent to those of ordinary skill in the art on the basis of analyzing the following content, or can be understood by practicing the present invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description, claims hereof as well as the appended drawings.

根据本发明,提供了一种新的计算机系统,其包括:多个独立处理装置,其中,每个所述独立处理装置均用于独立完成对硬件资源的管理和访问以及实现一个应用功能,并独占所需硬件资源,所述多个独立处理装置之间的通信通过消息传递来实现;以及交换装置,用于实现对所述多个独立处理装置的调度、监控、和实现所述多个独立处理装置之间的所述消息传递;其中交换装置包括:调度器,用于实现对多个独立处理装置的调度;消息传递器,用于实现多个独立处理装置之间的消息传递;监控器,用于监控多个独立处理装置;以及交换装置还储存待处理消息队列和独立处理装置的参数。According to the present invention, a new computer system is provided, which includes: a plurality of independent processing devices, wherein each of the independent processing devices is used to independently manage and access hardware resources and realize an application function, and Exclusively occupying the required hardware resources, the communication between the multiple independent processing devices is realized by message passing; and the switching device is used to implement the scheduling and monitoring of the multiple independent processing devices The message transfer between processing devices; wherein the switching device includes: a scheduler, used to realize the scheduling of multiple independent processing devices; a message transmitter, used to realize message transfer between multiple independent processing devices; a monitor , for monitoring a plurality of independent processing devices; and the switching device also stores pending message queues and parameters of the independent processing devices.

根据本发明的计算机系统解决了传统计算机系统的系统庞大、难以维护、以及安全性差的问题,以及解决了微内核技术和外内核技术的效率低的问题。根据本发明,提供了一种高效率、高安全性的系统,很适合应用在网络交换机或者路由器等嵌入式设备中。The computer system according to the invention solves the problems of the traditional computer system, such as large system size, difficult maintenance, and poor security, and solves the problem of low efficiency of the microkernel technology and the outer kernel technology. According to the present invention, a high-efficiency, high-security system is provided, which is very suitable for application in embedded devices such as network switches or routers.

附图说明 Description of drawings

附图提供了对本发明的进一步理解,并入并且构成本申请的一部分。附图说明本发明的实施例,并与说明书一起解释本发明原理。在附图中:The accompanying drawings are included to provide a further understanding of the invention, and are incorporated in and constitute a part of this application. The drawings illustrate embodiments of the invention and, together with the description, explain the principles of the invention. In the attached picture:

图1是根据现有技术的计算机系统的结构图;Fig. 1 is a structural diagram of a computer system according to the prior art;

图2是根据现有技术的Mach微内核的结构图;Fig. 2 is the structural diagram according to the Mach microkernel of prior art;

图3是根据现有技术的L4微内核的结构图;Fig. 3 is the structural diagram according to the L4 microkernel of prior art;

图4是根据现有技术的Aegis外内核的结构图;Fig. 4 is the structural diagram according to the Aegis outer kernel of prior art;

图5是根据本发明的一个实施例的计算机系统100的结构图;FIG. 5 is a structural diagram of a computer system 100 according to an embodiment of the present invention;

图6是根据本发明的另一个实施例的计算机系统200的结构图;FIG. 6 is a structural diagram of a computer system 200 according to another embodiment of the present invention;

图7是根据本发明的一个实施例的S-F系统的结构图;Figure 7 is a structural diagram of an S-F system according to an embodiment of the present invention;

图8是根据本发明的一个实施例的Switch系统的结构图;Fig. 8 is a structural diagram of a Switch system according to an embodiment of the present invention;

图9是根据本发明的一个实施例的S-F系统间的消息传递机制的流程图;以及FIG. 9 is a flowchart of a message delivery mechanism between S-F systems according to an embodiment of the present invention; and

图10是根据本发明的一个实施例的计算机系统的消息结构图。Fig. 10 is a message structure diagram of a computer system according to an embodiment of the present invention.

具体实施方式 Detailed ways

下面将以实施例的方式对本发明加以描述,应该注意的是,本发明的这些实施例并不用于限制依据于权利要求的本发明,并且并非在实施例中所描述的所有特征的组合都是本发明的解决方案所必须的。The present invention will be described below in the form of embodiments, it should be noted that these embodiments of the present invention are not intended to limit the present invention according to the claims, and not all combinations of features described in the embodiments are necessary for the solution of the present invention.

首先参见图5,示出了本发明的一个实施例的计算机系统100的结构图。本发明设计了一种新的计算机系统实现方法。这种系统实现方法,可以使用在嵌入式或者其他控制用的计算机系统中。计算机系统由多个可以独立完成某些功能的独立处理装置,以及对装置进行调度、监控和实现多个独立处理装置之间的消息传递的交换装置构成。Referring first to FIG. 5 , a structural diagram of a computer system 100 according to an embodiment of the present invention is shown. The invention designs a new computer system realization method. This system implementation method can be used in embedded or other computer systems for control. A computer system is composed of multiple independent processing devices that can independently complete certain functions, and a switching device that schedules, monitors, and implements message transmission among multiple independent processing devices.

每个独立处理装置可以独立实现一定的功能,包括对硬件资源的访问和管理都可以在装置内部实现。这些独立处理装置包括图5中的网口数据包过滤装置、串口数据包过滤装置、以及完成其他功能的装置。一个独立处理装置可以看作是一个数据处理单元,每个单元占用系统一定的资源,完成特定的功能,各个装置之间的数据传递是通过消息的形式实现的。每个独立处理装置包括代码段和数据段,代码段和数据段在内存中分别独立地占用两段空间,代码和数据的寻址分别通过各自的段选择址和段内偏移地址来实现。各个独立处理装置运行在不同的CPU级别上,通过硬件来进行安全保护。优选地,独立处理装置中还包括看门狗装置,用于定时向选定的独立处理装置发送看门狗消息。Each independent processing device can independently implement certain functions, including the access and management of hardware resources can be implemented inside the device. These independent processing devices include the network port data packet filtering device, the serial port data packet filtering device, and devices for completing other functions in FIG. 5 . An independent processing device can be regarded as a data processing unit, and each unit occupies certain resources of the system to complete specific functions, and the data transmission between each device is realized in the form of messages. Each independent processing device includes a code segment and a data segment. The code segment and the data segment independently occupy two segments of space in the memory, and the addressing of the code and data is realized through respective segment selection addresses and intra-segment offset addresses. Each independent processing device runs on different CPU levels, and implements security protection through hardware. Preferably, the independent processing device further includes a watchdog device, which is used to regularly send watchdog messages to the selected independent processing device.

系统中的交换装置可以实现对多个独立处理装置的调度和监控以及这些装置之间的数据交换。当多个独立处理装置中的一个出错时,交换装置恢复出错的独立处理装置。交换装置包括:调度器,用于实现对多个独立处理装置的调度;消息传递器,用于实现多个独立处理装置之间的消息传递;监控器,用于监控多个独立处理装置;以及交换装置还储存待处理消息队列和独立处理装置的参数。交换装置中储存的独立处理装置的参数包括独立处理装置在某个时间内应该处理完成消息的时间参数,以及独立处理装置的加电时初始状态;当独立处理装置在时间参数的时间范围内没有处理完所述消息时,所述监控器通过独立处理装置的加电时初始状态对其进行恢复。The switching device in the system can realize the scheduling and monitoring of multiple independent processing devices and the data exchange between these devices. When one of the plurality of independent processing devices fails, the switching device recovers the faulty independent processing device. The switching device includes: a scheduler, used to realize the scheduling of multiple independent processing devices; a message transmitter, used to realize message transmission among multiple independent processing devices; a monitor, used to monitor multiple independent processing devices; and The switching means also stores the queue of messages to be processed and the parameters of the individual processing means. The parameters of the independent processing device stored in the switching device include the time parameter that the independent processing device should process the completion message within a certain time, and the initial state when the independent processing device is powered on; When the message has been processed, the supervisor restores it from its initial state on power-up by the independent processing means.

参见图6,示出了根据本发明的另一个实施例的计算机系统200的结构图。每个独立处理装置,称为一个“S-F系统(self-functioningsystem)”。优选地,S-F系统中有一个特殊的“软看门狗”系统,它完成的功能是每间隔一定的时间向特定的S-F系统发送测试消息。因为Switch(交换装置)是通过一个S-F系统处理消息的时间来判断这个S-F系统是否出现异常需要恢复的,对于没有消息处理的S-F系统就需要由“软看门狗”系统发送测试消息让它处理,Switch根据S-F系统处理测试消息的时间来判断它是否出现异常。这样,当不需要处理消息的S-F系统出现异常时,Switch也会及时发现并对其进行恢复。每个S-F系统可以独立的完成一定的功能,不需要调用其他S-F系统的函数。各个S-F系统相当于图5中的各个独立处理装置。但是在S-F系统之间有时需要传递数据,系统间的数据传递通过消息来实现。Switch只是处理消息传递和S-F系统的调度以及监控,不对硬件进行监管和访问。Referring to FIG. 6 , it shows a structural diagram of a computer system 200 according to another embodiment of the present invention. Each independent processing device is called a "S-F system (self-functioning system)". Preferably, there is a special "soft watchdog" system in the S-F system, and its function is to send test messages to a specific S-F system at regular intervals. Because the Switch (switching device) judges whether the S-F system is abnormal and needs to be restored through the time when the S-F system processes the message. For the S-F system without message processing, it is necessary to send a test message by the "soft watchdog" system for it to process. , the Switch judges whether it is abnormal according to the time it takes for the S-F system to process the test message. In this way, when an abnormality occurs in the S-F system that does not need to process messages, the Switch will also detect and recover it in time. Each S-F system can independently complete certain functions without calling functions of other S-F systems. Each S-F system is equivalent to each independent processing device in FIG. 5 . But sometimes it is necessary to transfer data between S-F systems, and the data transfer between systems is realized through messages. Switch only handles message passing and scheduling and monitoring of the S-F system, and does not monitor and access hardware.

参见图7,示出了根据本发明的一个实施例的S-F系统的结构图。管理、访问硬件的程序和需要调用它的应用程序组成独立的S-F系统,可以独立地完成一定的功能而不需要再调用其他S-F系统的函数。针对不同的应用程序,构造不同的S-F系统。例如,为了完成网口数据包过滤功能、串口数据包过滤功能、数据签名功能、或其他功能,可以分别创建网口数据包过滤功能S-F系统、串口数据包过滤功能S-F系统、数据签名功能S-F系统、或其他功能S-F系统。这些S-F系统不对外提供接口也不调用其他S-F系统的函数,S-F系统间的通信通过消息传递来实现。S-F系统之间的数据传递通过消息传递来实现,Switch中有管理消息传递的程序。Referring to Fig. 7, it shows a structural diagram of an S-F system according to an embodiment of the present invention. The program that manages and accesses the hardware and the application program that needs to call it form an independent S-F system, which can independently complete certain functions without calling other S-F system functions. Construct different S-F systems for different applications. For example, in order to complete the network port data packet filtering function, serial port data packet filtering function, data signature function, or other functions, the network port data packet filtering function S-F system, the serial port data packet filtering function S-F system, and the data signature function S-F system can be created respectively , or other functional S-F systems. These S-F systems do not provide external interfaces or call functions of other S-F systems, and the communication between S-F systems is realized through message passing. Data transmission between S-F systems is realized through message transmission, and there is a program for managing message transmission in Switch.

下面将描述S-F系统间的消息传递机制。The message passing mechanism between S-F systems will be described below.

图9示出了根据本发明的一个实施例的S-F系统间的消息传递机制的流程图。其步骤如下:FIG. 9 shows a flowchart of a message transfer mechanism between S-F systems according to an embodiment of the present invention. The steps are as follows:

在S-F系统本空间内构造消息(步骤S10)。Construct a message in the local space of the S-F system (step S10).

需要传送消息的S-F系统调用Switch中的消息发送函数,调用参数为源S-F系统的ID号和目的S-F系统的ID号。消息发送函数从发送消息的S-F系统处取得消息,放入Switch的系统中的消息队列里等待处理(步骤S20)。The S-F system that needs to transmit the message calls the message sending function in the Switch, and the calling parameters are the ID number of the source S-F system and the ID number of the destination S-F system. The message sending function obtains the message from the S-F system that sends the message, and puts it into the message queue of the Switch system to wait for processing (step S20).

消息传递程序对消息进行分析,通过消息的类型域判断该消息是否是测试消息。如果是测试消息,查看接收消息的目的S-F系统待处理消息队列是否为空,如果是空,则把该消息放到目的S-F系统待处理消息队列中;如果不为空,则把这个消息丢弃。如果消息是数据消息,提取出数据,然后把消息放入S-F系统列表中相应的S-F系统待处理消息队列的末尾。图10是根据本发明的一个实施例的计算机系统的消息结构图(步骤S30)。The message delivery program analyzes the message, and judges whether the message is a test message through the type field of the message. If it is a test message, check whether the pending message queue of the destination S-F system receiving the message is empty, if it is empty, then put the message in the pending message queue of the destination S-F system; if not empty, then discard the message. If the message is a data message, the data is extracted, and then the message is put at the end of the corresponding S-F system pending message queue in the S-F system list. Fig. 10 is a message structure diagram of a computer system according to an embodiment of the present invention (step S30).

当调度程序把CPU控制权交给一个S-F系统的时候,S-F系统就从待处理消息队列中取到一个消息进行处理(步骤S40)。When the scheduler gives the CPU control right to an S-F system, the S-F system will get a message from the waiting message queue for processing (step S40).

参见图8,示出了本发明的一个实施例的计算机系统的结构图。计算机系统由可以独立实现一定功能的S-F系统以及Switch组成。S-F系统是由应用程序和它需要调用的硬件访问和管理程序一起链接而成的,可以独立完成一定的功能。传统操作系统中,应用程序虽然可以和整体内核中的硬件访问组件通过系统调用于进行效率较高的通信,但是这样会造成内核的庞大不易维护和管理;微内核系统中应用程序和内核之外用户态的硬件管理程序之间的通信都是通过消息来实现,但是这样对于效率的提高造成很大的困难。S-F系统可以在自己的系统内部实现对硬件的管理和访问,S-F系统之间只有一些较少的基于消息的数据传递。这种实现方法和微内核相比,减少了很多消息传递的过程,可以提高效率。Referring to FIG. 8 , it shows a structural diagram of a computer system according to an embodiment of the present invention. The computer system is composed of S-F system and Switch which can realize certain functions independently. The S-F system is linked together by the application program and the hardware access and management program it needs to call, and can independently complete certain functions. In traditional operating systems, although applications can communicate efficiently with hardware access components in the overall kernel through system calls, this will result in a large kernel that is difficult to maintain and manage; The communication between the hardware management programs in the user mode is realized through messages, but this causes great difficulties in improving the efficiency. The S-F system can realize the management and access to the hardware within its own system, and there are only some less message-based data transfers between the S-F systems. Compared with the microkernel, this implementation method reduces a lot of message passing processes and can improve efficiency.

每个S-F系统独立地完成一定的功能,而不需要调用其他S-F系统的函数。当任何一个S-F系统崩溃之后不会对其他的S-F系统造成影响,而且可以根据崩溃的S-F系统的参数对系统进行恢复,这样增强了系统的安全性和鲁棒性。“软看门狗”系统可以保证不需要处理数据的S-F系统出现异常时Switch也会及时发现。Each S-F system completes certain functions independently without calling functions of other S-F systems. When any S-F system crashes, it will not affect other S-F systems, and the system can be recovered according to the parameters of the crashed S-F system, which enhances the security and robustness of the system. The "soft watchdog" system can ensure that the Switch will find out in time when the S-F system that does not need to process data is abnormal.

Switch只负责S-F系统调度,监控和系统间通信,不负责管理和访问硬件资源。实现功能简单,易于维护和修复;Switch不直接处理来自计算机系统外部的数据,不易受到攻击;而且即使Switch受到攻击,也不容易造成整个计算机系统的崩溃。Switch is only responsible for S-F system scheduling, monitoring and inter-system communication, not for managing and accessing hardware resources. The implementation function is simple, easy to maintain and repair; Switch does not directly process data from outside the computer system, so it is not easy to be attacked; and even if Switch is attacked, it is not easy to cause the collapse of the entire computer system.

优选地,因为S-F系统之间不直接进行消息传递,而是通过Switch进行中转,并且与传统操作系统和微内核相比消息传递的次数非常少,所以便于在Switch上建立对于所有传递的数据的监控机制,提高系统的安全性。Preferably, because the S-F systems do not directly transmit messages, but are transferred through Switch, and compared with traditional operating systems and microkernels, the number of message transmissions is very small, so it is convenient to establish on the Switch for all transmitted data. Monitoring mechanism to improve system security.

优选地,当一个S-F系统被破坏后,通过Switch保存的该S-F系统的加电时初始状态对其进行恢复。这样可使系统快速回复正常。Preferably, when an S-F system is destroyed, the initial state of the S-F system saved by the Switch is restored when it is powered on. This allows the system to return to normal quickly.

优选地,S-F系统的代码段和数据段在内存中分别独立地占用两段空间,并且这两段内存空间是不连续的,代码和数据的寻址分别通过各自的段选择子和段内偏移来实现。Preferably, the code segment and the data segment of the S-F system independently occupy two segments of space in the memory, and the two segments of memory space are discontinuous, and the addressing of the code and data is respectively through the respective segment selector and intra-segment bias Move to achieve.

优选地,S-F系统可以运行在不同的CPU级别上,通过硬件来进行安全保护。Preferably, the S-F system can run on different CPU levels, and implement security protection through hardware.

可选地,S-F系统可以是网口数据包过滤装置、串口数据包过滤装置、数据签名装置,其可实现一定的功能包括网口数据包过滤功能、串口数据包过滤功能、数据签名功能。值得注意的是,这里的描述起到说明本发明的目的,而不是限定本发明,本发明可包括完成其他功能的装置,并可实现其他的功能。Optionally, the S-F system can be a network port data packet filter device, a serial port data packet filter device, and a data signature device, which can realize certain functions including network port data packet filter function, serial port data packet filter function, and data signature function. It should be noted that the description here is for the purpose of illustrating the present invention, rather than limiting the present invention, and the present invention may include devices for performing other functions, and may realize other functions.

这样一种高效率、高安全性的系统很适合应用在网络交换机或者路由器等嵌入式设备中。值得注意的是,这里的描述起到说明本发明的目的,而不是限定本发明,本发明可包括其他的计算机系统,例如防火墙、PC等。Such a high-efficiency, high-security system is very suitable for use in embedded devices such as network switches or routers. It should be noted that the description here is for the purpose of illustrating the present invention, rather than limiting the present invention, and the present invention may include other computer systems, such as firewalls, PCs, and so on.

根据本发明的计算机系统由可以独立完成一定功能的装置以及交换装置构成。因为独立处理装置可以独立的完成一定的功能包括对硬件资源的访问和管理,所以各个独立处理装置间只需要很少的通信,这样设计的出发点不是减小每次通信的时间,而是通过减少系统中多个独立处理装置之间的通信从根本上提高系统的效率。多个独立处理装置之间通信次数减小,也有利于对整个系统进行安全监控,有利于提高系统的安全性。交换装置只负责处理多个独立处理装置之间基于消息的通信,并且对各个独立处理装置进行调度。虽然交换装置是整个系统的核心,但是它不管理任何硬件和软件资源,完成的功能也很简单,代码量很小,易于维护。另外,每个装置都可以独立地完成功能,所以当一个装置被破坏之后不会造成整个系统的崩溃,只需要对该装置进行恢复即可。因为各个装置间的通信很少,所以交换装置可以对装置间传送的消息数据进行充分监控。这样一种效率高而且安全性很强又易于维护的计算机系统,尤其适合应用在网络交换机或者路由器中。The computer system according to the present invention is composed of devices capable of independently completing certain functions and switching devices. Because independent processing devices can independently complete certain functions including access and management of hardware resources, only a small amount of communication is required between independent processing devices. The starting point of this design is not to reduce the time of each communication, but to reduce Communication between multiple independent processing devices in the system fundamentally increases the efficiency of the system. The reduction in the number of communications between multiple independent processing devices is also conducive to the safety monitoring of the entire system and the improvement of system security. The switching device is only responsible for processing message-based communication between multiple independent processing devices, and scheduling each independent processing device. Although the switching device is the core of the entire system, it does not manage any hardware and software resources, and the functions it completes are also very simple, with a small amount of code and easy maintenance. In addition, each device can perform functions independently, so when a device is destroyed, the entire system will not collapse, and only the device needs to be restored. Since there is little communication between the various devices, the switching device can adequately monitor the message data transmitted between the devices. Such a computer system with high efficiency, strong security and easy maintenance is especially suitable for application in network switches or routers.

本发明设计了一种新的计算机系统。该计算机系统由可以独立完成某些功能的独立处理装置以及用于这些独立处理装置的调度和这些独立处理装置之间消息传递的交换装置构成,每个独立处理装置可以独立完成一定的功能,包括对硬件资源的访问和管理都可以在独立处理装置内部实现。每个独立处理装置都不需要调用其他独立处理装置的功能,也不提供被调用的接口,不同功能的独立处理装置之间的通信由消息传递来实现。交换装置不管理计算机的硬件等计算机资源,只负责这些独立处理装置的调度和这些独立处理装置之间消息的传递。这样的系统设计方法可以使用在嵌入式或者控制用的计算机系统中。The present invention designs a new computer system. The computer system is composed of independent processing devices that can independently complete certain functions, and switching devices for the scheduling of these independent processing devices and the exchange of messages between these independent processing devices. Each independent processing device can independently complete certain functions, including Both access and management of hardware resources can be implemented within the independent processing device. Each independent processing device does not need to call the functions of other independent processing devices, and does not provide an interface to be called, and the communication between independent processing devices with different functions is realized by message transmission. The switching device does not manage computer resources such as computer hardware, but is only responsible for the scheduling of these independent processing devices and the transmission of messages between these independent processing devices. Such system design methods can be used in embedded or control computer systems.

以上所述仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and changes. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.

Claims (9)

1.一种计算机系统,其特征在于,包括:1. A computer system, characterized in that, comprising: 多个独立处理装置,其中,每个所述独立处理装置均用于独立完成对硬件资源的管理和访问以及实现一个应用功能,并独占所需硬件资源,所述多个独立处理装置之间的通信通过消息传递来实现;以及A plurality of independent processing devices, wherein each of the independent processing devices is used to independently complete the management and access of hardware resources and realize an application function, and monopolize the required hardware resources. Communication is achieved by message passing; and 交换装置,用于实现对所述多个独立处理装置的调度、监控、和实现所述多个独立处理装置之间的所述消息传递;其中,所述交换装置包括:A switching device, configured to implement scheduling and monitoring of the plurality of independent processing devices, and realize the message transfer between the plurality of independent processing devices; wherein, the switching device includes: 调度器,用于实现对所述多个独立处理装置的所述调度;a scheduler for implementing said scheduling of said plurality of independent processing devices; 消息传递器,用于实现所述多个独立处理装置之间的所述消息传递;a message passer for enabling said message passing between said plurality of independent processing devices; 监控器,用于监控所述多个独立处理装置;以及a monitor for monitoring the plurality of independent processing devices; and 所述交换装置还储存待处理消息队列和所述独立处理装置的参数。The switching means also stores a queue of pending messages and parameters of the independent processing means. 2.根据权利要求1所述的计算机系统,其特征在于,所述独立处理装置包括:硬件管理和访问装置;以及一个应用装置,用于调用硬件管理和访问装置,以实现一个应用功能;所述独立处理装置是选自包括网口数据包过滤装置、串口数据包过滤装置、和数据签名装置的组中的一个装置。2. The computer system according to claim 1, wherein the independent processing means comprises: hardware management and access means; and an application means for invoking the hardware management and access means to realize an application function; The independent processing device is a device selected from the group consisting of a network port data packet filtering device, a serial port data packet filtering device, and a data signature device. 3.根据权利要求1所述的计算机系统,其特征在于,所述独立处理装置包括代码段和数据段,所述代码段和所述数据段在内存中分别独立地占用两段空间,代码和数据的寻址分别通过各自的段选择址和段内偏移地址来实现。3. computer system according to claim 1, is characterized in that, described independent processing device comprises code segment and data segment, and described code segment and described data segment occupy two sections of spaces independently respectively in memory, code and data segment Data addressing is realized through the respective segment selection addresses and offset addresses within the segment. 4.根据权利要求1所述的计算机系统,其特征在于,所述交换装置还用于监控所述多个独立处理装置,当所述多个独立处理装置中的一个出错时,所述交换装置恢复出错的独立处理装置。4. The computer system according to claim 1, wherein the switching device is also used for monitoring the plurality of independent processing devices, and when one of the plurality of independent processing devices fails, the switching device Restoring a faulty stand-alone processing unit. 5.根据权利要求1所述的计算机系统,其特征在于,所述多个独立处理装置运行在不同的CPU级别上,通过硬件来进行安全保护。5. The computer system according to claim 1, wherein the plurality of independent processing devices run on different CPU levels, and implement security protection through hardware. 6.根据权利要求1所述的计算机系统,其特征在于,所述交换装置中储存的所述独立处理装置的所述参数包括所述独立处理装置在某个时间内应该处理完成所述消息的时间参数,以及所述独立处理装置的加电时初始状态;当所述独立处理装置在所述时间参数的时间范围内没有处理完所述消息时,所述监控器通过所述独立处理装置的所述加电时初始状态对出错的独立处理装置进行恢复。6. The computer system according to claim 1, characterized in that, the parameters of the independent processing device stored in the switching device include that the independent processing device should complete processing of the message within a certain time time parameter, and the initial state when power-on of the independent processing device; when the independent processing device has not finished processing the message within the time range of the time parameter, the monitor passes the The initial state at power-on restores the faulty independent processing device. 7.根据权利要求1所述的计算机系统,其特征在于,所述交换装置通过以下步骤进行所述消息传递:7. The computer system according to claim 1, wherein the switching device performs the message transfer through the following steps: 在所述独立处理装置的空间内构造消息;constructing messages within the space of said independent processing means; 需要传送消息的所述独立处理装置利用所述独立处理装置的ID以及目的独立处理装置的ID号作为参数,调用所述交换装置中的所述消息传递器,所述消息传递器从发送消息的所述独立处理装置处取得消息,放入所述交换装置的所述待处理消息队列里等待处理;以及The independent processing device that needs to transmit a message uses the ID of the independent processing device and the ID number of the destination independent processing device as parameters to call the message transmitter in the switching device, and the message transmitter is sent from the message transmitter The independent processing device obtains the message, puts it into the pending message queue of the switching device and waits for processing; and 消息传递器对所述消息进行分析,提取出数据内容、长度、和类型,然后根据所述类型、所述长度、和目的独立处理装置的所述待处理消息队列的情况,来确定把所述消息放入所述独立处理装置列表中相应的所述独立处理装置的所述待处理消息队列的末尾或者是抛弃所述消息或者调整所述时间参数。The message delivery unit analyzes the message, extracts the data content, length, and type, and then determines to send the Putting the message at the end of the pending message queue of the corresponding independent processing device in the independent processing device list or discarding the message or adjusting the time parameter. 8.根据权利要求1所述的计算机系统,其特征在于,所述独立处理装置中还包括看门狗装置,用于定时向选定的所述独立处理装置发送看门狗消息。8 . The computer system according to claim 1 , wherein the independent processing device further comprises a watchdog device, configured to regularly send a watchdog message to the selected independent processing device. 9.根据权利要求1所述的计算机系统,其特征在于,是嵌入式或控制用的计算机系统,所述嵌入式或控制用的计算机系统包括交换机、路由器、或网络防火墙。9. The computer system according to claim 1, characterized in that it is an embedded or control computer system, and the embedded or control computer system includes a switch, a router, or a network firewall.
CNB2005101079789A 2005-09-30 2005-09-30 Computer system Expired - Fee Related CN100432944C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2005101079789A CN100432944C (en) 2005-09-30 2005-09-30 Computer system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2005101079789A CN100432944C (en) 2005-09-30 2005-09-30 Computer system

Publications (2)

Publication Number Publication Date
CN1940874A CN1940874A (en) 2007-04-04
CN100432944C true CN100432944C (en) 2008-11-12

Family

ID=37959084

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2005101079789A Expired - Fee Related CN100432944C (en) 2005-09-30 2005-09-30 Computer system

Country Status (1)

Country Link
CN (1) CN100432944C (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103106117A (en) * 2012-12-25 2013-05-15 青岛海信电器股份有限公司 Resource allocation method and electronic equipment
CN105528255B (en) * 2015-12-07 2019-07-05 中国电子科技集团公司第三十二研究所 EIPC-based TCF communication method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000076087A (en) * 1998-08-28 2000-03-14 Hitachi Ltd Multi-operating system control method
CN1368810A (en) * 2001-02-02 2002-09-11 北京翔智信息技术有限公司 Distributed information switch and processing system and method
CN1441366A (en) * 2001-09-04 2003-09-10 三星电子株式会社 Communication method and its device during process
JP2005266841A (en) * 2004-03-16 2005-09-29 Hitachi Ltd A computer system with a dedicated processor

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000076087A (en) * 1998-08-28 2000-03-14 Hitachi Ltd Multi-operating system control method
CN1368810A (en) * 2001-02-02 2002-09-11 北京翔智信息技术有限公司 Distributed information switch and processing system and method
CN1441366A (en) * 2001-09-04 2003-09-10 三星电子株式会社 Communication method and its device during process
JP2005266841A (en) * 2004-03-16 2005-09-29 Hitachi Ltd A computer system with a dedicated processor

Also Published As

Publication number Publication date
CN1940874A (en) 2007-04-04

Similar Documents

Publication Publication Date Title
Hildebrand An Architectural Overview of QNX.
US7996593B2 (en) Interrupt handling using simultaneous multi-threading
US9996401B2 (en) Task processing method and virtual machine
Hamilton et al. The Spring nucleus: A microkernel for objects
KR100934533B1 (en) Computer-readable recording medium recording arithmetic processing system, task control method on computer system, and computer program
US7149832B2 (en) System and method for interrupt handling
JP3659062B2 (en) Computer system
US7051330B1 (en) Generic application server and method of operation therefor
CN100392598C (en) operating system
US20050251806A1 (en) Enhancement of real-time operating system functionality using a hypervisor
WO2012163217A1 (en) Hardware basic tool-based architecture and method for monitoring performance of virtual system
JP4056491B2 (en) Selective generation of asynchronous notifications for partition management operations on logically partitioned computers
US12282791B2 (en) Virtualized I/O
US7140015B1 (en) Microkernel for real time applications
CN116700901A (en) Container construction and operation system and method based on microkernel
WO2024007934A1 (en) Interrupt processing method, electronic device, and storage medium
Herder et al. Reorganizing UNIX for reliability
CN114115703A (en) Bare metal server online migration method and system
CN113556264A (en) Real-time cloud platform management monitoring system
CN100432944C (en) Computer system
Major et al. An Overview of the NetWare Operating System.
CN108845969B (en) Operation control method and operation system suitable for incompletely symmetrical multi-processing microcontroller
CN114281529B (en) Method, system and terminal for dispatching optimization of distributed virtualized client operating system
WO2022172366A1 (en) Intra-server delay control device, intra-server delay control method, and program
CN114124680B (en) File access control alarm log management method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C41 Transfer of patent application or patent right or utility model
C56 Change in the name or address of the patentee
CP03 Change of name, title or address

Address after: 100049 No. 19, Yuquanlu Road, Beijing, Shijingshan District

Patentee after: University OF CHINESE ACADEMY OF SCIENCES

Address before: 100049, Yuquanlu Road, Beijing No. 19 (a)

Patentee before: GRADUATE University OF CHINESE ACADEMY OF SCIENCES

TR01 Transfer of patent right

Effective date of registration: 20151120

Address after: 100195 Beijing city Haidian District minzhuang Road No. 87 C

Patentee after: INSTITUTE OF INFORMATION ENGINEERING, CHINESE ACADEMY OF SCIENCES

Address before: 100049 No. 19, Yuquanlu Road, Beijing, Shijingshan District

Patentee before: University of Chinese Academy of Sciences

CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20081112

Termination date: 20190930