WO2021185135A1 - Message signaled interrupt implementation method, apparatus and device - Google Patents

Message signaled interrupt implementation method, apparatus and device Download PDF

Info

Publication number
WO2021185135A1
WO2021185135A1 PCT/CN2021/079986 CN2021079986W WO2021185135A1 WO 2021185135 A1 WO2021185135 A1 WO 2021185135A1 CN 2021079986 W CN2021079986 W CN 2021079986W WO 2021185135 A1 WO2021185135 A1 WO 2021185135A1
Authority
WO
WIPO (PCT)
Prior art keywords
message
information
message signal
interrupt
memory
Prior art date
Application number
PCT/CN2021/079986
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 WO2021185135A1 publication Critical patent/WO2021185135A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45575Starting, stopping, suspending or resuming virtual machine instances
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45583Memory management, e.g. access or allocation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/548Queue

Definitions

  • This application relates to the field of computer technology, in particular to methods, devices, electronic equipment, and storage devices for realizing message signal interruption; this application also relates to a serverless processing method for event processing, a serverless processing method using elastic expansion, and A serverless processing method for IoT data.
  • Secure containers In the development of cloud computing technology, especially cloud native technology, secure containers have gradually become the focus of everyone’s attention. Secure containers are usually implemented using secure sandboxes. These secure sandboxes meet the cloud-native container standards on the one hand, and on the other hand It provides users with a safe operating environment. At the same time, it is widely used in serverless scenarios due to its low resource occupation and fast startup speed.
  • Some security sandboxes support memory-mapped bus devices (that is, memory-mapped bus devices that follow the virtual transfer protocol, for example, mmio devices that follow the virtio protocol).
  • Memory-mapped bus devices have the advantages of simple implementation and high data security, but When using memory-mapped bus devices, in many cases, due to the limitation of the virtual transport protocol, only traditional single interrupts are supported, and multiple interrupts are not supported, so the interrupt performance is low; in addition, due to the lack of multiple interrupt support, virtual machine access cannot be supported Of multi-queue devices.
  • the present application provides a method for realizing message signal interruption to solve the multi-queue problem of low interruption performance of existing virtual input and output devices and the inability to support virtual machine access.
  • This application provides a method for realizing message signal interruption, including:
  • the virtual machine monitor allocates interrupt resources according to the number of queues of the memory-mapped bus device and initializes the interrupt resources; the number of queues is multiple;
  • the information of the configured message signal interruption message is provided to the hypervisor.
  • the obtaining information about the message signal interrupt message configured by the client kernel for the memory mapped bus device includes:
  • the information of the signal interrupt message configured by the client kernel for the memory mapped bus device is obtained.
  • the provision of the configured message signal interruption message information to the virtual machine management program includes:
  • it also includes:
  • This application also provides a method for realizing message signal interruption, including:
  • the client kernel When the client kernel initializes the memory-mapped bus device, it allocates a corresponding message signal interrupt message and interrupt number to each queue according to the number of queues of the memory-mapped bus device; the number of queues is multiple;
  • the provision of information about the message signal interruption message configured for each queue to the virtual machine monitor includes:
  • the provision of information about the message signal interruption message configured for each queue to the virtual machine monitor includes:
  • the address of the message signal interrupt message information configured for each queue is stored in a predefined address register for storing the address of the message signal interrupt message information, so that the virtual machine monitor can obtain the message from the address register Signal the address of the information of the signal interruption message and obtain the information of the message signal interruption message according to the address.
  • it also includes:
  • the obtaining the number of queues of the memory mapped bus device includes:
  • the virtual memory mapped input/output is read from the memory space through a virtual transfer protocol.
  • This application also provides a device for realizing message signal interruption, including:
  • the interrupt resource allocation unit is used to allocate interrupt resources and initialize the interrupt resources according to the number of queues of the memory mapped bus device when the virtual machine monitor is initialized; the number of queues is multiple;
  • the message signal interrupt (msi) message information obtaining unit is used to obtain the message signal interrupt (msi) message information configured by the client kernel for the memory mapped bus device;
  • the information providing unit is configured to provide the configured message signal interrupt message information to the virtual machine management program.
  • This application also provides an electronic device, including:
  • the memory is used to store a program for implementing the method for interrupting a message signal. After the device is powered on and running the program for implementing the method for interrupting a message signal through the processor, the following steps are executed:
  • the virtual machine monitor allocates interrupt resources according to the number of queues of the memory-mapped bus device and initializes the interrupt resources; the number of queues is multiple;
  • the information of the configured message signal interruption message is provided to the hypervisor.
  • the present application also provides a storage device that stores a program for implementing a method for interrupting a message signal, and the program is run by a processor to perform the following steps:
  • the virtual machine monitor allocates interrupt resources according to the number of queues of the memory-mapped bus device and initializes the interrupt resources; the number of queues is multiple;
  • the information of the configured message signal interruption message is provided to the hypervisor.
  • This application also provides a serverless processing method for event processing, including:
  • the processing result is returned to the user.
  • This application also provides a serverless processing method using elastic capacity expansion, including:
  • This application also provides a serverless processing method for IoT data, including:
  • the processing result is returned to the user.
  • This application provides a method for realizing message signal interruption.
  • the virtual machine monitor allocates interrupt resources according to the number of queues of memory-mapped bus devices, and obtains the message signal interrupt (msi) message information configured by the client kernel for the memory-mapped bus device. , And provide the configured message signal interrupt message information to the hypervisor for several steps, realize the message signal interrupt processing method of the memory-mapped bus device, improve the performance of the interrupt processing of the memory-mapped bus device, and solve the existing virtual Low interrupt performance of input and output devices and multi-queue problems that cannot support virtual machine access.
  • mi message signal interrupt
  • Fig. 1 is a flowchart of a method for realizing message signal interruption provided by the first embodiment of the present application.
  • FIG. 2 is a schematic diagram of an architecture provided by an embodiment of the present application.
  • Fig. 3 is a flow chart of providing information of the configured message signal interruption message to the virtual machine management program according to the first embodiment of the present application.
  • Fig. 4 is a flowchart of a method for realizing message signal interruption provided by the second embodiment of the present application.
  • FIG. 5 is an application scenario diagram of a serverless processing method for event processing provided by the ninth embodiment of the present application.
  • Fig. 6 is an application scenario diagram of a serverless processing method using elastic capacity expansion provided by the tenth embodiment of the present application.
  • FIG. 7 is an application scenario diagram of a serverless processing method for Internet of Things data provided by the eleventh embodiment of the present application.
  • the first embodiment of the present application provides a method for realizing message signal interruption, and the execution subject is a virtual machine monitor. Description will be given below in conjunction with FIG. 1.
  • step S101 the virtual machine monitor allocates interrupt resources and initializes the interrupt resources according to the number of queues of the memory-mapped bus device during initialization; the number of queues is multiple.
  • the Message Signaled Interrupts is an interruption method that relies on the device to write a small piece of interrupt description data into a specific address to notify the CPU of the interruption.
  • the virtual machine monitor (VMM, virtual machine monitor) is a system software that can maintain multiple efficient and isolated program environments. This environment allows users to directly access real hardware.
  • the virtual machine monitor is mainly used to manage virtual machines. Machine resources.
  • the memory-mapped bus device refers to a virtualized memory-mapped bus device, which can be simulated by a virtual machine monitor.
  • MMIO Memory-mapped I/O
  • the memory-mapped bus device may include an mmio device that follows the virtio protocol, which is a transmission protocol created by virtualization, and is used interactively between a user virtual machine and a host (host).
  • the interrupt resource refers to the interrupt resource used to service the queue of the input/output device.
  • Allocating interrupt resources according to the number of queues of memory-mapped bus devices refers to allocating an interrupt resource for each queue of memory-mapped bus devices to support multi-interrupt processing of memory-mapped bus devices.
  • the virtual machine monitor allocates interrupt resources according to the number of queues of the memory-mapped bus device during initialization and initializes the interrupt resources, including: the virtual machine monitor creates a memory-mapped bus device during initialization; allocates interrupts according to the number of queues of the memory-mapped bus device Resources and initialize interrupt resources.
  • step S102 information about the message signal interrupt (msi) message configured by the client kernel for the memory mapped bus device is obtained.
  • the client kernel may refer to an operating system running on a virtual machine.
  • the guest kernel refers to the Linux operating system.
  • the client kernel in Figure 2 is the guest kernel.
  • the obtaining information about the message signal interrupt message configured by the client kernel for the memory mapped bus device includes:
  • the information of the signal interrupt message configured by the client kernel for the memory mapped bus device is obtained.
  • the address register used to store the address of the message signal interrupt message information can be predefined.
  • the client kernel stores the address of the msi message information in the address register
  • the virtual machine The monitor can obtain the address information of the configured signal interrupt message information from the address register, and then obtain the information of the signal interrupt message configured by the client kernel for the memory-mapped bus device according to the address information.
  • step S103 the information of the configured message signal interruption message is provided to the hypervisor.
  • the hypervisor in FIG. 2 is KVM (Kernel-based Virtual Machine).
  • the information of the configured message signal interruption message is provided to the virtual machine management program, that is, the configuration process of the message signal interruption is completed.
  • the virtual machine monitor may obtain information about a configured message signal interruption message each time, and may provide the configured message signal interruption message information to the hypervisor.
  • the virtual machine monitor may first store the information of the configured message signal interruption message in a local cache, and provide the information of multiple configured message signal interruption messages to the hypervisor.
  • the providing information of the configured message signal interruption message to the hypervisor includes:
  • FIG. 3 it is a flow chart for providing the information of the configured message signal interruption message to the hypervisor of the virtual machine provided by the first embodiment of the application.
  • the second embodiment of the present application provides a method for realizing message signal interruption, the execution body of which is the client kernel, which will be described below with reference to FIG. 4.
  • step S401 when the client kernel initializes the memory-mapped bus device, it allocates a corresponding message signal interrupt message and interrupt number to each queue according to the number of queues of the memory-mapped bus device; The number of queues is multiple.
  • the client kernel may refer to an operating system running on a virtual machine. For example, if Linux is running on a virtual machine, the guest kernel refers to the Linux operating system.
  • the second embodiment of the present application may further include:
  • the obtaining the number of queues of the memory mapped bus device includes:
  • the virtual memory mapped input/output is read from the memory space through a virtual transfer protocol.
  • the second embodiment of the present application may further include:
  • step S402 a message signal interrupt message is configured for each queue.
  • the message signal interrupt message can be configured according to the pre-defined msi register.
  • step S403 the information of the message signal interrupt message configured for each queue is provided to the virtual machine monitor.
  • the providing the information of the message signal interruption message configured for each queue to the virtual machine monitor includes:
  • the providing the information of the message signal interruption message configured for each queue to the virtual machine monitor includes:
  • the address of the message signal interrupt message information configured for each queue is stored in a predefined address register for storing the address of the message signal interrupt message information, so that the virtual machine monitor can obtain the message from the address register Signal the address of the information of the signal interruption message and obtain the information of the message signal interruption message according to the address.
  • step S404 the message signal interruption is enabled for the memory mapped bus device.
  • the message signal interrupt can be enabled for the memory-mapped bus device.
  • the message signal interruption can be enabled according to a predefined register format.
  • the introduction of the first embodiment and the second embodiment of the present application is completed.
  • the message signal interrupt processing method of the memory-mapped bus device is realized, and the performance of the interrupt processing of the memory-mapped bus device is improved. It solves the problem of low interrupt performance of existing virtual input and output devices and the inability to support multiple queues of virtual machine access.
  • the third embodiment of the present application also provides a device for implementing message signal interruption.
  • the device for realizing message signal interruption includes:
  • the interrupt resource allocation unit is used to allocate interrupt resources and initialize the interrupt resources according to the number of queues of the memory mapped bus device when the virtual machine monitor is initialized; the number of queues is multiple;
  • the message signal interrupt (msi) message information obtaining unit is used to obtain the message signal interrupt (msi) message information configured by the client kernel for the memory mapped bus device;
  • the information providing unit is configured to provide the configured message signal interrupt message information to the virtual machine management program.
  • the information obtaining unit of the message signal interrupt (msi) message is specifically used for:
  • the information of the signal interrupt message configured by the client kernel for the memory mapped bus device is obtained.
  • the information providing unit is specifically configured to:
  • the fourth embodiment of the present application also provides an electronic device.
  • the electronic equipment includes:
  • the memory is used to store a program for implementing the method for interrupting a message signal. After the device is powered on and running the program for implementing the method for interrupting a message signal through the processor, the following steps are executed:
  • the virtual machine monitor allocates interrupt resources according to the number of queues of the memory-mapped bus device and initializes the interrupt resources; the number of queues is multiple;
  • the information of the configured message signal interruption message is provided to the hypervisor.
  • the obtaining information about the message signal interrupt message configured by the client kernel for the memory mapped bus device includes:
  • the information of the signal interrupt message configured by the client kernel for the memory mapped bus device is obtained.
  • the provision of the configured message signal interruption message information to the virtual machine management program includes:
  • the electronic device further executes the following steps:
  • the fifth embodiment of this application also provides a storage device that stores a program for realizing the message signal interruption method, and the program is processed When the device is running, perform the following steps:
  • the virtual machine monitor allocates interrupt resources according to the number of queues of the memory-mapped bus device and initializes the interrupt resources; the number of queues is multiple;
  • the information of the configured message signal interruption message is provided to the hypervisor.
  • the sixth embodiment of the present application also provides a device for implementing message signal interruption.
  • the device includes:
  • the interrupt message distribution unit is used for when the client kernel initializes the memory-mapped bus device, allocates a corresponding message signal interrupt message and interrupt number to each queue according to the number of queues of the memory-mapped bus device; the number of queues is Multiple
  • the interrupt message configuration unit is used to configure the message signal interrupt message for each queue
  • the configuration information providing unit is used to provide the information of the message signal interruption message configured for each queue to the virtual machine monitor;
  • the message signal interruption unit is used to enable message signal interruption for the memory mapped bus device.
  • the configuration information providing unit is specifically used for:
  • the configuration information providing unit is specifically used for:
  • the address of the message signal interrupt message information configured for each queue is stored in a predefined address register for storing the address of the message signal interrupt message information, so that the virtual machine monitor can obtain the message from the address register Signal the address of the information of the signal interruption message and obtain the information of the message signal interruption message according to the address.
  • the device further includes:
  • the queue quantity obtaining unit is used to obtain the queue quantity of the memory mapped bus device.
  • the queue quantity obtaining unit is specifically configured to:
  • the virtual memory mapped input/output is read from the memory space through a virtual transfer protocol.
  • the seventh embodiment of the present application also provides an electronic device, including:
  • the memory is used to store a program for implementing the method for interrupting a message signal. After the device is powered on and running the program for implementing the method for interrupting a message signal through the processor, the following steps are executed:
  • the client kernel When the client kernel initializes the memory-mapped bus device, it allocates a corresponding message signal interrupt message and interrupt number to each queue according to the number of queues of the memory-mapped bus device; the number of queues is multiple;
  • the provision of information about the message signal interruption message configured for each queue to the virtual machine monitor includes:
  • the provision of information about the message signal interruption message configured for each queue to the virtual machine monitor includes:
  • the address of the message signal interrupt message information configured for each queue is stored in a predefined address register for storing the address of the message signal interrupt message information, so that the virtual machine monitor can obtain the message from the address register Signal the address of the information of the signal interruption message and obtain the information of the message signal interruption message according to the address.
  • the electronic device further executes the following steps:
  • the obtaining the number of queues of the memory mapped bus device includes:
  • the virtual memory mapped input/output is read from the memory space through a virtual transfer protocol.
  • the eighth embodiment of the present application also provides a storage device that stores a program for implementing the method for message signal interruption, and the program is processed When the device is running, perform the following steps:
  • the client kernel When the client kernel initializes the memory-mapped bus device, it allocates a corresponding message signal interrupt message and interrupt number to each queue according to the number of queues of the memory-mapped bus device; the number of queues is multiple;
  • the ninth embodiment of the present application provides a serverless processing method for event processing, including:
  • the processing result is returned to the user.
  • the typical scenario using Figure 5 includes that when a user uploads a video file to OSS, a function calculation is triggered to obtain and transmit the object's Meta information to the core algorithm library.
  • the core algorithm library pushes the corresponding video file to the CDN source station according to the algorithm.
  • the processing of specific video hot loading is also triggered to perform multi-transcoding rate processing simultaneously, and the processed video file is stored in the OSS to complete light-weight data processing.
  • the function calculation in FIG. 5 uses the method provided in the first embodiment of the present application and is implemented by serverless computing.
  • the tenth embodiment of the present application provides a serverless processing method using elastic capacity expansion, including:
  • the client in the live broadcast room sends the audio and video collections of the anchor and the Lianmai audience to the function calculation to make the mixed streaming service.
  • the function calculation collects the data and submits it to the mixed streaming service for synthesis, and pushes the composite screen video stream to the CDN ,
  • the terminal audience pulls the live stream in real time, and can see the mixed stream composite picture in real time.
  • the host can connect to multiple jobs at the same time, connect multiple viewers or friends, and synthesize the images into one scene to provide more The audience watching the live broadcast.
  • the function calculation in FIG. 6 uses the method provided in the first embodiment of the present application and is implemented by serverless computing.
  • Function computing is used as a real-time audio and video forwarding cluster connected by MIC audiences and anchors. When the amount of concurrency comes, function computing automatically expands multiple execution environments to process real-time data streams; when the business peak period has passed, it will moderately reduce resource usage .
  • the eleventh embodiment of the present application provides a serverless processing method for IoT data, including:
  • the processing result is returned to the user.
  • Web application Simulate a process of social content update and data processing. Web users forward the request to the function calculation through the API gateway for processing. The function calculation updates the processed content to the database and updates the index. Another function calculates the index. The updated search engine provides external customers for retrieval and completes the entire closed-loop data processing.
  • Smart devices Push the device status to the function calculation process through the IoT (Internet of Things) gateway, and the function calculation pushes the message through the mobile push service through the API interface to the mobile terminal for status confirmation and management.
  • IoT Internet of Things
  • the function calculation in FIG. 7 uses the methods provided in the first embodiment and the second embodiment of this application, and is implemented by serverless computing.
  • the computing device includes one or more processors (CPUs), memory-mapped input/output interfaces, network interfaces, and memory.
  • processors CPUs
  • memory-mapped input/output interfaces network interfaces
  • memory-mapped input/output interfaces network interfaces
  • memory-mapped input/output interfaces network interfaces
  • memory-mapped input/output interfaces network interfaces
  • the memory may include non-permanent memory in a computer readable medium, random access memory (RAM) and/or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM). Memory is an example of computer readable media.
  • RAM random access memory
  • ROM read-only memory
  • flash RAM flash memory
  • Computer-readable media include permanent and non-permanent, removable and non-removable media, and information storage can be realized by any method or technology.
  • the information can be computer-readable instructions, data structures, program modules, or other data.
  • Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, CD-ROM, digital versatile disc (DVD) or other optical storage, Magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media can be used to store information that can be accessed by computing devices.
  • computer-readable media does not include non-transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.
  • this application can be provided as a method, a system, or a computer program product. Therefore, this application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
  • a computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)
  • Bus Control (AREA)

