WO2011032453A1 - Compact peripheral component interconnection(cpci) hot swap system - Google Patents

Compact peripheral component interconnection(cpci) hot swap system Download PDF

Info

Publication number
WO2011032453A1
WO2011032453A1 PCT/CN2010/076287 CN2010076287W WO2011032453A1 WO 2011032453 A1 WO2011032453 A1 WO 2011032453A1 CN 2010076287 W CN2010076287 W CN 2010076287W WO 2011032453 A1 WO2011032453 A1 WO 2011032453A1
Authority
WO
WIPO (PCT)
Prior art keywords
device information
slot
information query
status
hot plug
Prior art date
Application number
PCT/CN2010/076287
Other languages
French (fr)
Chinese (zh)
Inventor
程剑锋
柴先平
李加友
周雪春
Original Assignee
研祥智能科技股份有限公司
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 研祥智能科技股份有限公司 filed Critical 研祥智能科技股份有限公司
Publication of WO2011032453A1 publication Critical patent/WO2011032453A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • G06F13/4063Device-to-bus coupling
    • G06F13/4068Electrical coupling
    • G06F13/4081Live connection to bus, e.g. hot-plugging

Definitions

  • the invention belongs to the field of computers, and in particular relates to a CPCI hot plug system.
  • Compact PCI Compact PCI
  • PICMG PCI Industrial Computer Manufacturing Organization
  • Hot-swap technology is an important guarantee for high reliability of the CPCI platform, including basic hot swap, full hot swap, and high reliability hot swap.
  • Basic hot plugging requires user intervention.
  • the user inputs the command in advance through the user program to inform the hot plug program, insert or unplug the device, and then insert or unplug the device after the user program prompts the information.
  • Full hot plugging is based on the basic hot plugging, adding a microswitch device to the insertion/extraction mechanism of the device.
  • the microswitch When the device is inserted or removed, the microswitch first changes before the device starts or stops working. State, generating a system enumeration (#ENUM) signal that informs the operating system that a device is to be plugged in or unplugged, and that the operating system performs bus enumeration, device driver installation, or device driver unloading.
  • #ENUM system enumeration
  • High-reliability hot-swap is built on the basis of full hot-swap. It can monitor whether the device can run normally. The system can automatically isolate a bad device, start an alternative device, and then continue working.
  • FIG. 1 shows an implementation process of a CPCI hot plug solution provided by a Linux system in the prior art, as follows:
  • step S101 Initialize the hot-swap driver, register the hot-swap driver to the Linux system, and read the information of the CPCI platform slot.
  • step S102 Register the information of the slot to the SYS file system.
  • the SYS file system is a dynamic file system for recording device information in the Linux system.
  • step S103 the monitoring program is started to periodically detect whether a device is inserted or removed in the slot of the CPCI platform.
  • step S104 If no device is inserted, step S103 is performed to continue to detect the slot status. If there is a device inserted, step S105 is performed.
  • step S105 the device is scanned to acquire information of the device.
  • step S106 it is determined whether there is an allocatable resource in the system. If there is a resource available for allocation, step S107 is performed, otherwise step S103 is performed to continue detecting the slot state change.
  • step S107 resources are allocated for the device.
  • step S108 if a resource has been allocated for the device, the information of the device is written into the SYS system, and the slot state change is continuously detected.
  • the existing solution only supports full hot swap, and does not support basic hot swap and high reliability hot swap, because basic hot plug requires user to control through the upper application, but the system does not provide the corresponding interface, high reliability hot plug
  • the monitoring program can monitor whether the device is running normally. When a problem occurs, it can automatically take measures to deactivate the device, but the system does not support this function.
  • the purpose of the embodiments of the present invention is to provide a CPCI hot plug system capable of supporting basic hot plugging, full hot plugging, and high reliability hot plugging of a CPCI platform device at the same time.
  • a CPCI hot plug system includes:
  • a hot-swappable driver is used to monitor the insertion, removal, and operation of devices on the CPCI platform.
  • the device dynamically requests and releases resources, loads and unloads device drivers, and provides device information query and control interfaces to upper-layer applications.
  • a user unit configured to receive device information query and control commands input by the user, output device information query and control request, receive and display device information query and control result to the user;
  • a daemon process configured to send, by using the device information query and control interface, a device information query and control request output by the user unit to the hot plug driver, and query the device information returned by the hot plug drive And the control result is sent to the subscriber unit.
  • Another object of the embodiments of the present invention is to provide a CPCI hot plug system, where the system includes:
  • the driver layer including the CPCI hot-swap driver, is used to monitor the insertion, extraction, and running status of the device in the slot of the CPCI platform, dynamically request and release resources for the device, load and unload the device driver, and provide device information query to the upper layer application.
  • Control interface ;
  • the application layer provides device information query and control interfaces to users, and supports hot swapping of in-place devices.
  • the embodiment of the present invention meets the requirements of the CPCI hot plug specification, and provides a device information query and control interface of the CPCI platform by setting a hot plug drive to an upper layer application; and providing a user management unit to provide a management and control interface for the CPCI device;
  • the daemon to realize the information transfer between the user unit and the hot-swap driver, and providing a unified interface for the local user unit and the remote user unit, the program scalability can be improved, thereby not only supporting full hot plug but also supporting Basic hot swap and high reliability hot swap.
  • FIG. 1 is a flowchart of implementing a CPCI hot plug solution provided by a Linux system in the prior art
  • FIG. 2 is a structural diagram of a CPCI hot plug system according to an embodiment of the present invention.
  • FIG. 3 is an interaction flowchart of components of a CPCI hot plug system when a function board is inserted according to an embodiment of the present invention
  • FIG. 4 is an interaction flowchart of components of a CPCI hot plug system when a function board is pulled out according to an embodiment of the present invention
  • FIG. 5 is a structural diagram of a hot swap drive according to an embodiment of the present invention.
  • FIG. 6 is a flowchart of an implementation of performing hot plug drive initialization by an initialization module in a hot swap drive according to an embodiment of the present invention
  • FIG. 7 is a monitoring flowchart of a monitoring module in a hot swap drive according to an embodiment of the present invention.
  • FIG. 8 is a schematic diagram of slot state transition of a CPCI platform according to an embodiment of the present invention.
  • FIG. 9 is a flowchart of a work process of a daemon process according to an embodiment of the present invention.
  • the embodiment of the invention provides upper-layer application control for the hot plug system, and can monitor the running state of the device, conforms to the CPCI hot plug specification, and can simultaneously support basic hot plugging, full hot plugging, and high reliability hot plugging. .
  • FIG. 2 shows an architecture of a CPCI hot plug system according to an embodiment of the present invention, and only parts related to the embodiment of the present invention are shown.
  • the overall architecture of the CPCI hot plug system is divided into a hardware layer, a driver layer, and an application layer.
  • the hardware layer is the platform on which the CPCI hot-swap system operates.
  • the driver layer and the application layer are the software parts of the CPCI hot-swap system. among them,
  • the hot plug driver 100 in the driver layer is a driving part of the hot plug system, which supports hot plugging of hardware devices of the CPCI platform on one hand, and device information query and control interface of the platform to the application layer on the other hand.
  • the hot-swap drive 100 monitors the insertion, removal, and operation of devices in the slots of the CPCI platform. It supports basic hot swap, hot swap, and high-reliability hot swap of devices, and dynamically requests and releases resources for devices.
  • the device driver is loaded and unloaded, and the device information query and control interface is provided to the upper layer application.
  • the application layer is the device management part of the CPCI platform, which provides the device information query and control interface to the user, and supports hot swapping of the in-place device.
  • the application layer may also display the device information of each slot on the CPCI platform to the user in an intuitive manner.
  • the application layer includes a daemon process 200 and a subscriber unit 300.
  • the daemon process 200 is an intermediate layer, which facilitates the communication between the user unit 300 and the hot plug drive 100, plays the role of information transmission, provides a unified interface for the local subscriber unit and the remote subscriber unit, and improves the scalability of the program.
  • the daemon process 200 sends the device information query and control request output by the user unit 300 to the hot plug drive 100 through the device information query and control interface provided by the hot plug driver 100, and queries the device information returned by the hot plug drive 100. And the control result is sent to the subscriber unit 300.
  • the user unit 300 provides a CPCI device management interface for the user, receives the device information query and control command input by the user, outputs the device information query and control request to the daemon process 200, and receives the device information query returned by the hot plug driver 100 via the daemon process 200. Control the results and display them to the user.
  • the user unit 300 may be a character mode, a graphic interface mode, or both a character mode and a graphic interface mode.
  • the character mode the user can perform corresponding operations by inputting a command.
  • the graphical interface mode the user can perform corresponding operations by clicking the relevant button on the graphical interface.
  • the subscriber unit 300 may be a local subscriber unit or a remote subscriber unit.
  • the remote subscriber unit communicates with the daemon process 200 through a remote communication mechanism, such as a socket, to implement remote query and control of the device. .
  • Figure 3 shows the interaction process of each component in the CPCI hot-swap system when a function board is inserted. The details are as follows:
  • the user inserts a CPCI function board into the slot of the platform.
  • the hot-swap drive detects that there is a device plug-in, scans the device, allocates system resources to the device, and then detects whether there is a loaded driver in the system suitable for the device, and if so, installs the driver for the device, signaling the daemon , there is a device to insert.
  • the hot-swap drive can use interrupt or polling when detecting whether a device is plugged in.
  • the daemon initiates a query operation to the hot plug driver, obtains the information of the inserted device, and sends the device information to the user unit.
  • the subscriber unit displays the device information.
  • the daemon determines whether the driver of the device has been loaded. If not, the user unit is notified, the user is instructed to manually specify the path, and then the driver of the device is loaded to notify the user unit to refresh the device information. If already loaded, the user unit is notified to refresh the device information.
  • Figure 4 shows the interaction process of each component in the CPCI hot-swap system when a function board is pulled out, as detailed below:
  • the hot-swap driver detects that a device has been removed. If the device has a driver installed, the device is unloaded, the resources are released, and the daemon is notified that the device is unplugged.
  • the daemon deletes the corresponding device information and notifies the user unit to refresh the device information.
  • FIG. 5 shows the structure of the hot-swap drive provided by the embodiment of the present invention. For the convenience of description, only parts related to the embodiment of the present invention are shown.
  • the hot plug drive 100 includes an initialization module 101, a monitoring module 102, a slot status management module 103, and a user interaction module 104.
  • the hot plug drive 100 is added to the kernel, and the initialization module 101 performs initialization of the hot plug drive 100 operating environment. Then, the monitoring module 102 enters the monitoring state. When the monitoring module 102 monitors the device, there may be two modes of interruption and polling, both of which require hardware support. When the monitoring module 102 monitors that the slot status has changed, the slot status management module 103 can be invoked to perform corresponding processing. At the same time, the application layer can interact with the hot plug driver 100 through the user interaction module 104 to notify important parties of important information in time.
  • FIG. 6 is a flowchart showing an implementation process of an initialization module for performing hot plug drive initialization according to an embodiment of the present invention, which is described in detail as follows:
  • step S601 Read the user's configuration parameter values when the hot-swap driver is loaded, such as whether monitoring is needed, which slots are monitored, etc., to verify the correctness of these configuration parameters.
  • step S602 the resources required for the function board device during hot plugging are pre-applied to the system.
  • the remaining resource interval and size after the system is started may be detected, and then a maximum continuous resource reserve is selected.
  • the initialization module can automatically pre-apply resources for the CPCI hot plug device without modifying the basic input/output system (Basic Input) Output System, BIOS) or Universal Bootloader (Universal Boot Loader, UBOOT, etc., for the CPCI system board that has been developed, it can support hot plugging of CPCI platform devices without modification.
  • Basic Input Basic Input
  • BIOS Basic Input
  • BIOS Basic Input
  • UBOOT Universal Boot Loader
  • step S603 the hot plug driver is registered as a character device driver that interacts with the user.
  • step S604 each slot state of the CPCI platform is initialized.
  • step S605 the monitoring module is started to monitor the device status of each slot of the system, including whether the device is inserted, removed, and operated normally.
  • the hot plug event of the device in addition to monitoring the hot plug event of the device through the monitoring module 102 in the hot plug drive 100, the hot plug event of the device can also be monitored by the external monitoring system.
  • the hot plug event of the monitoring device is not required in the hot plug drive 100, and is completed by external monitoring.
  • the slot state management module 103 performs hot swap management of the device according to the received external device status monitoring signal.
  • FIG. 7 shows a monitoring process of the monitoring module in the embodiment of the present invention, which is detailed as follows:
  • step S701 initialization is completed
  • step S702 it is judged whether the external monitoring is turned on, and if the external monitoring has been turned on, it ends.
  • the hot swap driver does not need to monitor the hot plug event of the device, and is completed by external monitoring and notifies the slot status management module;
  • step S703 is executed to determine whether the monitoring mode has an interrupt. When there is an interrupt, step S704 is performed, and the preferred opening interrupt is monitored because the interrupt is more efficient than the polling. Otherwise, step S705 is performed. Polling monitoring.
  • the user can configure whether to enable external monitoring.
  • the slot in basic hot plugging, full hot plugging, and high reliability hot plugging, the slot may include the following four states:
  • EPTY Empty state
  • the device is not powered (NOPOWER): the device is plugged in but not yet powered.
  • CONFIG Device normal operation status
  • UNHEALTHY The state in which the device is not operating normally, the device's healthy signal is abnormal, and the device is switched to the state when the work is abnormal.
  • the slot state management module 103 can implement switching management between the slot states under the driving of the monitoring signals such as the insertion device and the unplugging device. At the same time, the management mode of the slot state can be used to support basic hot swap, full hot swap, and high reliability hot swap.
  • the following describes the insertion and extraction of the CPCI slot state transition diagram shown in Figure 8. The process of switching the slot status during operation.
  • the slot state switching process is as follows:
  • the device in-position signal (PRESENT_SIG) is sent to the slot state management module 103, and the slot state management module 103 switches the slot state to The device is not powered on (NOPOWER); if the monitoring module 102 detects that a device is plugged in and the device has been automatically powered on, the device insertion signal (INS_SIG) is sent to the slot state management module 103, and the slot state management module 103 The slot status is switched to the normal running state (CONFIG). At this time, resources are allocated to the device, the driver is loaded, and the current device status information of the daemon is notified. Whether the device is powered on automatically depends on the support of the hardware device, and there are two situations in the application.
  • the slot is in the unpowered state (NOPOWER)
  • the monitoring module 102 detects that the device is powered on
  • the device sends a device power-on signal (POWERON_SIG) to the slot state management module 103, and the slot state management module 103
  • the slot status is switched to the normal running state of the device (CONFIG).
  • the slot When the slot is in the normal running state of the device (CONFIG), if the hardware supports high-reliability hot-swapping, it will provide a signal indicating whether the device status is normal. When the monitoring module 102 detects that the device is not working properly, it will move to the slot.
  • the state management module 103 sends a device running abnormal signal (UNHEAL_SIG). After receiving the UNHEAL_SIG signal, the slot state management module 103 will unload the device driver, release the device resource, power off, and switch the slot state to the device abnormal running state. (UNHEALTHY).
  • the monitoring module 102 detects that the device is ready to be unplugged, and then sends a device pull-out signal (EXT_SIG) to the slot state management module 103, and the slot state management module 103 receives the EXT_SIG. After the signal is output, the device driver is unloaded, the device resources are released, and the device is powered off. The device can be removed and the slot status is switched to the empty state (EMPTY).
  • EXT_SIG device pull-out signal
  • the monitoring module 102 detects that the device is ready to be powered off, and then sends a device power-off signal (POWEROFF_SIG) to the slot state management module 103, and the slot state management module 103 receives the POWEROFF_SIG. After the signal, the slot status is switched to the unpowered state (NOPOWER) after the power is turned off.
  • POWEROFF_SIG device power-off signal
  • the monitoring module 102 detects that the device is unplugged, and then sends a device out-of-bit signal (ABSENT_SIG) to the slot state management module 103, and the slot state management module 103 receives the ABSENT_SIG. After the signal, the slot status is switched to the empty state (EMPTY).
  • ABSENT_SIG device out-of-bit signal
  • the monitoring module 102 detects that the device is ready to be unplugged, and then sends a device out-of-bit signal (ABSENT_SIG) to the slot state management module 103, and the slot state management module 103 receives After the ABSENT_SIG signal, the slot status is switched to the empty status (EMPTY).
  • ABSENT_SIG device out-of-bit signal
  • the device may receive the illegal pull-out signal (EXTED_SIG).
  • EXTED_SIG illegal pull-out signal
  • the slot state management module 103 confirms that it is Whether the unplugged device has unloaded the driver and released the resources. If not, the uninstall driver is executed, and after the resources are released, the slot status is switched to the empty state (EMPTY).
  • the user interaction module 104 provides a device information query and control interface to the upper layer application, and implements communication between the hot plug driver 100 and the upper layer application.
  • the user interaction module 104 includes a device information query and control interface, and the hot plug driver 100 notifies the interface of the daemon 200 to enable communication between the hot plug drive 100 and the daemon process 200.
  • the main function of the daemon process 200 is to implement message relaying, and provide a unified interface to the user unit 300.
  • the user unit 300 communicates with the daemon process 200 and does not directly communicate with the hot plug driver 100.
  • FIG. 9 shows a workflow of a daemon process according to an embodiment of the present invention, which is described in detail as follows:
  • step S901 the read configuration file initializes each related information.
  • step S902 the daemon process is started
  • step S903 it is determined whether there is a remote user unit or an external monitoring system, if yes, step S904 is executed to enable a remote communication mechanism, such as a socket communication thread, and the heartbeat program is turned on, and the remote user unit or the external monitoring system is turned every 3 seconds.
  • a remote communication mechanism such as a socket communication thread
  • the socket communication thread polls the received information, and performs step S905 to process the socket information, receive the request of the corresponding remote user, and then go to the hot plug drive to query the corresponding information, or issue the corresponding device insertion and extraction to the hot plug driver.
  • the request is made and step S906 is executed to return the result to the remote subscriber unit.
  • step S907 For the local user unit, after the initialization process is completed and the daemon is started, the daemon performs step S907, starts a message queue communication thread, reads the message sent by the hot plug driver and the local user unit, and then performs step S908 to process the message queue. Message in. If the message queue is related information that the device that is actively sent by the hot plug driver is inserted or unplugged, step S909 is performed to forward the message to the local subscriber unit. If the message is sent by the user unit, the daemon requests the hot plug driver to perform the corresponding operation, and reads the result returned by the message queue, and performs step S909 to forward the result to the local user unit. If there is a remote user unit, Step S906 is executed to forward the result to the remote subscriber unit.
  • the local user unit 300 includes display device information, inserts the device, pulls out the device, loads the device driver, uninstalls the device driver, and powers on, powers off, and queries the device.
  • the user unit 300 can adopt a graphical interface mode, and the user can perform corresponding operations by clicking the relevant button on the graphical interface.
  • the subscriber unit 300 After receiving the user's request, the subscriber unit 300 sends a request message to the daemon 200 through the message queue, and the daemon 200 sends the corresponding request to the hot plug driver 100.
  • the daemon process 200 polls the message queue and sends the result of the hot plug drive 100 back to the subscriber unit 300 for display on the graphical interface.
  • the subscriber unit 300 If the subscriber unit 300 is in the character mode, the user can perform corresponding operations by inputting a command.
  • the embodiments of the present invention meet the requirements of the CPCI hot plug specification, and can support basic hot plugging, full hot swap, and high reliability hot swap. At the same time, it can automatically pre-apply resources for CPCI hot plugging devices without modifying the boot program such as BIOS or UBOOT. With the CPCI device management program, users can intuitively understand the device information on each CPCI device slot. In addition, a remote device control query interface is provided, which enables the user to remotely control the hot plugging of the device and remotely query the device information.

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

A Compact Peripheral Component Interconnection (CPCI) hot swap system is disclosed and is applied to the computer field. The system includes: a hot swap driver, which is used to monitor inserting, pulling out and running state of a device in a slot of a CPCI platform, dynamically apply for and release resources for the device, load and unload device drivers and provide a device information query and control interface to an upper application; a user unit, which is used to receive a device information query and control command input by the user, output a device information query and control request, receive and display a device information query and control result to the user; and a protection process, which is used to send the device information query and control request output by the user unit to the hot swap driver through the device information query and control interface, and send the device information query and control result returned by the hot swap driver to the user unit. The application meets CPCI hot swap specification and can support base hot swap, totally hot swap and highly reliable hot swap at the same time.

Description

一种CPCI热插拔***A CPCI hot plug system 技术领域Technical field
本发明属于计算机领域,尤其涉及一种CPCI热插拔***。The invention belongs to the field of computers, and in particular relates to a CPCI hot plug system.
背景技术 Background technique
紧凑型PCI(Compact PCI,CPCI)是全球PCI工业计算机制造组织(PICMG)于1994年提出来的一种总线接口标准,该技术具有开放性、高可靠性、可热插拔等特点,广泛应用于通讯、网络、计算机电话(Computer Telephony)、实时***控制(Real Time Machine Control)、产业自动化、实时数据采集(Real-Time Data Acquisition)、军事***等领域,以及智能交通、航空航天、医疗器械、水利等模块化和高可靠度、可长期使用的领域。Compact PCI (Compact PCI, CPCI) is a bus interface standard proposed by the PCI Industrial Computer Manufacturing Organization (PICMG) in 1994. It is open, high-reliability, hot-swappable, and widely used in communications, networking, and Computer phone Telephony), Real Time Machine Control, Industrial Automation, Real-Time Data Acquisition (Real-Time Data) Acquisition), military systems and other fields, as well as intelligent transportation, aerospace, medical equipment, water conservancy and other areas of modularity and high reliability, long-term use.
热插拔技术是CPCI平台实现高可靠性的重要保证,包括基本热插拔、完全热插拔和高可靠性热插拔三种。 Hot-swap technology is an important guarantee for high reliability of the CPCI platform, including basic hot swap, full hot swap, and high reliability hot swap.
基本热插拔需要用户干预,用户通过用户程序输入命令事先告知热插拔程序,要***或拔出设备,等用户程序提示信息后,再***或拔出设备。Basic hot plugging requires user intervention. The user inputs the command in advance through the user program to inform the hot plug program, insert or unplug the device, and then insert or unplug the device after the user program prompts the information.
完全热插拔是在基本热插拔的基础上,在设备的***/拔出机构中添加一个微开关装置,当设备被***或拔出时,在设备开始或停止工作之前,微开关首先改变状态,产生***枚举(#ENUM)信号,该信号用于通知操作***将要***或拔出一个设备,操作***再执行总线枚举、安装设备驱动或卸载设备驱动等动作。Full hot plugging is based on the basic hot plugging, adding a microswitch device to the insertion/extraction mechanism of the device. When the device is inserted or removed, the microswitch first changes before the device starts or stops working. State, generating a system enumeration (#ENUM) signal that informs the operating system that a device is to be plugged in or unplugged, and that the operating system performs bus enumeration, device driver installation, or device driver unloading.
高可靠性热插拔是在完全热插拔的基础上建立的,能够监控设备是否能够正常运行,***可以自动隔离一个坏的设备,启动一个替代设备,接着继续工作。High-reliability hot-swap is built on the basis of full hot-swap. It can monitor whether the device can run normally. The system can automatically isolate a bad device, start an alternative device, and then continue working.
图1示出了现有技术中Linux***提供的CPCI热插拔方案的实现流程,具体如下:FIG. 1 shows an implementation process of a CPCI hot plug solution provided by a Linux system in the prior art, as follows:
在步骤S101中, 初始化热插拔驱动,将热插拔驱动注册到Linux***中,读取CPCI平台槽位的信息。In step S101, Initialize the hot-swap driver, register the hot-swap driver to the Linux system, and read the information of the CPCI platform slot.
在步骤S102中, 注册槽位的信息到SYS文件***中,SYS文件***是Linux***中记录设备信息的动态文件***。In step S102, Register the information of the slot to the SYS file system. The SYS file system is a dynamic file system for recording device information in the Linux system.
在步骤S103中,启动监控程序,循环检测CPCI平台的槽位上是否有设备***或拔出。In step S103, the monitoring program is started to periodically detect whether a device is inserted or removed in the slot of the CPCI platform.
在步骤S104中, 如果没有设备***,则执行步骤S103,继续检测槽位状态,如果有设备***,则执行步骤S105。In step S104, If no device is inserted, step S103 is performed to continue to detect the slot status. If there is a device inserted, step S105 is performed.
在步骤S105中,扫描设备,获取设备的信息。In step S105, the device is scanned to acquire information of the device.
在步骤S106中,判断***中是否有可分配资源, 如果有资源可供分配,则执行步骤S107,否则执行步骤S103,继续检测槽位状态变化。In step S106, it is determined whether there is an allocatable resource in the system. If there is a resource available for allocation, step S107 is performed, otherwise step S103 is performed to continue detecting the slot state change.
在步骤S107中,为设备分配资源。In step S107, resources are allocated for the device.
在步骤S108中,如果已经为设备分配资源,则将设备的信息写入SYS***中,并继续检测槽位状态变化。In step S108, if a resource has been allocated for the device, the information of the device is written into the SYS system, and the slot state change is continuously detected.
现有方案只支持完全热插拔,不支持基本热插拔和高可靠性热插拔,因为基本热插拔需要用户通过上层应用程序控制,但是***未提供相应的接口,高可靠性热插拔需要监控程序能够监控设备是否是正常运行,出现问题时能够自动采取措施,停用设备,但***不支持这部分功能。The existing solution only supports full hot swap, and does not support basic hot swap and high reliability hot swap, because basic hot plug requires user to control through the upper application, but the system does not provide the corresponding interface, high reliability hot plug The monitoring program can monitor whether the device is running normally. When a problem occurs, it can automatically take measures to deactivate the device, but the system does not support this function.
发明内容Summary of the invention
本发明实施例的目的在于提供一种CPCI热插拔***,能够同时支持CPCI平台设备的基本热插拔、完全热插拔和高可靠性热插拔。The purpose of the embodiments of the present invention is to provide a CPCI hot plug system capable of supporting basic hot plugging, full hot plugging, and high reliability hot plugging of a CPCI platform device at the same time.
本发明实施例是这样实现的,一种CPCI热插拔***,所述***包括:The embodiment of the present invention is implemented as follows. A CPCI hot plug system includes:
热插拔驱动,用于监控CPCI平台槽位上设备的***、拔出和运行状态,动态为设备申请和释放资源,加载和卸载设备驱动,向上层应用提供设备信息查询和控制接口;A hot-swappable driver is used to monitor the insertion, removal, and operation of devices on the CPCI platform. The device dynamically requests and releases resources, loads and unloads device drivers, and provides device information query and control interfaces to upper-layer applications.
用户单元,用于接收用户输入的设备信息查询和控制命令,输出设备信息查询和控制请求,接收并向用户显示设备信息查询和控制结果;以及a user unit, configured to receive device information query and control commands input by the user, output device information query and control request, receive and display device information query and control result to the user;
守护进程,用于通过所述设备信息查询和控制接口,将所述用户单元输出的设备信息查询和控制请求发送给所述热插拔驱动,并将所述热插拔驱动返回的设备信息查询和控制结果发送给所述用户单元。a daemon process, configured to send, by using the device information query and control interface, a device information query and control request output by the user unit to the hot plug driver, and query the device information returned by the hot plug drive And the control result is sent to the subscriber unit.
本发明实施例的另一目的在于提供一种CPCI热插拔***,所述***包括:Another object of the embodiments of the present invention is to provide a CPCI hot plug system, where the system includes:
硬件层,作为所述CPCI热插拔***运行的平台;a hardware layer that serves as a platform for the CPCI hot plug system to operate;
驱动层,包含CPCI热插拔驱动,用于监控CPCI平台槽位上设备的***、拔出和运行状态,动态为设备申请和释放资源,加载和卸载设备驱动,向上层应用提供设备信息查询和控制接口;以及The driver layer, including the CPCI hot-swap driver, is used to monitor the insertion, extraction, and running status of the device in the slot of the CPCI platform, dynamically request and release resources for the device, load and unload the device driver, and provide device information query to the upper layer application. Control interface;
应用层,向用户提供设备信息查询和控制接口,支持在位的设备热插拔。The application layer provides device information query and control interfaces to users, and supports hot swapping of in-place devices.
本发明实施例符合CPCI热插拔规范的要求,通过设置热插拔驱动向上层应用提供CPCI平台的设备信息查询和控制接口;通过设置用户单元,从而为用户提供CPCI设备的管理和控制接口;通过设置守护进程实现用户单元与热插拔驱动的信息传递,并为本地用户单元和远程用户单元提供统一的接口,提高程序的可扩展性,由此不仅可以支持完全热插拔,还可支持基本热插拔和高可靠性热插拔。The embodiment of the present invention meets the requirements of the CPCI hot plug specification, and provides a device information query and control interface of the CPCI platform by setting a hot plug drive to an upper layer application; and providing a user management unit to provide a management and control interface for the CPCI device; By setting the daemon to realize the information transfer between the user unit and the hot-swap driver, and providing a unified interface for the local user unit and the remote user unit, the program scalability can be improved, thereby not only supporting full hot plug but also supporting Basic hot swap and high reliability hot swap.
附图说明DRAWINGS
下面将结合附图及实施例对本发明作进一步说明,附图中:The present invention will be further described below in conjunction with the accompanying drawings and embodiments, in which:
图1是现有技术中Linux***提供的CPCI热插拔方案的实现流程图;1 is a flowchart of implementing a CPCI hot plug solution provided by a Linux system in the prior art;
图2是本发明实施例提供的CPCI热插拔***的架构图;2 is a structural diagram of a CPCI hot plug system according to an embodiment of the present invention;
图3是本发明实施例提供的***一块功能板时,CPCI热插拔***各组成部分的交互流程图;3 is an interaction flowchart of components of a CPCI hot plug system when a function board is inserted according to an embodiment of the present invention;
图4是本发明实施例提供的拔出一块功能板时,CPCI热插拔***各组成部分的交互流程图;4 is an interaction flowchart of components of a CPCI hot plug system when a function board is pulled out according to an embodiment of the present invention;
图5是本发明实施例提供的热插拔驱动的结构图;FIG. 5 is a structural diagram of a hot swap drive according to an embodiment of the present invention; FIG.
图6是本发明实施例提供的热插拔驱动中初始化模块进行热插拔驱动初始化的实现流程图;FIG. 6 is a flowchart of an implementation of performing hot plug drive initialization by an initialization module in a hot swap drive according to an embodiment of the present invention; FIG.
图7是本发明实施例提供的热插拔驱动中监控模块的监控流程图;7 is a monitoring flowchart of a monitoring module in a hot swap drive according to an embodiment of the present invention;
图8是本发明实施例提供的CPCI平台槽位状态转换示意图;FIG. 8 is a schematic diagram of slot state transition of a CPCI platform according to an embodiment of the present invention; FIG.
图9是本发明实施例提供的守护进程的工作流程图。FIG. 9 is a flowchart of a work process of a daemon process according to an embodiment of the present invention.
具体实施方式detailed description
为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It is understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
本发明实施例为热插拔***提供了上层应用程序控制,并能够监控设备的运行状态,符合CPCI热插拔规范,能够同时支持基本热插拔、完全热插拔和高可靠性热插拔。The embodiment of the invention provides upper-layer application control for the hot plug system, and can monitor the running state of the device, conforms to the CPCI hot plug specification, and can simultaneously support basic hot plugging, full hot plugging, and high reliability hot plugging. .
图2示出了本发明实施例提供的CPCI热插拔***的架构,仅示出了与本发明实施例相关的部分。FIG. 2 shows an architecture of a CPCI hot plug system according to an embodiment of the present invention, and only parts related to the embodiment of the present invention are shown.
在本发明实施例中,CPCI热插拔***的整体架构分为硬件层、驱动层和应用层。硬件层是CPCI热插拔***运行的平台,驱动层和应用层是CPCI热插拔***的软件部分。其中,In the embodiment of the present invention, the overall architecture of the CPCI hot plug system is divided into a hardware layer, a driver layer, and an application layer. The hardware layer is the platform on which the CPCI hot-swap system operates. The driver layer and the application layer are the software parts of the CPCI hot-swap system. among them,
驱动层中的热插拔驱动100是热插拔***的驱动部分,它一方面支持CPCI平台硬件设备的热插拔,另一方面向应用层提供平台的设备信息查询和控制接口。热插拔驱动100监控CPCI平台各个槽位上设备的***、拔出和运行状态,支持设备的基本热插拔、完全热插拔和高可靠性热插拔,动态为设备申请和释放资源,加载和卸载设备驱动,向上层应用提供设备信息查询和控制接口。The hot plug driver 100 in the driver layer is a driving part of the hot plug system, which supports hot plugging of hardware devices of the CPCI platform on one hand, and device information query and control interface of the platform to the application layer on the other hand. The hot-swap drive 100 monitors the insertion, removal, and operation of devices in the slots of the CPCI platform. It supports basic hot swap, hot swap, and high-reliability hot swap of devices, and dynamically requests and releases resources for devices. The device driver is loaded and unloaded, and the device information query and control interface is provided to the upper layer application.
应用层是CPCI平台的设备管理部分,向用户提供设备信息查询和控制接口,支持在位的设备热插拔。作为本发明的一个实施例,应用层还可以利用图形界面的形式,直观的向用户显示CPCI平台上各个槽位的设备信息。The application layer is the device management part of the CPCI platform, which provides the device information query and control interface to the user, and supports hot swapping of the in-place device. As an embodiment of the present invention, the application layer may also display the device information of each slot on the CPCI platform to the user in an intuitive manner.
在本发明实施例中,应用层包括守护进程200和用户单元300。In the embodiment of the present invention, the application layer includes a daemon process 200 and a subscriber unit 300.
守护进程200是一个中间层,方便用户单元300与热插拔驱动100通信,起着信息传递的作用,为本地用户单元和远程用户单元提供统一接口,提高程序的可扩展性。The daemon process 200 is an intermediate layer, which facilitates the communication between the user unit 300 and the hot plug drive 100, plays the role of information transmission, provides a unified interface for the local subscriber unit and the remote subscriber unit, and improves the scalability of the program.
守护进程200通过热插拔驱动100提供的设备信息查询和控制接口,将用户单元300输出的设备信息查询和控制请求发送给热插拔驱动100,并将热插拔驱动100返回的设备信息查询和控制结果发送给用户单元300。The daemon process 200 sends the device information query and control request output by the user unit 300 to the hot plug drive 100 through the device information query and control interface provided by the hot plug driver 100, and queries the device information returned by the hot plug drive 100. And the control result is sent to the subscriber unit 300.
用户单元300为用户提供CPCI设备管理接口,接收用户输入的设备信息查询和控制命令,输出设备信息查询和控制请求至守护进程200,接收热插拔驱动100经守护进程200返回的设备信息查询和控制结果,并向用户显示。The user unit 300 provides a CPCI device management interface for the user, receives the device information query and control command input by the user, outputs the device information query and control request to the daemon process 200, and receives the device information query returned by the hot plug driver 100 via the daemon process 200. Control the results and display them to the user.
在本发明实施例中,用户单元300可以是字符模式,也可以是图形界面模式,或者同时提供字符模式和图形界面模式两种模式。在字符模式下,用户可以通过输入命令进行相应的操作,在图形界面模式下,用户可以通过点击图形界面上的相关按钮进行相应操作。In the embodiment of the present invention, the user unit 300 may be a character mode, a graphic interface mode, or both a character mode and a graphic interface mode. In the character mode, the user can perform corresponding operations by inputting a command. In the graphical interface mode, the user can perform corresponding operations by clicking the relevant button on the graphical interface.
作为本发明的一个优选实施例,用户单元300可以是本地用户单元,也可以是远程用户单元,远程用户单元通过远程通信机制,例如socket,与守护进程200通信,实现对设备的远程查询和控制。As a preferred embodiment of the present invention, the subscriber unit 300 may be a local subscriber unit or a remote subscriber unit. The remote subscriber unit communicates with the daemon process 200 through a remote communication mechanism, such as a socket, to implement remote query and control of the device. .
下面以***和拔出一块功能板为例,描述本发明实施例提供的CPCI热插拔***中各个组成部分交互的数据流。 The data flow of each component in the CPCI hot plug system provided by the embodiment of the present invention is described below by taking a function of inserting and extracting a function board as an example.
图3示出了***一块功能板时,CPCI热插拔***中各个组成部分的交互流程,详述如下:Figure 3 shows the interaction process of each component in the CPCI hot-swap system when a function board is inserted. The details are as follows:
1.用户将一块CPCI功能板***到平台的槽位中。1. The user inserts a CPCI function board into the slot of the platform.
2.热插拔驱动检测到有设备***,则扫描设备,为设备分配***资源,然后检测***中是否有已经加载的驱动适合这个设备,如果有,则为设备安装驱动,发出信号通知守护进程,有设备***。2. The hot-swap drive detects that there is a device plug-in, scans the device, allocates system resources to the device, and then detects whether there is a loaded driver in the system suitable for the device, and if so, installs the driver for the device, signaling the daemon , there is a device to insert.
热插拔驱动在检测是否有设备***时,可以采用中断或者轮询等方式。The hot-swap drive can use interrupt or polling when detecting whether a device is plugged in.
3.守护进程向热插拔驱动发起查询操作,获取***设备的信息,并将设备的信息发送给用户单元。3. The daemon initiates a query operation to the hot plug driver, obtains the information of the inserted device, and sends the device information to the user unit.
4.用户单元显示设备信息。4. The subscriber unit displays the device information.
5.守护进程判断设备的驱动是否已经加载,如果没有加载,则通知用户单元,指示用户手动指定路径,然后加载设备的驱动,通知用户单元刷新设备信息。如果已经加载,则通知用户单元刷新设备信息。5. The daemon determines whether the driver of the device has been loaded. If not, the user unit is notified, the user is instructed to manually specify the path, and then the driver of the device is loaded to notify the user unit to refresh the device information. If already loaded, the user unit is notified to refresh the device information.
图4示出了拔出一块功能板时,CPCI热插拔***中各个组成部分的交互流程,详述如下:Figure 4 shows the interaction process of each component in the CPCI hot-swap system when a function board is pulled out, as detailed below:
1.用户从平台的插槽位中拔出一块CPCI功能板。1. The user pulls out a CPCI function board from the slot position of the platform.
2.热插拔驱动检测到有设备拔出,如果设备已安装驱动,则为设备卸载驱动,释放资源,通知守护进程有设备拔出。2. The hot-swap driver detects that a device has been removed. If the device has a driver installed, the device is unloaded, the resources are released, and the daemon is notified that the device is unplugged.
3.守护进程删除对应的设备信息,通知用户单元刷新设备信息。3. The daemon deletes the corresponding device information and notifies the user unit to refresh the device information.
图5示出了本发明实施例提供的热插拔驱动的结构,为了便于描述,仅示出了与本发明实施例相关的部分。FIG. 5 shows the structure of the hot-swap drive provided by the embodiment of the present invention. For the convenience of description, only parts related to the embodiment of the present invention are shown.
热插拔驱动100包括初始化模块101、监控模块102、槽位状态管理模块103和用户交互模块104。The hot plug drive 100 includes an initialization module 101, a monitoring module 102, a slot status management module 103, and a user interaction module 104.
首先,热插拔驱动100被加入到内核中,初始化模块101执行热插拔驱动100运行环境的初始化。然后,监控模块102进入监控状态,监控模块102在对设备进行监控时,可以有中断和轮询两种方式,这两种方式都需要硬件提供支持。当监控模块102监控到有槽位状态发生了变化时,可以调用槽位状态管理模块103进行相应的处理。同时,应用层可以通过用户交互模块104与热插拔驱动100之间进行交互,及时将重要的信息通知给对方。First, the hot plug drive 100 is added to the kernel, and the initialization module 101 performs initialization of the hot plug drive 100 operating environment. Then, the monitoring module 102 enters the monitoring state. When the monitoring module 102 monitors the device, there may be two modes of interruption and polling, both of which require hardware support. When the monitoring module 102 monitors that the slot status has changed, the slot status management module 103 can be invoked to perform corresponding processing. At the same time, the application layer can interact with the hot plug driver 100 through the user interaction module 104 to notify important parties of important information in time.
图6示出了本发明实施例提供的初始化模块进行热插拔驱动初始化的实现流程,详述如下:FIG. 6 is a flowchart showing an implementation process of an initialization module for performing hot plug drive initialization according to an embodiment of the present invention, which is described in detail as follows:
在步骤S601中, 读取热插拔驱动加载时用户的配置参数值,例如是否需要监控,监控哪些槽位等,验证这些配置参数的正确性。In step S601, Read the user's configuration parameter values when the hot-swap driver is loaded, such as whether monitoring is needed, which slots are monitored, etc., to verify the correctness of these configuration parameters.
在步骤S602中,向***预申请热插拔时功能板设备所需的资源,在具体实现时,可以去探测***启动后剩下的资源区间和大小,然后选取一块最大的连续资源备用。In step S602, the resources required for the function board device during hot plugging are pre-applied to the system. In specific implementation, the remaining resource interval and size after the system is started may be detected, and then a maximum continuous resource reserve is selected.
作为本发明的一个优选实施例,初始化模块能够自动为CPCI热插拔设备预申请资源,不需要修改基本输入输出***(Basic Input Output System,BIOS)或通用引导加载(Universal Boot Loader,UBOOT)等引导程序,对于已经开发出来的CPCI***板,不需要做修改就可以支持CPCI平台设备的热插拔。As a preferred embodiment of the present invention, the initialization module can automatically pre-apply resources for the CPCI hot plug device without modifying the basic input/output system (Basic Input) Output System, BIOS) or Universal Bootloader (Universal Boot Loader, UBOOT, etc., for the CPCI system board that has been developed, it can support hot plugging of CPCI platform devices without modification.
在步骤S603中,将热插拔驱动注册为与用户交互的字符设备驱动。In step S603, the hot plug driver is registered as a character device driver that interacts with the user.
在步骤S604中,初始化CPCI平台每个槽位状态。In step S604, each slot state of the CPCI platform is initialized.
在步骤S605中, 启动监控模块,监控***每个槽位的设备状态,包括设备的***、拔出和运行是否正常。In step S605, the monitoring module is started to monitor the device status of each slot of the system, including whether the device is inserted, removed, and operated normally.
在本发明实施例中,除了通过热插拔驱动100中的监控模块102对设备进行热插拔事件监控外,还可以通过外部监控***监控设备的热插拔事件,当外部监控开启时,则热插拔驱动100中就不需要监控设备的热插拔事件,由外部监控完成,槽位状态管理模块103根据接收的外部的设备状态监控信号进行设备热插拔的管理。In the embodiment of the present invention, in addition to monitoring the hot plug event of the device through the monitoring module 102 in the hot plug drive 100, the hot plug event of the device can also be monitored by the external monitoring system. When the external monitoring is enabled, The hot plug event of the monitoring device is not required in the hot plug drive 100, and is completed by external monitoring. The slot state management module 103 performs hot swap management of the device according to the received external device status monitoring signal.
图7示出了本发明实施例中监控模块的监控流程,详述如下:FIG. 7 shows a monitoring process of the monitoring module in the embodiment of the present invention, which is detailed as follows:
在步骤S701中,初始化完成;In step S701, initialization is completed;
在步骤S702中,判断外部监控是否开启,如果外部监控已经开启,则结束。在这种情况下,热插拔驱动就不需要监控设备的热插拔事件,由外部监控完成并通知槽位状态管理模块;In step S702, it is judged whether the external monitoring is turned on, and if the external monitoring has been turned on, it ends. In this case, the hot swap driver does not need to monitor the hot plug event of the device, and is completed by external monitoring and notifies the slot status management module;
如果外部监控没有开启,则执行步骤S703,判断监控的方式,是否存在中断,当存在中断时,执行步骤S704,首选开启中断进行监控,因为中断比轮询更有效率,否则执行步骤S705,开启轮询监控。If the external monitoring is not enabled, step S703 is executed to determine whether the monitoring mode has an interrupt. When there is an interrupt, step S704 is performed, and the preferred opening interrupt is monitored because the interrupt is more efficient than the polling. Otherwise, step S705 is performed. Polling monitoring.
在本发明实施例中,用户可以自行配置是否开启外部监控。In the embodiment of the present invention, the user can configure whether to enable external monitoring.
在本发明实施例中,在基本热插拔、完全热插拔和高可靠性热插拔中,槽位可以包含以下四个状态:In the embodiment of the present invention, in basic hot plugging, full hot plugging, and high reliability hot plugging, the slot may include the following four states:
空状态(EMPTY):槽位上没有设备的状态。Empty state (EMPTY): There is no device status in the slot.
设备未上电状态(NOPOWER):设备已经***但是还没有上电状态。The device is not powered (NOPOWER): the device is plugged in but not yet powered.
设备正常运行状态(CONFIG):设备正常运行的状态。Device normal operation status (CONFIG): The status of the device running normally.
设备不正常运行状态(UNHEALTHY):设备不正常运行的状态,设备healthy信号异常,工作不正常时切换到的状态。UNHEALTHY: The state in which the device is not operating normally, the device's healthy signal is abnormal, and the device is switched to the state when the work is abnormal.
在***设备、拔出设备等监控信号的驱动下,槽位状态管理模块103能够实现各个槽位状态之间的切换管理。同时,利用槽位状态切换的管理方式,能够同时支持基本热插拔、完全热插拔和高可靠性热插拔,以下将结合图8所示的CPCI槽位状态转换图,描述***和拔出操作时槽位状态的切换过程。The slot state management module 103 can implement switching management between the slot states under the driving of the monitoring signals such as the insertion device and the unplugging device. At the same time, the management mode of the slot state can be used to support basic hot swap, full hot swap, and high reliability hot swap. The following describes the insertion and extraction of the CPCI slot state transition diagram shown in Figure 8. The process of switching the slot status during operation.
当设备***时,槽位状态切换过程如下:When the device is inserted, the slot state switching process is as follows:
1.当槽位上没有设备时,槽位的状态是空,槽位处于空状态(EMPTY)。1. When there is no device in the slot, the slot status is empty and the slot is empty (EMPTY).
2.如果监控模块102检测到有设备***,但设备没有被自动上电时,则向槽位状态管理模块103发送设备在位信号(PRESENT_SIG),槽位状态管理模块103将槽位状态切换到设备未上电状态(NOPOWER);如果监控模块102检测到有设备***,并且设备已经自动上电时,则向槽位状态管理模块103发送设备***信号(INS_SIG),槽位状态管理模块103将槽位状态切换到设备正常运行状态(CONFIG),此时会为设备分配资源,加载驱动,并且通知守护程序当前的设备状态信息。设备是否自动上电取决于硬件设备的支持,在应用中两种情况都有。2. If the monitoring module 102 detects that a device is inserted but the device is not automatically powered on, the device in-position signal (PRESENT_SIG) is sent to the slot state management module 103, and the slot state management module 103 switches the slot state to The device is not powered on (NOPOWER); if the monitoring module 102 detects that a device is plugged in and the device has been automatically powered on, the device insertion signal (INS_SIG) is sent to the slot state management module 103, and the slot state management module 103 The slot status is switched to the normal running state (CONFIG). At this time, resources are allocated to the device, the driver is loaded, and the current device status information of the daemon is notified. Whether the device is powered on automatically depends on the support of the hardware device, and there are two situations in the application.
3.当槽位处于设备未上电状态(NOPOWER)时,如果监控模块102检测到设备上电,则向槽位状态管理模块103发送设备上电信号(POWERON_SIG),槽位状态管理模块103将槽位状态切换到设备正常运行状态(CONFIG)。3. When the slot is in the unpowered state (NOPOWER), if the monitoring module 102 detects that the device is powered on, the device sends a device power-on signal (POWERON_SIG) to the slot state management module 103, and the slot state management module 103 The slot status is switched to the normal running state of the device (CONFIG).
4.当槽位处于设备正常运行状态(CONFIG)时,如果硬件支持高可靠性热插拔,则会提供设备状态是否正常的信号,当监控模块102检测到设备运行不正常,则向槽位状态管理模块103发送设备运行不正常信号(UNHEAL_SIG),接收到UNHEAL_SIG信号后,槽位状态管理模块103将会卸载设备驱动,释放设备资源,断电,将槽位状态切换到设备不正常运行状态(UNHEALTHY)。4. When the slot is in the normal running state of the device (CONFIG), if the hardware supports high-reliability hot-swapping, it will provide a signal indicating whether the device status is normal. When the monitoring module 102 detects that the device is not working properly, it will move to the slot. The state management module 103 sends a device running abnormal signal (UNHEAL_SIG). After receiving the UNHEAL_SIG signal, the slot state management module 103 will unload the device driver, release the device resource, power off, and switch the slot state to the device abnormal running state. (UNHEALTHY).
当设备拔出时,槽位状态切换过程如下:When the device is removed, the slot state switching process is as follows:
1.如果槽位处于设备正常运行状态(CONFIG),监控模块102检测到设备准备拔出,则向槽位状态管理模块103发送设备拔出信号(EXT_SIG),槽位状态管理模块103接收到EXT_SIG信号后,卸载设备驱动,释放设备资源,断电,指示设备可以拔出,将槽位状态切换到空状态(EMPTY)。1. If the slot is in the normal running state of the device (CONFIG), the monitoring module 102 detects that the device is ready to be unplugged, and then sends a device pull-out signal (EXT_SIG) to the slot state management module 103, and the slot state management module 103 receives the EXT_SIG. After the signal is output, the device driver is unloaded, the device resources are released, and the device is powered off. The device can be removed and the slot status is switched to the empty state (EMPTY).
2.如果槽位处于设备正常运行状态(CONFIG),监控模块102检测到设备准备断电,则向槽位状态管理模块103发送设备断电信号(POWEROFF_SIG),槽位状态管理模块103接收到POWEROFF_SIG信号后,在断电后将槽位状态切换到设备未上电状态(NOPOWER)。2. If the slot is in the normal running state of the device (CONFIG), the monitoring module 102 detects that the device is ready to be powered off, and then sends a device power-off signal (POWEROFF_SIG) to the slot state management module 103, and the slot state management module 103 receives the POWEROFF_SIG. After the signal, the slot status is switched to the unpowered state (NOPOWER) after the power is turned off.
3.如果槽位处于设备未上电状态(NOPOWER),监控模块102检测到设备拔出,则向槽位状态管理模块103发送设备不在位信号(ABSENT_SIG),槽位状态管理模块103接收到ABSENT_SIG信号后,则将槽位状态切换到空状态(EMPTY)。3. If the slot is in the device not powered state (NOPOWER), the monitoring module 102 detects that the device is unplugged, and then sends a device out-of-bit signal (ABSENT_SIG) to the slot state management module 103, and the slot state management module 103 receives the ABSENT_SIG. After the signal, the slot status is switched to the empty state (EMPTY).
4.如果槽位处于设备不正常运行状态(UNHEALTHY),监控模块102检测到设备准备拔出,则向槽位状态管理模块103发送设备不在位信号(ABSENT_SIG),槽位状态管理模块103接收到ABSENT_SIG信号后,将槽位状态切换到空状态(EMPTY)。4. If the slot is in the device abnormal state (UNHEALTHY), the monitoring module 102 detects that the device is ready to be unplugged, and then sends a device out-of-bit signal (ABSENT_SIG) to the slot state management module 103, and the slot state management module 103 receives After the ABSENT_SIG signal, the slot status is switched to the empty status (EMPTY).
5.当槽位处于设备正常运行状态、设备未上电状态或者设备不正常运行状态时,都有可能收到设备的非法拔出信号(EXTED_SIG),此时,槽位状态管理模块103确认被拔出的设备是否已经卸载了驱动,释放了资源,如果没有,则执行完卸载驱动,释放资源后,将槽位状态切换到空状态(EMPTY)。5. When the slot is in the normal running state of the device, the device is not powered on, or the device is not working properly, the device may receive the illegal pull-out signal (EXTED_SIG). At this time, the slot state management module 103 confirms that it is Whether the unplugged device has unloaded the driver and released the resources. If not, the uninstall driver is executed, and after the resources are released, the slot status is switched to the empty state (EMPTY).
在本发明实施例中,用户交互模块104向上层应用提供设备信息查询和控制接口,实现热插拔驱动100与上层应用之间的通信。作为本发明的一个实施例,用户交互模块104包括设备信息查询和控制接口,以及热插拔驱动100通知守护进程200的接口,以实现热插拔驱动100与守护进程200之间的通信。In the embodiment of the present invention, the user interaction module 104 provides a device information query and control interface to the upper layer application, and implements communication between the hot plug driver 100 and the upper layer application. As an embodiment of the present invention, the user interaction module 104 includes a device information query and control interface, and the hot plug driver 100 notifies the interface of the daemon 200 to enable communication between the hot plug drive 100 and the daemon process 200.
在本发明实施例中,守护进程200的主要功能是实现消息中转,并提供统一的接口给用户单元300,用户单元300与守护进程200通信,不直接与热插拔驱动100通信。In the embodiment of the present invention, the main function of the daemon process 200 is to implement message relaying, and provide a unified interface to the user unit 300. The user unit 300 communicates with the daemon process 200 and does not directly communicate with the hot plug driver 100.
图9示出了本发明实施例提供的守护进程的工作流程,详述如下:FIG. 9 shows a workflow of a daemon process according to an embodiment of the present invention, which is described in detail as follows:
在步骤S901中,读取配置文件初始化各相关信息。In step S901, the read configuration file initializes each related information.
在步骤S902中,启动守护进程;In step S902, the daemon process is started;
在步骤S903中,判断是否存在远程用户单元或者外部监控***,如果存在则执行步骤S904,开启远程通信机制,例如socket通信线程,并开启心跳程序,每隔3秒向远程用户单元或者外部监控***发一个事件包,通知远程用户单元或者外部监控***本机存在,没有失去联系。socket通信线程轮询接收信息,执行步骤S905,对socket信息进行处理,接收相应的远程用户的请求,再去热插拔驱动查询相应信息,或者向热插拔驱动发出相应的设备***、拔出请求,并执行步骤S906,将结果返回给远程用户单元。In step S903, it is determined whether there is a remote user unit or an external monitoring system, if yes, step S904 is executed to enable a remote communication mechanism, such as a socket communication thread, and the heartbeat program is turned on, and the remote user unit or the external monitoring system is turned every 3 seconds. Send an event package to notify the remote user unit or the external monitoring system that the machine exists and does not lose contact. The socket communication thread polls the received information, and performs step S905 to process the socket information, receive the request of the corresponding remote user, and then go to the hot plug drive to query the corresponding information, or issue the corresponding device insertion and extraction to the hot plug driver. The request is made and step S906 is executed to return the result to the remote subscriber unit.
对于本地用户单元,守护进程在初始化完成、启动守护进程后,执行步骤S907,开启一个消息队列通信线程,读取热插拔驱动和本地用户单元发过来的消息,然后执行步骤S908,处理消息队列中的消息。如果消息队列是热插拔驱动主动发过来的设备***或拔出的相关信息,则执行步骤S909,将消息转发给本地用户单元。如果是用户单元发过来的消息,守护进程则请求热插拔驱动做相应的操作,并读取消息队列返回的结果,执行步骤S909,将结果转发给本地用户单元,如果存在远程用户单元,则执行步骤S906,将结果转发给远程用户单元。For the local user unit, after the initialization process is completed and the daemon is started, the daemon performs step S907, starts a message queue communication thread, reads the message sent by the hot plug driver and the local user unit, and then performs step S908 to process the message queue. Message in. If the message queue is related information that the device that is actively sent by the hot plug driver is inserted or unplugged, step S909 is performed to forward the message to the local subscriber unit. If the message is sent by the user unit, the daemon requests the hot plug driver to perform the corresponding operation, and reads the result returned by the message queue, and performs step S909 to forward the result to the local user unit. If there is a remote user unit, Step S906 is executed to forward the result to the remote subscriber unit.
在本发明实施例中, 本地用户单元300包括显示设备信息,***设备,拔出设备,加载设备驱动,卸载设备驱动,对设备进行上电、下电以及查询设备等功能。作为本发明的一个优选实施例,用户单元300可以采用图形界面模式,用户可以通过点击图形界面上的相关按钮进行相应操作。用户单元300在接收到用户的请求后,通过消息队列发送请求消息给守护进程200,守护进程200将相应请求发送给热插拔驱动100。守护进程200轮询消息队列,将热插拔驱动100返回的结果发送给用户单元300,在图形界面上显示出来。In the embodiment of the present invention, The local user unit 300 includes display device information, inserts the device, pulls out the device, loads the device driver, uninstalls the device driver, and powers on, powers off, and queries the device. As a preferred embodiment of the present invention, the user unit 300 can adopt a graphical interface mode, and the user can perform corresponding operations by clicking the relevant button on the graphical interface. After receiving the user's request, the subscriber unit 300 sends a request message to the daemon 200 through the message queue, and the daemon 200 sends the corresponding request to the hot plug driver 100. The daemon process 200 polls the message queue and sends the result of the hot plug drive 100 back to the subscriber unit 300 for display on the graphical interface.
如果用户单元300是字符模式下的,用户可以通过输入命令进行相应的操作。If the subscriber unit 300 is in the character mode, the user can perform corresponding operations by inputting a command.
在本发明实施例符合CPCI热插拔规范的要求,能够同时支持基本热插拔、完全热插拔和高可靠性热插拔。同时,能够自动为CPCI热插拔设备事先预申请资源,不需要修改BIOS或UBOOT等引导程序,还提供 有CPCI设备管理程序,用户能够直观地了解每个CPCI设备槽上的设备信息。另外,提供了远程设备控制查询接口,能够让用户远程控制设备的热插拔,以及远程查询设备的信息。The embodiments of the present invention meet the requirements of the CPCI hot plug specification, and can support basic hot plugging, full hot swap, and high reliability hot swap. At the same time, it can automatically pre-apply resources for CPCI hot plugging devices without modifying the boot program such as BIOS or UBOOT. With the CPCI device management program, users can intuitively understand the device information on each CPCI device slot. In addition, a remote device control query interface is provided, which enables the user to remotely control the hot plugging of the device and remotely query the device information.
以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内所作的任何修改、等同替换和改进等,均应包含在本发明的保护范围之内。The above is only the preferred embodiment of the present invention, and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection of the present invention. Within the scope.

Claims (10)

1、一种CPCI热插拔***,其特征在于,所述***包括:A CPCI hot plug system, the system comprising:
热插拔驱动,用于监控CPCI平台槽位上设备的***、拔出和运行状态,动态为设备申请和释放资源,加载和卸载设备驱动,向上层应用提供设备信息查询和控制接口;A hot-swappable driver is used to monitor the insertion, removal, and operation of devices on the CPCI platform. The device dynamically requests and releases resources, loads and unloads device drivers, and provides device information query and control interfaces to upper-layer applications.
用户单元,用于接收用户输入的设备信息查询和控制命令,输出设备信息查询和控制请求,接收并向用户显示设备信息查询和控制结果;以及a user unit, configured to receive device information query and control commands input by the user, output device information query and control request, receive and display device information query and control result to the user;
守护进程,用于通过所述设备信息查询和控制接口,将所述用户单元输出的设备信息查询和控制请求发送给所述热插拔驱动,并将所述热插拔驱动返回的设备信息查询和控制结果发送给所述用户单元。a daemon process, configured to send, by using the device information query and control interface, a device information query and control request output by the user unit to the hot plug driver, and query the device information returned by the hot plug drive And the control result is sent to the subscriber unit.
2、如权利要求1所述的***,其特征在于,所述热插拔驱动包括:2. The system of claim 1 wherein said hot plug drive comprises:
初始化模块,用于初始化所述热插拔驱动的运行环境,启动热插拔监控;An initialization module, configured to initialize an operating environment of the hot plug drive, and initiate hot plug monitoring;
监控模块,用于监控CPCI平台槽位上设备的***、拔出和运行状态,输出相应的设备状态监控信号;The monitoring module is configured to monitor the insertion, extraction, and operation status of the device in the slot of the CPCI platform, and output a corresponding device status monitoring signal;
槽位状态管理模块,用于接收所述监控模块,或者外部监控***输出的设备状态监控信号,将槽位状态切换到与所述设备状态监控信号对应的槽位状态,并根据槽位的当前状态,动态为槽位上的设备申请和释放资源,加载和卸载设备驱动;以及The slot status management module is configured to receive the device status monitoring signal output by the monitoring module or the external monitoring system, and switch the slot status to a slot status corresponding to the device status monitoring signal, and according to the current slot status Status, dynamically requesting and releasing resources for devices on the slot, loading and unloading device drivers;
用户交互模块,包括所述设备信息查询和控制接口,以及所述热插拔驱动通知所述守护进程的接口,实现所述热插拔驱动与所述守护进程之间的通信。The user interaction module includes the device information query and control interface, and the hot plug driver notifies the interface of the daemon to implement communication between the hot plug driver and the daemon.
3、如权利要求2所述的***,其特征在于,所述槽位的状态包括空状态、设备未上电状态、设备正常运行状态和设备不正常运行状态。The system of claim 2, wherein the status of the slot includes an empty state, a device not powered state, a normal operating state of the device, and an abnormal operating state of the device.
4、如权利要求1所述的***,其特征在于,所述用户单元为本地用户单元,或/和远程用户单元。4. The system of claim 1 wherein the subscriber unit is a local subscriber unit, or/and a remote subscriber unit.
5、如权利要求1或4所述的***,其特征在于,所述用户单元为字符模式,或/和图形界面模式。5. System according to claim 1 or 4, characterized in that the subscriber unit is in a character mode, or / and a graphical interface mode.
6、一种CPCI热插拔***,其特征在于,所述***包括:6. A CPCI hot plug system, the system comprising:
硬件层,作为所述CPCI热插拔***运行的平台;a hardware layer that serves as a platform for the CPCI hot plug system to operate;
驱动层,包含CPCI热插拔驱动,用于监控CPCI平台槽位上设备的***、拔出和运行状态,动态为设备申请和释放资源,加载和卸载设备驱动,向上层应用提供设备信息查询和控制接口;以及The driver layer, including the CPCI hot-swap driver, is used to monitor the insertion, extraction, and running status of the device in the slot of the CPCI platform, dynamically request and release resources for the device, load and unload the device driver, and provide device information query to the upper layer application. Control interface;
应用层,向用户提供设备信息查询和控制接口,支持在位的设备热插拔。The application layer provides device information query and control interfaces to users, and supports hot swapping of in-place devices.
7、如权利要求6所述的***,其特征在于,所述热插拔驱动包括:7. The system of claim 6 wherein said hot plug drive comprises:
初始化模块,用于初始化所述热插拔驱动的运行环境,启动热插拔监控;An initialization module, configured to initialize an operating environment of the hot plug drive, and initiate hot plug monitoring;
监控模块,用于监控CPCI平台槽位上设备的***、拔出和运行状态,输出相应的设备状态监控信号;The monitoring module is configured to monitor the insertion, extraction, and operation status of the device in the slot of the CPCI platform, and output a corresponding device status monitoring signal;
槽位状态管理模块,用于接收所述监控模块,或者外部监控***输出的设备状态监控信号,将槽位状态切换到与所述设备状态监控信号对应的槽位状态,并根据槽位的当前状态,动态为槽位上的设备申请和释放资源,加载和卸载设备驱动;以及The slot status management module is configured to receive the device status monitoring signal output by the monitoring module or the external monitoring system, and switch the slot status to a slot status corresponding to the device status monitoring signal, and according to the current slot status Status, dynamically requesting and releasing resources for devices on the slot, loading and unloading device drivers;
用户交互模块,用于向上层应用提供设备信息查询和控制接口,实现所述热插拔驱动与上层应用之间的通信。The user interaction module is configured to provide a device information query and control interface to the upper layer application, and implement communication between the hot plug drive and the upper layer application.
8、如权利要求7所述的***,其特征在于,所述槽位的状态包括空状态、设备未上电状态、设备正常运行状态和设备不正常运行状态。The system of claim 7, wherein the status of the slot includes an empty state, a device not powered state, a device normal running state, and a device abnormal operating state.
9、如权利要求7或8所述的***,其特征在于,所述应用层包括:9. The system of claim 7 or 8, wherein the application layer comprises:
用户单元,用于接收用户输入的设备信息查询和控制命令,输出设备信息查询和控制请求,接收并向用户显示设备信息查询和控制结果;以及a user unit, configured to receive device information query and control commands input by the user, output device information query and control request, receive and display device information query and control result to the user;
守护进程,用于通过所述设备信息查询和控制接口,将所述用户单元输出的设备信息查询和控制请求发送给所述热插拔驱动,并将所述热插拔驱动返回的设备信息查询和控制结果发送给所述用户单元。a daemon process, configured to send, by using the device information query and control interface, a device information query and control request output by the user unit to the hot plug driver, and query the device information returned by the hot plug drive And the control result is sent to the subscriber unit.
10、如权利要求9所述的***,其特征在于,所述用户单元为本地用户单元,或/和远程用户单元。10. The system of claim 9, wherein the subscriber unit is a local subscriber unit, or/and a remote subscriber unit.
PCT/CN2010/076287 2009-09-16 2010-08-24 Compact peripheral component interconnection(cpci) hot swap system WO2011032453A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN2009101904322A CN102023940B (en) 2009-09-16 2009-09-16 CPCI (compact peripheral component interconnection) hot swapping system
CN200910190432.2 2009-09-16

Publications (1)

Publication Number Publication Date
WO2011032453A1 true WO2011032453A1 (en) 2011-03-24

Family

ID=43758088

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2010/076287 WO2011032453A1 (en) 2009-09-16 2010-08-24 Compact peripheral component interconnection(cpci) hot swap system

Country Status (2)

Country Link
CN (1) CN102023940B (en)
WO (1) WO2011032453A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015135221A1 (en) * 2014-03-12 2015-09-17 深圳创维-Rgb电子有限公司 Inter-process communication method based on application layer of android and basic application communication system
CN105354081A (en) * 2015-11-26 2016-02-24 北京奇虎科技有限公司 Synchronous service binding method and apparatus

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103164379B (en) * 2011-12-19 2015-11-25 联想(北京)有限公司 A kind ofly realize method that hot drawing and heat inserts and electronic equipment
CN103701881B (en) * 2013-12-18 2017-03-22 中国科学院计算技术研究所 Virtual hotplug system for supporting input/output (I/O) function dynamic distribution and working method thereof
CN105490817B (en) * 2014-10-10 2020-03-31 中兴通讯股份有限公司 Interface board hot plug processing method and device
CN105893293B (en) * 2014-12-18 2019-10-29 伊姆西公司 System and method for managing the quick interconnection equipment hot plug of external module
CN106980588A (en) * 2016-01-18 2017-07-25 中兴通讯股份有限公司 A kind of equipment heat treatment method and device
CN110955624B (en) * 2018-09-26 2023-08-15 阿里巴巴集团控股有限公司 Hot plug method, device and system of PCIE equipment
CN110502464A (en) * 2019-07-26 2019-11-26 苏州浪潮智能科技有限公司 A kind of hot-swappable processing method, device, equipment, system and readable storage medium storing program for executing
CN110704353B (en) * 2019-09-30 2021-03-16 北京航空航天大学 CPCI-ARINC429 hot plug system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1877550A (en) * 2006-01-13 2006-12-13 深圳创维-Rgb电子有限公司 Method for implementing real-time hot-plug of USB memory under TV embedded Linux system
CN1912822A (en) * 2006-08-25 2007-02-14 北京飞天诚信科技有限公司 Device and method for providing intelligent card interface by large scale storage equipment

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4284499B2 (en) * 2003-03-07 2009-06-24 ソニー株式会社 Device management method and device management system
CN2779731Y (en) * 2005-04-28 2006-05-10 北京华力创通科技有限公司 Signal processing card
CN100390769C (en) * 2005-05-20 2008-05-28 威盛电子股份有限公司 IDE control system with hot atach & detach function and magnetic dish array system
CN100447770C (en) * 2005-09-23 2008-12-31 英业达股份有限公司 Hot plug-pull control system and method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1877550A (en) * 2006-01-13 2006-12-13 深圳创维-Rgb电子有限公司 Method for implementing real-time hot-plug of USB memory under TV embedded Linux system
CN1912822A (en) * 2006-08-25 2007-02-14 北京飞天诚信科技有限公司 Device and method for providing intelligent card interface by large scale storage equipment

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015135221A1 (en) * 2014-03-12 2015-09-17 深圳创维-Rgb电子有限公司 Inter-process communication method based on application layer of android and basic application communication system
CN103902390B (en) * 2014-03-12 2017-04-19 深圳创维-Rgb电子有限公司 Inter-process communication method based on Android application layer and basis application communication system
CN105354081A (en) * 2015-11-26 2016-02-24 北京奇虎科技有限公司 Synchronous service binding method and apparatus
CN105354081B (en) * 2015-11-26 2018-06-12 北京奇虎科技有限公司 The method and device of synchronous binding service

Also Published As

Publication number Publication date
CN102023940A (en) 2011-04-20
CN102023940B (en) 2013-07-10

Similar Documents

Publication Publication Date Title
WO2011032453A1 (en) Compact peripheral component interconnection(cpci) hot swap system
US7853815B2 (en) Method and apparatus for controlling power supply in a computer system under low power consumption mode
US5742514A (en) Integrated remote asynchronous power switch
US7447930B2 (en) USB control circuit for saving power and the method thereof
EP3479438A1 (en) Electronic device comprising antenna
WO2018076812A1 (en) Data request response method and device, storage medium, server and system
WO2018205376A1 (en) Association information querying method, terminal, server management system, and computer readable storage medium
WO2017206883A1 (en) Application processing method and apparatus, storage medium, and electronic device
EP3899712A1 (en) Electronic device and method for performing fast transition between screens
CN106445612B (en) Method and device for opening application and mobile terminal
US20080098249A1 (en) Power supply system
US20060117198A1 (en) Electronic apparatus and power control method
WO2017219485A1 (en) Smart television and control method therefor
TWM365529U (en) Data access apparatus and processing system using the same
WO2021075916A1 (en) Electronic device including resonant charging circuit
WO2018006581A1 (en) Smart-television playback method and apparatus
WO2020149722A1 (en) Working environment provisioning method and apparatus for execution of application program between electronic device and external server
US8392745B2 (en) Modular integrated circuit with clock control circuit
CN108833981A (en) A kind of method of switching on and shutting down
CN111246199A (en) Control method and device for camera test, terminal equipment and storage medium
WO2017152526A1 (en) External device automatic mounting and notification control method and system
JP5907550B2 (en) USB device and method for controlling USB device
WO2017045444A1 (en) Remote controller key allocation method and device
US8990471B2 (en) Modular integrated circuit with common interface
US20120036294A1 (en) Computer integrated display integrated display and control method of the same

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 10816657

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 10816657

Country of ref document: EP

Kind code of ref document: A1