Abstract

A message signaled interrupt (msi) implementation method, apparatus and device. The method comprises: a virtual machine monitor allocates, during initialization, interrupt resources according to the number of queues of a memory-mapped bus device and initializes the interrupt resources (S101), there being a plurality of queues; obtain information about an msi message configured by a client kernel for the memory-mapped bus device (S102); and provide the information about the configured msi message to a virtual machine manager (S103). By using the above-mentioned method, the problems in existing virtual input and output devices of low interrupt performance and inability to support multiple queues for virtual machine access are solved.

Description

实现消息信号中断的方法、装置和设备Method, device and equipment for realizing message signal interruption
本申请要求2020年03月17日递交的申请号为202010188210.3、发明名称为“实现消息信号中断的方法、装置和设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application filed on March 17, 2020 with the application number 202010188210.3 and the invention title "Method, Apparatus and Equipment for Realizing Message Signal Interruption", the entire content of which is incorporated into this application by reference.
技术领域Technical field
本申请涉及计算机技术领域,具体涉及实现消息信号中断的方法、装置、电子设备和存储设备;本申请还涉及一种针对事件处理的无服务器处理方法、一种利用弹性扩容的无服务器处理方法和一种针对物联网数据的无服务器处理方法。This application relates to the field of computer technology, in particular to methods, devices, electronic equipment, and storage devices for realizing message signal interruption; this application also relates to a serverless processing method for event processing, a serverless processing method using elastic expansion, and A serverless processing method for IoT data.
背景技术Background technique
在云计算技术尤其是云原生技术的发展过程中,安全容器逐渐成为大家关注的焦点,安全容器通常采用安全沙箱来实现,这些安全沙箱一方面满足了云原生的容器标准,另一方面为用户提供了安全的运行环境,同时由于其本身占用资源少,启动速度快,在serverless(无服务器)场景上被广泛应用。In the development of cloud computing technology, especially cloud native technology, secure containers have gradually become the focus of everyone’s attention. Secure containers are usually implemented using secure sandboxes. These secure sandboxes meet the cloud-native container standards on the one hand, and on the other hand It provides users with a safe operating environment. At the same time, it is widely used in serverless scenarios due to its low resource occupation and fast startup speed.
一些安全沙箱支持内存映射总线设备(即遵循虚拟传输协议的内存映射总线设备,例如,遵循virtio协议的mmio设备),内存映射总线设备具有实现简单和具有较高的数据安全性的优点,但是在使用内存映射总线设备时,在很多情况下,由于受虚拟传输协议的限制只支持传统的单中断,不支持多中断,因此中断性能低;此外由于缺乏多中断支持,无法支持虚拟机接入的多队列设备。Some security sandboxes support memory-mapped bus devices (that is, memory-mapped bus devices that follow the virtual transfer protocol, for example, mmio devices that follow the virtio protocol). Memory-mapped bus devices have the advantages of simple implementation and high data security, but When using memory-mapped bus devices, in many cases, due to the limitation of the virtual transport protocol, only traditional single interrupts are supported, and multiple interrupts are not supported, so the interrupt performance is low; in addition, due to the lack of multiple interrupt support, virtual machine access cannot be supported Of multi-queue devices.
发明内容Summary of the invention
本申请提供一种实现消息信号中断的方法,以解决现有虚拟输入输出设备中断性能低以及无法支持虚拟机接入的多队列问题。The present application provides a method for realizing message signal interruption to solve the multi-queue problem of low interruption performance of existing virtual input and output devices and the inability to support virtual machine access.
本申请提供一种实现消息信号中断的方法,包括:This application provides a method for realizing message signal interruption, including:
虚拟机监视器在初始化时根据内存映射总线设备的队列数量分配中断资源并初始化所述中断资源;所述队列数量为多个;During initialization, the virtual machine monitor allocates interrupt resources according to the number of queues of the memory-mapped bus device and initializes the interrupt resources; the number of queues is multiple;
获得客户机内核针对所述内存映射总线设备配置的消息信号中断(msi)消息的信息;Obtaining information about the message signal interrupt (msi) message configured by the client kernel for the memory mapped bus device;
将所述配置的消息信号中断消息的信息提供给虚拟机管理程序。The information of the configured message signal interruption message is provided to the hypervisor.
可选的,所述获得客户机内核针对所述内存映射总线设备配置的消息信号中断消息 的信息,包括:Optionally, the obtaining information about the message signal interrupt message configured by the client kernel for the memory mapped bus device includes:
从预定义的地址寄存器中获得消息信号中断消息的信息的地址信息;其中,所述地址寄存器用于存储所述消息信号中断消息的信息的地址;Obtain the address information of the information of the message signal interruption message from a predefined address register; wherein the address register is used to store the address of the information of the message signal interruption message;
根据获得的消息信号中断消息的信息的地址信息,得到客户机内核针对所述内存映射总线设备配置的信号中断消息的信息。According to the obtained address information of the information of the message signal interrupt message, the information of the signal interrupt message configured by the client kernel for the memory mapped bus device is obtained.
可选的,所述将所述配置的消息信号中断消息的信息提供给虚拟机管理程序,包括:Optionally, the provision of the configured message signal interruption message information to the virtual machine management program includes:
将获得的客户机内核针对所述内存映射总线设备配置的消息信号中断消息的信息保存在本地缓存中;Saving the obtained information of the message signal interrupt message configured by the client kernel for the memory mapped bus device in a local cache;
获得消息信号中断使能标识信息;Obtain the message signal interrupt enable identification information;
根据所述消息信号中断使能标识信息判断是否使能消息信号中断,当判断的结果为是时,将存储在本地缓存中的消息信号中断消息的信息提供给虚拟机管理程序。It is determined whether to enable the message signal interruption according to the message signal interruption enable identification information, and when the result of the determination is yes, the information of the message signal interruption message stored in the local cache is provided to the hypervisor.
可选的,还包括:Optionally, it also includes:
当判断的结果为否时,返回到获得客户机内核针对所述内存映射总线设备配置的消息信号中断消息的信息的步骤。When the result of the judgment is no, return to the step of obtaining information about the message signal interrupt message configured by the client kernel for the memory mapped bus device.
本申请还提供一种实现消息信号中断的方法,包括:This application also provides a method for realizing message signal interruption, including:
客户机内核对内存映射总线设备进行初始化操作时,根据所述内存映射总线设备的队列数量为每个队列分配对应的消息信号中断消息和中断号;所述队列数量为多个;When the client kernel initializes the memory-mapped bus device, it allocates a corresponding message signal interrupt message and interrupt number to each queue according to the number of queues of the memory-mapped bus device; the number of queues is multiple;
将针对每个队列配置的消息信号中断消息的信息提供给虚拟机监视器;Provide the information of the message signal interruption message configured for each queue to the virtual machine monitor;
针对所述内存映射总线设备使能消息信号中断。Enable message signal interruption for the memory mapped bus device.
可选的,所述将针对每个队列配置的消息信号中断消息的信息提供给虚拟机监视器,包括:Optionally, the provision of information about the message signal interruption message configured for each queue to the virtual machine monitor includes:
判断是否成功分配了消息信号中断消息和中断号,若是,将针对每个队列配置的消息信号中断消息的信息提供给虚拟机监视器;Determine whether the message signal interruption message and the interrupt number are successfully allocated, and if so, provide the information of the message signal interruption message configured for each queue to the virtual machine monitor;
若否,对所述内存映射总线设备进行单中断配置。If not, perform a single interrupt configuration on the memory mapped bus device.
可选的,所述将针对每个队列配置的消息信号中断消息的信息提供给虚拟机监视器,包括:Optionally, the provision of information about the message signal interruption message configured for each queue to the virtual machine monitor includes:
将针对每个队列配置的消息信号中断消息的信息的地址存储到预定义的用于存储消息信号中断消息的信息的地址的地址寄存器中,以供虚拟机监视器从所述地址寄存器中获得消息信号中断消息的信息的地址并根据地址获得消息信号中断消息的信息。The address of the message signal interrupt message information configured for each queue is stored in a predefined address register for storing the address of the message signal interrupt message information, so that the virtual machine monitor can obtain the message from the address register Signal the address of the information of the signal interruption message and obtain the information of the message signal interruption message according to the address.
可选的,还包括:Optionally, it also includes:
获得所述内存映射总线设备的队列数量。Obtain the number of queues of the memory mapped bus device.
可选的,所述获得所述内存映射总线设备的队列数量,包括:Optionally, the obtaining the number of queues of the memory mapped bus device includes:
获得虚拟机监视器通过虚拟传输协议写入用于存储所述内存映射总线设备的队列数量的内存空间;Obtain the memory space written by the virtual machine monitor to store the number of queues of the memory mapped bus device through the virtual transfer protocol;
通过虚拟传输协议从所述内存空间中读取所述虚拟存储器映射输入/输出。The virtual memory mapped input/output is read from the memory space through a virtual transfer protocol.
本申请还提供一种实现消息信号中断的装置,包括:This application also provides a device for realizing message signal interruption, including:
中断资源分配单元,用于虚拟机监视器在初始化时根据内存映射总线设备的队列数量分配中断资源并初始化所述中断资源;所述队列数量为多个;The interrupt resource allocation unit is used to allocate interrupt resources and initialize the interrupt resources according to the number of queues of the memory mapped bus device when the virtual machine monitor is initialized; the number of queues is multiple;
消息信号中断(msi)消息的信息获得单元,用于获得客户机内核针对所述内存映射总线设备配置的消息信号中断(msi)消息的信息;The message signal interrupt (msi) message information obtaining unit is used to obtain the message signal interrupt (msi) message information configured by the client kernel for the memory mapped bus device;
信息提供单元,用于将所述配置的消息信号中断消息的信息提供给虚拟机管理程序。The information providing unit is configured to provide the configured message signal interrupt message information to the virtual machine management program.
本申请还提供一种电子设备,包括:This application also provides an electronic device, including:
处理器;以及Processor; and
存储器,用于存储实现消息信号中断的方法的程序,该设备通电并通过所述处理器运行该实现消息信号中断的方法的程序后,执行下述步骤:The memory is used to store a program for implementing the method for interrupting a message signal. After the device is powered on and running the program for implementing the method for interrupting a message signal through the processor, the following steps are executed:
虚拟机监视器在初始化时根据内存映射总线设备的队列数量分配中断资源并初始化所述中断资源;所述队列数量为多个;During initialization, the virtual machine monitor allocates interrupt resources according to the number of queues of the memory-mapped bus device and initializes the interrupt resources; the number of queues is multiple;
获得客户机内核针对所述内存映射总线设备配置的消息信号中断(msi)消息的信息;Obtaining information about the message signal interrupt (msi) message configured by the client kernel for the memory mapped bus device;
将所述配置的消息信号中断消息的信息提供给虚拟机管理程序。The information of the configured message signal interruption message is provided to the hypervisor.
本申请还提供一种存储设备,存储有实现消息信号中断的方法的程序,该程序被处理器运行,执行下述步骤:The present application also provides a storage device that stores a program for implementing a method for interrupting a message signal, and the program is run by a processor to perform the following steps:
虚拟机监视器在初始化时根据内存映射总线设备的队列数量分配中断资源并初始化所述中断资源;所述队列数量为多个;During initialization, the virtual machine monitor allocates interrupt resources according to the number of queues of the memory-mapped bus device and initializes the interrupt resources; the number of queues is multiple;
获得客户机内核针对所述内存映射总线设备配置的消息信号中断(msi)消息的信息;Obtaining information about the message signal interrupt (msi) message configured by the client kernel for the memory mapped bus device;
将所述配置的消息信号中断消息的信息提供给虚拟机管理程序。The information of the configured message signal interruption message is provided to the hypervisor.
本申请还提供一种针对事件处理的无服务器处理方法,包括:This application also provides a serverless processing method for event processing, including:
接收用户触发的事件信息;Receive event information triggered by the user;
调用函数计算处理所述事件信息,获得所述事件信息的处理结果,其中,所述函数计算采用上述实现消息信号中断的方法中至少一项实现;Calling a function to calculate and process the event information to obtain a processing result of the event information, wherein the function calculation is implemented by using at least one of the foregoing methods for interrupting a message signal;
将所述处理结果返回给用户。The processing result is returned to the user.
本申请还提供一种利用弹性扩容的无服务器处理方法,包括:This application also provides a serverless processing method using elastic capacity expansion, including:
接收用户发送的数字内容信息;Receive digital content information sent by users;
调用函数计算对所述数字内容信息进行弹性扩容处理,获得所述数字内容信息的混流结果,其中,所述函数计算采用上述实现消息信号中断的方法中至少一项实现;Calling function calculation to perform elastic expansion processing on the digital content information to obtain a mixed stream result of the digital content information, wherein the function calculation is implemented by using at least one of the foregoing methods for implementing message signal interruption;
将所述混流结果发送给终端用户。Send the mixed streaming result to the end user.
本申请还提供一种针对物联网数据的无服务器处理方法,包括:This application also provides a serverless processing method for IoT data, including:
接收设备发送的物联网数据;Receive IoT data sent by the device;
调用函数计算处理所述物联网数据,获得所述物联网数据的处理结果,其中,所述函数计算采用上述实现消息信号中断的方法中至少一项实现;Calling a function to calculate and process the Internet of Things data to obtain a processing result of the Internet of Things data, wherein the function calculation is implemented by using at least one of the above methods for implementing message signal interruption;
将所述处理结果返回给用户。The processing result is returned to the user.
与现有技术相比,本申请具有以下优点:Compared with the prior art, this application has the following advantages:
本申请提供一种实现消息信号中断的方法,通过虚拟机监视器根据内存映射总线设备的队列数量分配中断资源,并获得客户机内核针对内存映射总线设备配置的消息信号中断(msi)消息的信息,并将配置的消息信号中断消息的信息提供给虚拟机管理程序几个步骤,实现了内存映射总线设备的消息信号中断处理方式,提高了内存映射总线设备中断处理的性能,解决了现有虚拟输入输出设备中断性能低以及无法支持虚拟机接入的多队列问题。This application provides a method for realizing message signal interruption. The virtual machine monitor allocates interrupt resources according to the number of queues of memory-mapped bus devices, and obtains the message signal interrupt (msi) message information configured by the client kernel for the memory-mapped bus device. , And provide the configured message signal interrupt message information to the hypervisor for several steps, realize the message signal interrupt processing method of the memory-mapped bus device, improve the performance of the interrupt processing of the memory-mapped bus device, and solve the existing virtual Low interrupt performance of input and output devices and multi-queue problems that cannot support virtual machine access.
附图说明Description of the drawings
图1是本申请第一实施例提供的一种实现消息信号中断的方法的流程图。Fig. 1 is a flowchart of a method for realizing message signal interruption provided by the first embodiment of the present application.
图2是本申请实施例提供的一种架构示意图。FIG. 2 is a schematic diagram of an architecture provided by an embodiment of the present application.
图3是本申请第一实施例提供的一种将所述配置的消息信号中断消息的信息提供给虚拟机管理程序的流程图。Fig. 3 is a flow chart of providing information of the configured message signal interruption message to the virtual machine management program according to the first embodiment of the present application.
图4是本申请第二实施例提供的一种实现消息信号中断的方法的流程图。Fig. 4 is a flowchart of a method for realizing message signal interruption provided by the second embodiment of the present application.
图5是本申请第九实施例提供的一种针对事件处理的无服务器处理方法的应用场景图。FIG. 5 is an application scenario diagram of a serverless processing method for event processing provided by the ninth embodiment of the present application.
图6是本申请第十实施例提供的一种利用弹性扩容的无服务器处理方法的应用场景图。Fig. 6 is an application scenario diagram of a serverless processing method using elastic capacity expansion provided by the tenth embodiment of the present application.
图7是本申请第十一实施例提供的一种针对物联网数据的无服务器处理方法的应用场景图。FIG. 7 is an application scenario diagram of a serverless processing method for Internet of Things data provided by the eleventh embodiment of the present application.
具体实施方式Detailed ways
在下面的描述中阐述了很多具体细节以便于充分理解本发明。但是本发明能够以很多不同于在此描述的其它方式来实施,本领域技术人员可以在不违背本发明内涵的情况下做类似推广,因此本发明不受下面公开的具体实施的限制。In the following description, many specific details are explained in order to fully understand the present invention. However, the present invention can be implemented in many other ways different from those described here, and those skilled in the art can make similar popularizations without violating the connotation of the present invention. Therefore, the present invention is not limited by the specific implementation disclosed below.
本申请第一实施例提供一种实现消息信号中断的方法,其执行主体为虚拟机监视器。下面结合图1进行说明。The first embodiment of the present application provides a method for realizing message signal interruption, and the execution subject is a virtual machine monitor. Description will be given below in conjunction with FIG. 1.
如图1所示,在步骤S101中,虚拟机监视器在初始化时根据内存映射总线设备的队列数量分配中断资源并初始化所述中断资源;所述队列数量为多个。As shown in FIG. 1, in step S101, the virtual machine monitor allocates interrupt resources and initializes the interrupt resources according to the number of queues of the memory-mapped bus device during initialization; the number of queues is multiple.
所述消息信号中断(MSI,Message Signaled Interrupts)是一种中断方式,依靠设备将一小段中断描述数据写入特定地址来通知CPU中断的产生。The Message Signaled Interrupts (MSI, Message Signaled Interrupts) is an interruption method that relies on the device to write a small piece of interrupt description data into a specific address to notify the CPU of the interruption.
所述虚拟机监视器(VMM,virtual machine monitor),是一个系统软件,可以维护多个高效的、隔离的程序环境,该环境支持用户直接去访问真实硬件,虚拟机监视器主要用于管理虚拟机的资源。The virtual machine monitor (VMM, virtual machine monitor) is a system software that can maintain multiple efficient and isolated program environments. This environment allows users to directly access real hardware. The virtual machine monitor is mainly used to manage virtual machines. Machine resources.
所述内存映射总线设备(MMIO,Memory-mapped I/O),指虚拟出的内存映射总线设备,可以通过虚拟机监视器模拟出内存映射总线设备。例如,虚拟网卡、虚拟硬盘属于内存映射总线设备。内存映射总线设备,可以包括遵循virtio协议的mmio设备,virtio是一种虚拟化创建的传输协议,用户虚拟机与主机(host)之间交互使用。The memory-mapped bus device (MMIO, Memory-mapped I/O) refers to a virtualized memory-mapped bus device, which can be simulated by a virtual machine monitor. For example, virtual network cards and virtual hard disks are memory-mapped bus devices. The memory-mapped bus device may include an mmio device that follows the virtio protocol, which is a transmission protocol created by virtualization, and is used interactively between a user virtual machine and a host (host).
所述中断资源,指用于服务输入/输出设备的队列的中断资源。The interrupt resource refers to the interrupt resource used to service the queue of the input/output device.
根据内存映射总线设备的队列数量分配中断资源,指为每一个内存映射总线设备的队列分配一个中断资源,以支持内存映射总线设备的多中断处理。Allocating interrupt resources according to the number of queues of memory-mapped bus devices refers to allocating an interrupt resource for each queue of memory-mapped bus devices to support multi-interrupt processing of memory-mapped bus devices.
虚拟机监视器在初始化时根据内存映射总线设备的队列数量分配中断资源并初始化所述中断资源,包括:虚拟机监视器在初始化时创建内存映射总线设备;根据内存映射总线设备的队列数量分配中断资源并初始化中断资源。The virtual machine monitor allocates interrupt resources according to the number of queues of the memory-mapped bus device during initialization and initializes the interrupt resources, including: the virtual machine monitor creates a memory-mapped bus device during initialization; allocates interrupts according to the number of queues of the memory-mapped bus device Resources and initialize interrupt resources.
如图1所示,在步骤S102中,获得客户机内核针对所述内存映射总线设备配置的消息信号中断(msi)消息的信息。As shown in FIG. 1, in step S102, information about the message signal interrupt (msi) message configured by the client kernel for the memory mapped bus device is obtained.
所述客户机内核,可以指虚拟机上运行的操作系统。例如,如果在虚拟机上运行Linux,则客户机内核指Linux操作系统。图2中的客户机内核为guest kernel。The client kernel may refer to an operating system running on a virtual machine. For example, if Linux is running on a virtual machine, the guest kernel refers to the Linux operating system. The client kernel in Figure 2 is the guest kernel.
作为一种实施方式,所述获得客户机内核针对所述内存映射总线设备配置的消息信 号中断消息的信息,包括:As an implementation manner, the obtaining information about the message signal interrupt message configured by the client kernel for the memory mapped bus device includes:
从预定义的地址寄存器中获得消息信号中断消息的信息的地址信息;其中,所述地址寄存器用于存储所述消息信号中断消息的信息的地址;Obtain the address information of the information of the message signal interruption message from a predefined address register; wherein the address register is used to store the address of the information of the message signal interruption message;
根据获得的消息信号中断消息的信息的地址信息,得到客户机内核针对所述内存映射总线设备配置的信号中断消息的信息。According to the obtained address information of the information of the message signal interrupt message, the information of the signal interrupt message configured by the client kernel for the memory mapped bus device is obtained.
为了实现客户机内核与虚拟机监视器的交互,可以预定义用来存储消息信号中断消息的信息的地址的地址寄存器,当客户机内核将msi消息的信息的地址存入地址寄存器后,虚拟机监视器可以从地址寄存器中得到配置的信号中断消息的信息的地址信息,然后根据地址信息得到客户机内核针对内存映射总线设备配置的信号中断消息的信息。In order to realize the interaction between the client kernel and the virtual machine monitor, the address register used to store the address of the message signal interrupt message information can be predefined. When the client kernel stores the address of the msi message information in the address register, the virtual machine The monitor can obtain the address information of the configured signal interrupt message information from the address register, and then obtain the information of the signal interrupt message configured by the client kernel for the memory-mapped bus device according to the address information.
如图1所示,在步骤S103中,将所述配置的消息信号中断消息的信息提供给虚拟机管理程序。As shown in FIG. 1, in step S103, the information of the configured message signal interruption message is provided to the hypervisor.
例如,图2中的虚拟机管理程序为KVM(Kernel-based Virtual Machine)。For example, the hypervisor in FIG. 2 is KVM (Kernel-based Virtual Machine).
将所述配置的消息信号中断消息的信息提供给虚拟机管理程序,即完成了消息信号中断的配置过程。The information of the configured message signal interruption message is provided to the virtual machine management program, that is, the configuration process of the message signal interruption is completed.
具体实施时,虚拟机监视器可以在每次得到一个配置的消息信号中断消息的信息,可以将配置的消息信号中断消息的信息提供给虚拟机管理程序。During specific implementation, the virtual machine monitor may obtain information about a configured message signal interruption message each time, and may provide the configured message signal interruption message information to the hypervisor.
为了提高效率,虚拟机监视器还可以先将获得的配置的消息信号中断消息的信息存储在本地缓存中,将多个配置的消息信号中断消息的信息一起提供给虚拟机管理程序。In order to improve efficiency, the virtual machine monitor may first store the information of the configured message signal interruption message in a local cache, and provide the information of multiple configured message signal interruption messages to the hypervisor.
所述将所述配置的消息信号中断消息的信息提供给虚拟机管理程序,包括:The providing information of the configured message signal interruption message to the hypervisor includes:
将获得的客户机内核针对所述内存映射总线设备配置的消息信号中断消息的信息保存在本地缓存中;Saving the obtained information of the message signal interrupt message configured by the client kernel for the memory mapped bus device in a local cache;
获得消息信号中断使能标识信息;Obtain the message signal interrupt enable identification information;
根据所述消息信号中断使能标识信息判断是否使能消息信号中断,当判断的结果为是时,将存储在本地缓存中的消息信号中断消息的信息提供给虚拟机管理程序;Judging whether to enable the message signal interruption according to the message signal interruption enable identification information, and when the result of the judgment is yes, provide the information of the message signal interruption message stored in the local cache to the hypervisor;
当判断的结果为否时,返回到获得客户机内核针对所述内存映射总线设备配置的消息信号中断消息的信息的步骤。When the result of the judgment is no, return to the step of obtaining information about the message signal interrupt message configured by the client kernel for the memory mapped bus device.
如图3所示,其为本申请第一实施例提供的一种将所述配置的消息信号中断消息的信息提供给虚拟机管理程序的流程图。As shown in FIG. 3, it is a flow chart for providing the information of the configured message signal interruption message to the hypervisor of the virtual machine provided by the first embodiment of the application.
本申请第二实施例提供一种实现消息信号中断的方法,其执行主体为客户机内核,下面结合图4进行说明。The second embodiment of the present application provides a method for realizing message signal interruption, the execution body of which is the client kernel, which will be described below with reference to FIG. 4.
如图4所示,在步骤S401中,客户机内核对内存映射总线设备进行初始化操作时,根据所述内存映射总线设备的队列数量为每个队列分配对应的消息信号中断消息和中断号;所述队列数量为多个。As shown in FIG. 4, in step S401, when the client kernel initializes the memory-mapped bus device, it allocates a corresponding message signal interrupt message and interrupt number to each queue according to the number of queues of the memory-mapped bus device; The number of queues is multiple.
所述客户机内核,可以指虚拟机上运行的操作系统。例如,如果在虚拟机上运行Linux,则客户机内核指Linux操作系统。The client kernel may refer to an operating system running on a virtual machine. For example, if Linux is running on a virtual machine, the guest kernel refers to the Linux operating system.
作为一种实施方式,本申请第二实施例还可以包括:As an implementation manner, the second embodiment of the present application may further include:
获得内存映射总线设备的队列数量。Get the number of queues of memory mapped bus devices.
所述获得所述内存映射总线设备的队列数量,包括:The obtaining the number of queues of the memory mapped bus device includes:
获得虚拟机监视器通过虚拟传输协议写入用于存储所述内存映射总线设备的队列数量的内存空间;Obtain the memory space written by the virtual machine monitor to store the number of queues of the memory mapped bus device through the virtual transfer protocol;
通过虚拟传输协议从所述内存空间中读取所述虚拟存储器映射输入/输出。The virtual memory mapped input/output is read from the memory space through a virtual transfer protocol.
作为一种实施方式,在根据所述内存映射总线设备的队列数量为每个队列分配对应的消息信号中断消息和中断号的步骤之前,本申请第二实施例还可以包括:As an implementation manner, before the step of assigning a corresponding message signal interrupt message and interrupt number to each queue according to the number of queues of the memory mapped bus device, the second embodiment of the present application may further include:
接入客户机内核中用于处理消息信号中断的处理框架。Access the processing framework used to process message signal interrupts in the client's kernel.
如图4所示,在步骤S402中,针对每个队列配置消息信号中断消息。As shown in FIG. 4, in step S402, a message signal interrupt message is configured for each queue.
在针对每个队列配置消息信号中断消息时,可以按照预定义的msi的寄存器配置消息信号中断消息。When the message signal interrupt message is configured for each queue, the message signal interrupt message can be configured according to the pre-defined msi register.
如图4所示,在步骤S403中,将针对每个队列配置的消息信号中断消息的信息提供给虚拟机监视器。As shown in FIG. 4, in step S403, the information of the message signal interrupt message configured for each queue is provided to the virtual machine monitor.
所述将针对每个队列配置的消息信号中断消息的信息提供给虚拟机监视器,包括:The providing the information of the message signal interruption message configured for each queue to the virtual machine monitor includes:
判断是否成功分配了消息信号中断消息和中断号,若是,将针对每个队列配置的消息信号中断消息的信息提供给虚拟机监视器;Determine whether the message signal interruption message and the interrupt number are successfully allocated, and if so, provide the information of the message signal interruption message configured for each queue to the virtual machine monitor;
若否,对所述内存映射总线设备进行单中断配置。If not, perform a single interrupt configuration on the memory mapped bus device.
所述将针对每个队列配置的消息信号中断消息的信息提供给虚拟机监视器,包括:The providing the information of the message signal interruption message configured for each queue to the virtual machine monitor includes:
将针对每个队列配置的消息信号中断消息的信息的地址存储到预定义的用于存储消息信号中断消息的信息的地址的地址寄存器中,以供虚拟机监视器从所述地址寄存器中获得消息信号中断消息的信息的地址并根据地址获得消息信号中断消息的信息。The address of the message signal interrupt message information configured for each queue is stored in a predefined address register for storing the address of the message signal interrupt message information, so that the virtual machine monitor can obtain the message from the address register Signal the address of the information of the signal interruption message and obtain the information of the message signal interruption message according to the address.
如图4所示,在步骤S404中,针对所述内存映射总线设备使能消息信号中断。As shown in FIG. 4, in step S404, the message signal interruption is enabled for the memory mapped bus device.
当客户机内核将针对每个队列配置的消息信号中断消息的信息提供给虚拟机监视器之后,即可以针对内存映射总线设备使能消息信号中断。After the client kernel provides the information of the message signal interrupt message configured for each queue to the virtual machine monitor, the message signal interrupt can be enabled for the memory-mapped bus device.
具体的,可以根据预定义的寄存器格式使能消息信号中断。Specifically, the message signal interruption can be enabled according to a predefined register format.
例如,预定义#define VIRTIO_MMIO_MSI_CSR_ENABLE 0x8000For example, the predefined #define VIRTIO_MMIO_MSI_CSR_ENABLE 0x8000
则可以向VIRTIO_MMIO_MSI_CSR_ENABLE写入1,使能消息信号中断。You can write 1 to VIRTIO_MMIO_MSI_CSR_ENABLE to enable message signal interruption.
至此,完成了对本申请第一实施例和第二实施例的介绍,通过本申请实施例的方法,实现了内存映射总线设备的消息信号中断处理方式,提高了内存映射总线设备中断处理的性能,解决了现有虚拟输入输出设备中断性能低以及无法支持虚拟机接入的多队列问题。So far, the introduction of the first embodiment and the second embodiment of the present application is completed. Through the method of the embodiment of the present application, the message signal interrupt processing method of the memory-mapped bus device is realized, and the performance of the interrupt processing of the memory-mapped bus device is improved. It solves the problem of low interrupt performance of existing virtual input and output devices and the inability to support multiple queues of virtual machine access.
与本申请第一实施例提供的一种实现消息信号中断的方法相对应的,本申请第三实施例还提供了一种实现消息信号中断的装置。Corresponding to the method for implementing message signal interruption provided by the first embodiment of the present application, the third embodiment of the present application also provides a device for implementing message signal interruption.
所述实现消息信号中断的装置,包括:The device for realizing message signal interruption includes:
中断资源分配单元,用于虚拟机监视器在初始化时根据内存映射总线设备的队列数量分配中断资源并初始化所述中断资源;所述队列数量为多个;The interrupt resource allocation unit is used to allocate interrupt resources and initialize the interrupt resources according to the number of queues of the memory mapped bus device when the virtual machine monitor is initialized; the number of queues is multiple;
消息信号中断(msi)消息的信息获得单元,用于获得客户机内核针对所述内存映射总线设备配置的消息信号中断(msi)消息的信息;The message signal interrupt (msi) message information obtaining unit is used to obtain the message signal interrupt (msi) message information configured by the client kernel for the memory mapped bus device;
信息提供单元,用于将所述配置的消息信号中断消息的信息提供给虚拟机管理程序。The information providing unit is configured to provide the configured message signal interrupt message information to the virtual machine management program.
可选的,所述消息信号中断(msi)消息的信息获得单元,具体用于:Optionally, the information obtaining unit of the message signal interrupt (msi) message is specifically used for:
从预定义的地址寄存器中获得消息信号中断消息的信息的地址信息;其中,所述地址寄存器用于存储所述消息信号中断消息的信息的地址;Obtain the address information of the information of the message signal interruption message from a predefined address register; wherein the address register is used to store the address of the information of the message signal interruption message;
根据获得的消息信号中断消息的信息的地址信息,得到客户机内核针对所述内存映射总线设备配置的信号中断消息的信息。According to the obtained address information of the information of the message signal interrupt message, the information of the signal interrupt message configured by the client kernel for the memory mapped bus device is obtained.
可选的,所述信息提供单元具体用于:Optionally, the information providing unit is specifically configured to:
将获得的客户机内核针对所述内存映射总线设备配置的消息信号中断消息的信息保存在本地缓存中;Saving the obtained information of the message signal interrupt message configured by the client kernel for the memory mapped bus device in a local cache;
获得消息信号中断使能标识信息;Obtain the message signal interrupt enable identification information;
根据所述消息信号中断使能标识信息判断是否使能消息信号中断,当判断的结果为是时,将存储在本地缓存中的消息信号中断消息的信息提供给虚拟机管理程序;Judging whether to enable the message signal interruption according to the message signal interruption enable identification information, and when the result of the judgment is yes, provide the information of the message signal interruption message stored in the local cache to the hypervisor;
当判断的结果为否时,返回到获得客户机内核针对所述内存映射总线设备配置的消息信号中断消息的信息的步骤。When the result of the judgment is no, return to the step of obtaining information about the message signal interrupt message configured by the client kernel for the memory mapped bus device.
需要说明的是,对于本申请第三实施例提供的装置的详细描述可以参考对本申请第 一实施例的相关描述,这里不再赘述。It should be noted that, for the detailed description of the device provided in the third embodiment of the present application, reference may be made to the related description of the first embodiment of the present application, which will not be repeated here.
与本申请第一实施例提供的一种实现消息信号中断的方法相对应的,本申请第四实施例还提供了一种电子设备。Corresponding to the method for realizing message signal interruption provided by the first embodiment of the present application, the fourth embodiment of the present application also provides an electronic device.
所述电子设备,包括:The electronic equipment includes:
处理器;以及Processor; and
存储器,用于存储实现消息信号中断的方法的程序,该设备通电并通过所述处理器运行该实现消息信号中断的方法的程序后,执行下述步骤:The memory is used to store a program for implementing the method for interrupting a message signal. After the device is powered on and running the program for implementing the method for interrupting a message signal through the processor, the following steps are executed:
虚拟机监视器在初始化时根据内存映射总线设备的队列数量分配中断资源并初始化所述中断资源;所述队列数量为多个;During initialization, the virtual machine monitor allocates interrupt resources according to the number of queues of the memory-mapped bus device and initializes the interrupt resources; the number of queues is multiple;
获得客户机内核针对所述内存映射总线设备配置的消息信号中断(msi)消息的信息;Obtaining information about the message signal interrupt (msi) message configured by the client kernel for the memory mapped bus device;
将所述配置的消息信号中断消息的信息提供给虚拟机管理程序。The information of the configured message signal interruption message is provided to the hypervisor.
可选的,所述获得客户机内核针对所述内存映射总线设备配置的消息信号中断消息的信息,包括:Optionally, the obtaining information about the message signal interrupt message configured by the client kernel for the memory mapped bus device includes:
从预定义的地址寄存器中获得消息信号中断消息的信息的地址信息;其中,所述地址寄存器用于存储所述消息信号中断消息的信息的地址;Obtain the address information of the information of the message signal interruption message from a predefined address register; wherein the address register is used to store the address of the information of the message signal interruption message;
根据获得的消息信号中断消息的信息的地址信息,得到客户机内核针对所述内存映射总线设备配置的信号中断消息的信息。According to the obtained address information of the information of the message signal interrupt message, the information of the signal interrupt message configured by the client kernel for the memory mapped bus device is obtained.
可选的,所述将所述配置的消息信号中断消息的信息提供给虚拟机管理程序,包括:Optionally, the provision of the configured message signal interruption message information to the virtual machine management program includes:
将获得的客户机内核针对所述内存映射总线设备配置的消息信号中断消息的信息保存在本地缓存中;Saving the obtained information of the message signal interrupt message configured by the client kernel for the memory mapped bus device in a local cache;
获得消息信号中断使能标识信息;Obtain the message signal interrupt enable identification information;
根据所述消息信号中断使能标识信息判断是否使能消息信号中断,当判断的结果为是时,将存储在本地缓存中的消息信号中断消息的信息提供给虚拟机管理程序。It is determined whether to enable the message signal interruption according to the message signal interruption enable identification information, and when the result of the determination is yes, the information of the message signal interruption message stored in the local cache is provided to the hypervisor.
可选的,所述电子设备还执行下述步骤:Optionally, the electronic device further executes the following steps:
当判断的结果为否时,返回到获得客户机内核针对所述内存映射总线设备配置的消息信号中断消息的信息的步骤。When the result of the judgment is no, return to the step of obtaining information about the message signal interrupt message configured by the client kernel for the memory mapped bus device.
需要说明的是,对于本申请第四实施例提供的电子设备的详细描述可以参考对本申请第一实施例的相关描述,这里不再赘述。It should be noted that, for a detailed description of the electronic device provided in the fourth embodiment of the present application, reference may be made to the related description of the first embodiment of the present application, and details are not repeated here.
与本申请第一实施例提供的一种实现消息信号中断的方法相对应的,本申请第五实 施例还提供了一种存储设备,存储有实现消息信号中断的方法的程序,该程序被处理器运行,执行下述步骤:Corresponding to the method for realizing message signal interruption provided by the first embodiment of this application, the fifth embodiment of this application also provides a storage device that stores a program for realizing the message signal interruption method, and the program is processed When the device is running, perform the following steps:
虚拟机监视器在初始化时根据内存映射总线设备的队列数量分配中断资源并初始化所述中断资源;所述队列数量为多个;During initialization, the virtual machine monitor allocates interrupt resources according to the number of queues of the memory-mapped bus device and initializes the interrupt resources; the number of queues is multiple;
获得客户机内核针对所述内存映射总线设备配置的消息信号中断(msi)消息的信息;Obtaining information about the message signal interrupt (msi) message configured by the client kernel for the memory mapped bus device;
将所述配置的消息信号中断消息的信息提供给虚拟机管理程序。The information of the configured message signal interruption message is provided to the hypervisor.
需要说明的是,对于本申请第五实施例提供的存储设备的详细描述可以参考对本申请第一实施例的相关描述,这里不再赘述。It should be noted that, for a detailed description of the storage device provided in the fifth embodiment of the present application, reference may be made to the related description of the first embodiment of the present application, and details are not repeated here.
与本申请第二实施例提供的一种实现消息信号中断的方法相对应的,本申请第六实施例还提供了一种实现消息信号中断的装置。所述装置包括:Corresponding to the method for implementing message signal interruption provided by the second embodiment of the present application, the sixth embodiment of the present application also provides a device for implementing message signal interruption. The device includes:
中断消息分配单元,用于客户机内核对内存映射总线设备进行初始化操作时,根据所述内存映射总线设备的队列数量为每个队列分配对应的消息信号中断消息和中断号;所述队列数量为多个;The interrupt message distribution unit is used for when the client kernel initializes the memory-mapped bus device, allocates a corresponding message signal interrupt message and interrupt number to each queue according to the number of queues of the memory-mapped bus device; the number of queues is Multiple
中断消息配置单元,用于针对每个队列配置消息信号中断消息;The interrupt message configuration unit is used to configure the message signal interrupt message for each queue;
配置信息提供单元,用于将针对每个队列配置的消息信号中断消息的信息提供给虚拟机监视器;The configuration information providing unit is used to provide the information of the message signal interruption message configured for each queue to the virtual machine monitor;
使能消息信号中断单元,用于针对所述内存映射总线设备使能消息信号中断。The message signal interruption unit is used to enable message signal interruption for the memory mapped bus device.
可选的,所述配置信息提供单元,具体用于:Optionally, the configuration information providing unit is specifically used for:
判断是否成功分配了消息信号中断消息和中断号,若是,将针对每个队列配置的消息信号中断消息的信息提供给虚拟机监视器;Determine whether the message signal interruption message and the interrupt number are successfully allocated, and if so, provide the information of the message signal interruption message configured for each queue to the virtual machine monitor;
若否,对所述内存映射总线设备进行单中断配置。If not, perform a single interrupt configuration on the memory mapped bus device.
可选的,所述配置信息提供单元,具体用于:Optionally, the configuration information providing unit is specifically used for:
将针对每个队列配置的消息信号中断消息的信息的地址存储到预定义的用于存储消息信号中断消息的信息的地址的地址寄存器中,以供虚拟机监视器从所述地址寄存器中获得消息信号中断消息的信息的地址并根据地址获得消息信号中断消息的信息。The address of the message signal interrupt message information configured for each queue is stored in a predefined address register for storing the address of the message signal interrupt message information, so that the virtual machine monitor can obtain the message from the address register Signal the address of the information of the signal interruption message and obtain the information of the message signal interruption message according to the address.
可选的,所述装置还包括:Optionally, the device further includes:
队列数量获得单元,用于获得所述内存映射总线设备的队列数量。The queue quantity obtaining unit is used to obtain the queue quantity of the memory mapped bus device.
可选的,所述队列数量获得单元具体用于:Optionally, the queue quantity obtaining unit is specifically configured to:
获得虚拟机监视器通过虚拟传输协议写入用于存储所述内存映射总线设备的队列数 量的内存空间;Obtain the memory space written by the virtual machine monitor to store the number of queues of the memory mapped bus device through the virtual transfer protocol;
通过虚拟传输协议从所述内存空间中读取所述虚拟存储器映射输入/输出。The virtual memory mapped input/output is read from the memory space through a virtual transfer protocol.
需要说明的是,对于本申请第六实施例提供的装置的详细描述可以参考对本申请第二实施例的相关描述,这里不再赘述。It should be noted that, for a detailed description of the device provided in the sixth embodiment of the present application, reference may be made to the related description of the second embodiment of the present application, which is not repeated here.
与本申请第二实施例提供的一种实现消息信号中断的方法相对应的,本申请第七实施例还提供了一种电子设备,包括:Corresponding to the method for realizing message signal interruption provided by the second embodiment of the present application, the seventh embodiment of the present application also provides an electronic device, including:
处理器;以及Processor; and
存储器,用于存储实现消息信号中断的方法的程序,该设备通电并通过所述处理器运行该实现消息信号中断的方法的程序后,执行下述步骤:The memory is used to store a program for implementing the method for interrupting a message signal. After the device is powered on and running the program for implementing the method for interrupting a message signal through the processor, the following steps are executed:
客户机内核对内存映射总线设备进行初始化操作时,根据所述内存映射总线设备的队列数量为每个队列分配对应的消息信号中断消息和中断号;所述队列数量为多个;When the client kernel initializes the memory-mapped bus device, it allocates a corresponding message signal interrupt message and interrupt number to each queue according to the number of queues of the memory-mapped bus device; the number of queues is multiple;
针对每个队列配置消息信号中断消息;Configure the message signal interrupt message for each queue;
将针对每个队列配置的消息信号中断消息的信息提供给虚拟机监视器;Provide the information of the message signal interruption message configured for each queue to the virtual machine monitor;
针对所述内存映射总线设备使能消息信号中断。Enable message signal interruption for the memory mapped bus device.
可选的,所述将针对每个队列配置的消息信号中断消息的信息提供给虚拟机监视器,包括:Optionally, the provision of information about the message signal interruption message configured for each queue to the virtual machine monitor includes:
判断是否成功分配了消息信号中断消息和中断号,若是,将针对每个队列配置的消息信号中断消息的信息提供给虚拟机监视器;Determine whether the message signal interruption message and the interrupt number are successfully allocated, and if so, provide the information of the message signal interruption message configured for each queue to the virtual machine monitor;
若否,对所述内存映射总线设备进行单中断配置。If not, perform a single interrupt configuration on the memory mapped bus device.
可选的,所述将针对每个队列配置的消息信号中断消息的信息提供给虚拟机监视器,包括:Optionally, the provision of information about the message signal interruption message configured for each queue to the virtual machine monitor includes:
将针对每个队列配置的消息信号中断消息的信息的地址存储到预定义的用于存储消息信号中断消息的信息的地址的地址寄存器中,以供虚拟机监视器从所述地址寄存器中获得消息信号中断消息的信息的地址并根据地址获得消息信号中断消息的信息。The address of the message signal interrupt message information configured for each queue is stored in a predefined address register for storing the address of the message signal interrupt message information, so that the virtual machine monitor can obtain the message from the address register Signal the address of the information of the signal interruption message and obtain the information of the message signal interruption message according to the address.
可选的,所述电子设备还执行下述步骤:Optionally, the electronic device further executes the following steps:
获得所述内存映射总线设备的队列数量。Obtain the number of queues of the memory mapped bus device.
可选的,所述获得所述内存映射总线设备的队列数量,包括:Optionally, the obtaining the number of queues of the memory mapped bus device includes:
获得虚拟机监视器通过虚拟传输协议写入用于存储所述内存映射总线设备的队列数量的内存空间;Obtain the memory space written by the virtual machine monitor to store the number of queues of the memory mapped bus device through the virtual transfer protocol;
通过虚拟传输协议从所述内存空间中读取所述虚拟存储器映射输入/输出。The virtual memory mapped input/output is read from the memory space through a virtual transfer protocol.
需要说明的是,对于本申请第七实施例提供的电子设备的详细描述可以参考对本申请第二实施例的相关描述,这里不再赘述。It should be noted that, for the detailed description of the electronic device provided in the seventh embodiment of the present application, reference may be made to the related description of the second embodiment of the present application, which will not be repeated here.
与本申请第二实施例提供的一种实现消息信号中断的方法相对应的,本申请第八实施例还提供了一种存储设备,存储有实现消息信号中断的方法的程序,该程序被处理器运行,执行下述步骤:Corresponding to the method for implementing message signal interruption provided by the second embodiment of the present application, the eighth embodiment of the present application also provides a storage device that stores a program for implementing the method for message signal interruption, and the program is processed When the device is running, perform the following steps:
客户机内核对内存映射总线设备进行初始化操作时,根据所述内存映射总线设备的队列数量为每个队列分配对应的消息信号中断消息和中断号;所述队列数量为多个;When the client kernel initializes the memory-mapped bus device, it allocates a corresponding message signal interrupt message and interrupt number to each queue according to the number of queues of the memory-mapped bus device; the number of queues is multiple;
针对每个队列配置消息信号中断消息;Configure the message signal interrupt message for each queue;
将针对每个队列配置的消息信号中断消息的信息提供给虚拟机监视器;Provide the information of the message signal interruption message configured for each queue to the virtual machine monitor;
针对所述内存映射总线设备使能消息信号中断。Enable message signal interruption for the memory mapped bus device.
需要说明的是,对于本申请第八实施例提供的存储设备的详细描述可以参考对本申请第二实施例的相关描述,这里不再赘述。It should be noted that, for the detailed description of the storage device provided in the eighth embodiment of the present application, reference may be made to the related description of the second embodiment of the present application, which will not be repeated here.
本申请第九实施例提供一种针对事件处理的无服务器处理方法,包括:The ninth embodiment of the present application provides a serverless processing method for event processing, including:
接收用户触发的事件信息;Receive event information triggered by the user;
调用函数计算处理所述事件信息,获得所述事件信息的处理结果,其中,所述函数计算采用第一实施例和第二实施例提供的方法实现;Calling a function to calculate and process the event information to obtain a processing result of the event information, wherein the function calculation is implemented using the methods provided in the first embodiment and the second embodiment;
将所述处理结果返回给用户。The processing result is returned to the user.
下面结合图5进行详细说明。在图5中,用户通过手机终端、Web应用、或者PC工具把各种文件包括图片、视频以及文本等上传到OSS(对象存储)后,利用OSS的PutObject事件可以触发函数计算对上传后的文件进行处理。The detailed description will be given below in conjunction with FIG. 5. In Figure 5, after the user uploads various files including pictures, videos, and texts to OSS (Object Storage) through mobile terminals, Web applications, or PC tools, the PutObject event of OSS can be used to trigger function calculations to upload files. To process.
采用图5的典型场景包括,当用户把视频文件上传到OSS后,触发函数计算把对象的Meta信息获取并传输给核心算法库,核心算法库根据算法把相应的视频文件推送CDN源站,达到特定视频热加载的处理。另外一个场景,视频文件上传到OSS后也同时触发函数计算同步做多转码率的处理,并把处理后的视频文件存储到OSS中,完成轻量的数据处理。The typical scenario using Figure 5 includes that when a user uploads a video file to OSS, a function calculation is triggered to obtain and transmit the object's Meta information to the core algorithm library. The core algorithm library pushes the corresponding video file to the CDN source station according to the algorithm. The processing of specific video hot loading. In another scenario, after the video file is uploaded to the OSS, the function calculation is also triggered to perform multi-transcoding rate processing simultaneously, and the processed video file is stored in the OSS to complete light-weight data processing.
图5中的函数计算利用本申请第一实施例提供的方法,利用无服务器计算实现。The function calculation in FIG. 5 uses the method provided in the first embodiment of the present application and is implemented by serverless computing.
本申请第十实施例提供一种利用弹性扩容的无服务器处理方法,包括:The tenth embodiment of the present application provides a serverless processing method using elastic capacity expansion, including:
接收用户发送的数字内容信息;Receive digital content information sent by users;
调用函数计算对所述数字内容信息进行弹性扩容处理,获得所述数字内容信息的混流结果,其中,所述函数计算采用第一实施例和第二实施例提供的方法实现;Calling function calculation to perform elastic expansion processing on the digital content information to obtain a mixed flow result of the digital content information, wherein the function calculation is implemented using the methods provided in the first embodiment and the second embodiment;
将所述混流结果发送给终端用户。下面结合图6进行详细说明。在图6中,直播间的客户端把主播和连麦观众的音视频采集发送给函数计算做混流服务,函数计算把数据汇集后交给混流服务进行合成,并把合成画面视频流推送给CDN,终端观众实时拉取直播流,能实时看到混流合成画面。Send the mixed streaming result to the end user. The detailed description will be given below in conjunction with FIG. 6. In Figure 6, the client in the live broadcast room sends the audio and video collections of the anchor and the Lianmai audience to the function calculation to make the mixed streaming service. The function calculation collects the data and submits it to the mixed streaming service for synthesis, and pushes the composite screen video stream to the CDN , The terminal audience pulls the live stream in real time, and can see the mixed stream composite picture in real time.
视频直播应用场景中,有一种场景视频直播的多人连麦,主播可以同时和多个工作进行连麦,把多个观众或者好友画面接入,并把画面合成到一个场景中,供给更多观看直播的观众观看。In the video live broadcast application scenario, there is a scene where multiple people connect to the microphone. The host can connect to multiple jobs at the same time, connect multiple viewers or friends, and synthesize the images into one scene to provide more The audience watching the live broadcast.
图6中的函数计算利用本申请第一实施例提供的方法,利用无服务器计算实现。The function calculation in FIG. 6 uses the method provided in the first embodiment of the present application and is implemented by serverless computing.
函数计算作为连麦观众和主播接入的实时音频和视频转发集群,当并发量过来时,函数计算自动扩容多个执行环境来处理实时数据流;当业务高峰期过去后,会适度缩减资源使用。Function computing is used as a real-time audio and video forwarding cluster connected by MIC audiences and anchors. When the amount of concurrency comes, function computing automatically expands multiple execution environments to process real-time data streams; when the business peak period has passed, it will moderately reduce resource usage .
本申请第十一实施例提供一种针对物联网数据的无服务器处理方法,包括:The eleventh embodiment of the present application provides a serverless processing method for IoT data, including:
接收设备发送的物联网数据;Receive IoT data sent by the device;
调用函数计算处理所述物联网数据,获得所述物联网数据的处理结果,其中,所述函数计算采用本申请第一实施例和第二实施例提供的方法实现;Calling a function to calculate and process the Internet of Things data to obtain a processing result of the Internet of Things data, where the function calculation is implemented using the methods provided in the first embodiment and the second embodiment of the present application;
将所述处理结果返回给用户。The processing result is returned to the user.
下面结合图7进行详细说明。在图7可以分成2部分内容:A detailed description will be given below in conjunction with FIG. 7. In Figure 7 can be divided into 2 parts:
Web应用:模拟一个社交内容更新和数据处理的流程,Web用户通过API网关把请求转发到函数计算进行处理,函数计算把处理后的内容更新到数据库中,并更新索引,另外一个函数计算把索引更新推送的搜索引擎供给外部客户进行检索,完成整个数据闭环处理。Web application: Simulate a process of social content update and data processing. Web users forward the request to the function calculation through the API gateway for processing. The function calculation updates the processed content to the database and updates the index. Another function calculates the index. The updated search engine provides external customers for retrieval and completes the entire closed-loop data processing.
智能设备:通过IoT(物联网)网关把设备状态推送到函数计算处理,函数计算通过API接口把消息通过移动推送服务,推送给移动端进行状态确认和管理。Smart devices: Push the device status to the function calculation process through the IoT (Internet of Things) gateway, and the function calculation pushes the message through the mobile push service through the API interface to the mobile terminal for status confirmation and management.
图7中的函数计算利用本申请第一实施例和第二实施例提供的方法,利用无服务器计算实现。The function calculation in FIG. 7 uses the methods provided in the first embodiment and the second embodiment of this application, and is implemented by serverless computing.
本申请虽然以较佳实施例公开如上,但其并不是用来限定本申请,任何本领域技术人员在不脱离本申请的精神和范围内,都可以做出可能的变动和修改,因此本申请的保 护范围应当以本申请权利要求所界定的范围为准。Although this application is disclosed as above in preferred embodiments, it is not intended to limit the application. Any person skilled in the art can make possible changes and modifications without departing from the spirit and scope of the application. Therefore, this application The scope of protection shall be subject to the scope defined by the claims of this application.
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、存储器映射输入/输出接口、网络接口和内存。In a typical configuration, the computing device includes one or more processors (CPUs), memory-mapped input/output interfaces, network interfaces, and memory.
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。The memory may include non-permanent memory in a computer readable medium, random access memory (RAM) and/or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM). Memory is an example of computer readable media.
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括非暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer-readable media include permanent and non-permanent, removable and non-removable media, and information storage can be realized by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, CD-ROM, digital versatile disc (DVD) or other optical storage, Magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media can be used to store information that can be accessed by computing devices. According to the definition in this article, computer-readable media does not include non-transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.
本领域技术人员应明白,本申请的实施例可提供为方法、系统或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, this application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

Claims (15)

  1. 一种实现消息信号中断的方法,其特征在于,包括:A method for realizing message signal interruption, which is characterized in that it includes:
    虚拟机监视器在初始化时根据内存映射总线设备的队列数量分配中断资源并初始化所述中断资源;所述队列数量为多个;During initialization, the virtual machine monitor allocates interrupt resources according to the number of queues of the memory-mapped bus device and initializes the interrupt resources; the number of queues is multiple;
    获得客户机内核针对所述内存映射总线设备配置的消息信号中断(msi)消息的信息;Obtaining information about the message signal interrupt (msi) message configured by the client kernel for the memory mapped bus device;
    将所述配置的消息信号中断消息的信息提供给虚拟机管理程序。The information of the configured message signal interruption message is provided to the hypervisor.
  2. 根据权利要求1所述的方法,其特征在于,所述获得客户机内核针对所述内存映射总线设备配置的消息信号中断消息的信息,包括:The method according to claim 1, wherein the obtaining information about the message signal interrupt message configured by the client kernel for the memory mapped bus device comprises:
    从预定义的地址寄存器中获得消息信号中断消息的信息的地址信息;其中,所述地址寄存器用于存储所述消息信号中断消息的信息的地址;Obtain the address information of the information of the message signal interruption message from a predefined address register; wherein the address register is used to store the address of the information of the message signal interruption message;
    根据获得的消息信号中断消息的信息的地址信息,得到客户机内核针对所述内存映射总线设备配置的信号中断消息的信息。According to the obtained address information of the information of the message signal interrupt message, the information of the signal interrupt message configured by the client kernel for the memory mapped bus device is obtained.
  3. 根据权利要求1所述的方法,其特征在于,所述将所述配置的消息信号中断消息的信息提供给虚拟机管理程序,包括:The method according to claim 1, wherein the providing information of the configured message signal interruption message to a hypervisor comprises:
    将获得的客户机内核针对所述内存映射总线设备配置的消息信号中断消息的信息保存在本地缓存中;Saving the obtained information of the message signal interrupt message configured by the client kernel for the memory mapped bus device in a local cache;
    获得消息信号中断使能标识信息;Obtain the message signal interrupt enable identification information;
    根据所述消息信号中断使能标识信息判断是否使能消息信号中断,当判断的结果为是时,将存储在本地缓存中的消息信号中断消息的信息提供给虚拟机管理程序。It is determined whether to enable the message signal interruption according to the message signal interruption enable identification information, and when the result of the determination is yes, the information of the message signal interruption message stored in the local cache is provided to the hypervisor.
  4. 根据权利要求3所述的方法,其特征在于,还包括:The method according to claim 3, further comprising:
    当判断的结果为否时,返回到获得客户机内核针对所述内存映射总线设备配置的消息信号中断消息的信息的步骤。When the result of the judgment is no, return to the step of obtaining information about the message signal interrupt message configured by the client kernel for the memory mapped bus device.
  5. 一种实现消息信号中断的方法,其特征在于,包括:A method for realizing message signal interruption, which is characterized in that it includes:
    客户机内核对内存映射总线设备进行初始化操作时,根据所述内存映射总线设备的队列数量为每个队列分配对应的消息信号中断消息和中断号;所述队列数量为多个;When the client kernel initializes the memory-mapped bus device, it allocates a corresponding message signal interrupt message and interrupt number to each queue according to the number of queues of the memory-mapped bus device; the number of queues is multiple;
    针对每个队列配置消息信号中断消息;Configure the message signal interrupt message for each queue;
    将针对每个队列配置的消息信号中断消息的信息提供给虚拟机监视器;Provide the information of the message signal interruption message configured for each queue to the virtual machine monitor;
    针对所述内存映射总线设备使能消息信号中断。Enable message signal interruption for the memory mapped bus device.
  6. 根据权利要求5所述的方法,其特征在于,所述将针对每个队列配置的消息信号 中断消息的信息提供给虚拟机监视器,包括:The method according to claim 5, wherein the providing information of the message signal interrupt message configured for each queue to the virtual machine monitor comprises:
    判断是否成功分配了消息信号中断消息和中断号,若是,将针对每个队列配置的消息信号中断消息的信息提供给虚拟机监视器;Determine whether the message signal interruption message and the interrupt number are successfully allocated, and if so, provide the information of the message signal interruption message configured for each queue to the virtual machine monitor;
    若否,对所述内存映射总线设备进行单中断配置。If not, perform a single interrupt configuration on the memory mapped bus device.
  7. 根据权利要求5或6所述的方法,其特征在于,所述将针对每个队列配置的消息信号中断消息的信息提供给虚拟机监视器,包括:The method according to claim 5 or 6, wherein the providing information of the message signal interruption message configured for each queue to the virtual machine monitor comprises:
    将针对每个队列配置的消息信号中断消息的信息的地址存储到预定义的用于存储消息信号中断消息的信息的地址的地址寄存器中,以供虚拟机监视器从所述地址寄存器中获得消息信号中断消息的信息的地址并根据地址获得消息信号中断消息的信息。The address of the message signal interrupt message information configured for each queue is stored in a predefined address register for storing the address of the message signal interrupt message information, so that the virtual machine monitor can obtain the message from the address register Signal the address of the information of the signal interruption message and obtain the information of the message signal interruption message according to the address.
  8. 根据权利要求5所述的方法,其特征在于,还包括:The method according to claim 5, further comprising:
    获得所述内存映射总线设备的队列数量。Obtain the number of queues of the memory mapped bus device.
  9. 根据权利要求8所述的方法,其特征在于,所述获得所述内存映射总线设备的队列数量,包括:The method according to claim 8, wherein the obtaining the number of queues of the memory mapped bus device comprises:
    获得虚拟机监视器通过虚拟传输协议写入用于存储所述内存映射总线设备的队列数量的内存空间;Obtain the memory space written by the virtual machine monitor to store the number of queues of the memory mapped bus device through the virtual transfer protocol;
    通过虚拟传输协议从所述内存空间中读取所述虚拟存储器映射输入/输出。The virtual memory mapped input/output is read from the memory space through a virtual transfer protocol.
  10. 一种实现消息信号中断的装置,其特征在于,包括:A device for realizing message signal interruption, which is characterized in that it comprises:
    中断资源分配单元,用于虚拟机监视器在初始化时根据内存映射总线设备的队列数量分配中断资源并初始化所述中断资源;所述队列数量为多个;The interrupt resource allocation unit is used to allocate interrupt resources and initialize the interrupt resources according to the number of queues of the memory mapped bus device when the virtual machine monitor is initialized; the number of queues is multiple;
    消息信号中断(msi)消息的信息获得单元,用于获得客户机内核针对所述内存映射总线设备配置的消息信号中断(msi)消息的信息;The message signal interrupt (msi) message information obtaining unit is used to obtain the message signal interrupt (msi) message information configured by the client kernel for the memory mapped bus device;
    信息提供单元,用于将所述配置的消息信号中断消息的信息提供给虚拟机管理程序。The information providing unit is configured to provide the configured message signal interrupt message information to the virtual machine management program.
  11. 一种电子设备,其特征在于,包括:An electronic device, characterized in that it comprises:
    处理器;以及Processor; and
    存储器,用于存储实现消息信号中断的方法的程序,该设备通电并通过所述处理器运行该实现消息信号中断的方法的程序后,执行下述步骤:The memory is used to store a program for implementing the method for interrupting a message signal. After the device is powered on and running the program for implementing the method for interrupting a message signal through the processor, the following steps are executed:
    虚拟机监视器在初始化时根据内存映射总线设备的队列数量分配中断资源并初始化所述中断资源;所述队列数量为多个;During initialization, the virtual machine monitor allocates interrupt resources according to the number of queues of the memory-mapped bus device and initializes the interrupt resources; the number of queues is multiple;
    获得客户机内核针对所述内存映射总线设备配置的消息信号中断(msi)消息的信 息;Obtaining information about the message signal interrupt (msi) message configured by the client kernel for the memory mapped bus device;
    将所述配置的消息信号中断消息的信息提供给虚拟机管理程序。The information of the configured message signal interruption message is provided to the hypervisor.
  12. 一种存储设备,其特征在于,A storage device, characterized in that:
    存储有实现消息信号中断的方法的程序,该程序被处理器运行,执行下述步骤:A program for implementing a method for message signal interruption is stored, and the program is run by the processor to perform the following steps:
    虚拟机监视器在初始化时根据内存映射总线设备的队列数量分配中断资源并初始化所述中断资源;所述队列数量为多个;During initialization, the virtual machine monitor allocates interrupt resources according to the number of queues of the memory-mapped bus device and initializes the interrupt resources; the number of queues is multiple;
    获得客户机内核针对所述内存映射总线设备配置的消息信号中断(msi)消息的信息;Obtaining information about the message signal interrupt (msi) message configured by the client kernel for the memory mapped bus device;
    将所述配置的消息信号中断消息的信息提供给虚拟机管理程序。The information of the configured message signal interruption message is provided to the hypervisor.
  13. 一种针对事件处理的无服务器处理方法,其特征在于,包括:A serverless processing method for event processing, which is characterized in that it includes:
    接收用户触发的事件信息;Receive event information triggered by the user;
    调用函数计算处理所述事件信息,获得所述事件信息的处理结果,其中,所述函数计算采用权利要求1-9中至少一项实现;Calling a function to calculate and process the event information to obtain a processing result of the event information, wherein the function calculation is implemented by using at least one of claims 1-9;
    将所述处理结果返回给用户。The processing result is returned to the user.
  14. 一种利用弹性扩容的无服务器处理方法,其特征在于,包括:A serverless processing method utilizing elastic expansion, which is characterized in that it includes:
    接收用户发送的数字内容信息;Receive digital content information sent by users;
    调用函数计算对所述数字内容信息进行弹性扩容处理,获得所述数字内容信息的混流结果,其中,所述函数计算采用权利要求1-9中至少一项实现;Calling function calculation to perform elastic expansion processing on the digital content information to obtain a mixed flow result of the digital content information, wherein the function calculation is implemented by using at least one of claims 1-9;
    将所述混流结果发送给终端用户。Send the mixed streaming result to the end user.
  15. 一种针对物联网数据的无服务器处理方法,其特征在于,包括:A serverless processing method for Internet of Things data, which is characterized in that it includes:
    接收设备发送的物联网数据;Receive IoT data sent by the device;
    调用函数计算处理所述物联网数据,获得所述物联网数据的处理结果,其中,所述函数计算采用权利要求1-9中至少一项实现;Calling a function to calculate and process the Internet of Things data to obtain a processing result of the Internet of Things data, wherein the function calculation is implemented by using at least one of claims 1-9;
    将所述处理结果返回给用户。The processing result is returned to the user.
PCT/CN2021/079986 2020-03-17 2021-03-10 Message signaled interrupt implementation method, apparatus and device WO2021185135A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010188210.3 2020-03-17
CN202010188210.3A CN113407298A (en) 2020-03-17 2020-03-17 Method, device and equipment for realizing message signal interruption

Publications (1)

Publication Number Publication Date
WO2021185135A1 true WO2021185135A1 (en) 2021-09-23

Family

ID=77677456

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/079986 WO2021185135A1 (en) 2020-03-17 2021-03-10 Message signaled interrupt implementation method, apparatus and device

Country Status (2)

Country Link
CN (1) CN113407298A (en)
WO (1) WO2021185135A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114443527A (en) * 2021-12-30 2022-05-06 苏州浪潮智能科技有限公司 Method and device for realizing conversion from PCIe (peripheral component interface express) to MDIO (management data input output) drive based on work queue
CN117499688A (en) * 2023-12-29 2024-02-02 淘宝(中国)软件有限公司 Method, equipment and storage medium for processing audio and video confluence in live broadcast continuous wheat

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114726657B (en) * 2022-03-21 2024-06-14 京东科技信息技术有限公司 Interrupt management and data receiving and transmitting management method and device and intelligent network card
CN116521324B (en) * 2023-06-30 2024-04-12 深圳中安辰鸿技术有限公司 Interrupt virtualization processing method and device and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6070219A (en) * 1996-10-09 2000-05-30 Intel Corporation Hierarchical interrupt structure for event notification on multi-virtual circuit network interface controller
US20050220128A1 (en) * 2004-04-05 2005-10-06 Ammasso, Inc. System and method for work request queuing for intelligent adapter
CN101876954A (en) * 2009-12-23 2010-11-03 中国科学院计算技术研究所 Virtual machine control system and working method thereof
CN103853597A (en) * 2014-02-21 2014-06-11 北京神舟航天软件技术有限公司 Method for realizing high-frequency data collection of embedded virtual machine platform
CN111737180A (en) * 2020-06-08 2020-10-02 湖北三江航天万峰科技发展有限公司 Serial port driving system based on PCI bus

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7870301B2 (en) * 2005-02-25 2011-01-11 International Business Machines Corporation System and method for modification of virtual adapter resources in a logically partitioned data processing system
US8589613B2 (en) * 2010-06-02 2013-11-19 Intel Corporation Method and system to improve the operations of an integrated non-transparent bridge device
US8806104B2 (en) * 2012-09-25 2014-08-12 Intel Corporation Enabling virtualization of a processor resource
US9830286B2 (en) * 2013-02-14 2017-11-28 Red Hat Israel, Ltd. Event signaling in virtualized systems
CN103984591B (en) * 2014-05-15 2015-04-29 中国人民解放军国防科学技术大学 PCI (Peripheral Component Interconnect) device INTx interruption delivery method for computer virtualization system
CN105700826A (en) * 2015-12-31 2016-06-22 华为技术有限公司 Virtualization method and device
CN108073451B (en) * 2017-12-20 2020-09-22 北京东土科技股份有限公司 Interrupt processing method and device between heterogeneous operating systems on multi-core CPU
CN109062671A (en) * 2018-08-15 2018-12-21 无锡江南计算技术研究所 A kind of high-performance interconnection network software virtual method of lightweight
CN110851239B (en) * 2019-11-15 2023-07-04 湖南智领通信科技有限公司 TYPE-I TYPE hard real-time high-reliability full-virtualization method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6070219A (en) * 1996-10-09 2000-05-30 Intel Corporation Hierarchical interrupt structure for event notification on multi-virtual circuit network interface controller
US20050220128A1 (en) * 2004-04-05 2005-10-06 Ammasso, Inc. System and method for work request queuing for intelligent adapter
CN101876954A (en) * 2009-12-23 2010-11-03 中国科学院计算技术研究所 Virtual machine control system and working method thereof
CN103853597A (en) * 2014-02-21 2014-06-11 北京神舟航天软件技术有限公司 Method for realizing high-frequency data collection of embedded virtual machine platform
CN111737180A (en) * 2020-06-08 2020-10-02 湖北三江航天万峰科技发展有限公司 Serial port driving system based on PCI bus

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114443527A (en) * 2021-12-30 2022-05-06 苏州浪潮智能科技有限公司 Method and device for realizing conversion from PCIe (peripheral component interface express) to MDIO (management data input output) drive based on work queue
CN114443527B (en) * 2021-12-30 2023-08-15 苏州浪潮智能科技有限公司 PCIe-to-MDIO drive realization method and device based on work queue
CN117499688A (en) * 2023-12-29 2024-02-02 淘宝(中国)软件有限公司 Method, equipment and storage medium for processing audio and video confluence in live broadcast continuous wheat
CN117499688B (en) * 2023-12-29 2024-05-03 淘宝(中国)软件有限公司 Method, equipment and storage medium for processing audio and video confluence in live broadcast continuous wheat

Also Published As

Publication number Publication date
CN113407298A (en) 2021-09-17

Similar Documents

Publication Publication Date Title
WO2021185135A1 (en) Message signaled interrupt implementation method, apparatus and device
JP6384877B2 (en) Streaming server session idle optimization
CN110235104B (en) Graphics processing unit partitioning for virtualization
US10298721B2 (en) Method and system to determine a work distribution model for an application deployed on a cloud
EP2162827B1 (en) Interfaces for digital media processing
US20160314008A1 (en) Method for implementing gpu virtualization and related apparatus, and system
CN113467958B (en) Data processing method, device, equipment and readable storage medium
CN113767641B (en) Data stream processing method, device and medium
WO2019127191A1 (en) File system sharing method and apparatus for multi-operating system, and electronic device
TWI482118B (en) System and method for processing load balance of graphic streams
TW201638795A (en) Method and system for scheduling input/output resources of a virtual machine
CN108073350B (en) Object storage system and method for cloud rendering
US20240296151A1 (en) Cloud server application management method, apparatus, device, computer-readable storage medium, and computer program product
US20230405455A1 (en) Method and apparatus for processing cloud gaming resource data, computer device, and storage medium
CN108074210B (en) Object acquisition system and method for cloud rendering
WO2022242358A1 (en) Image processing method and apparatus, and computer device and storage medium
CN110750221B (en) Volume cloning method, apparatus, electronic device and machine-readable storage medium
WO2022150080A1 (en) Method and apparatus for media scene description
US20230418783A1 (en) Method and apparatus for media scene description
US11954534B2 (en) Scheduling in a container orchestration system utilizing hardware topology hints
JP2023031248A (en) Edge computing network, data transmission method, apparatus, device, and storage medium
Raj et al. VMedia: enhanced multimedia services in virtualized systems
Repplinger et al. Stream processing on GPUs using distributed multimedia middleware
KR102503119B1 (en) Method and apparatus for tree-based point cloud compressed media stream
Tanaka et al. A case study of a linux grid on windows using virtual machines

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: 21771585

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: 21771585

Country of ref document: EP

Kind code of ref document: A1