WO2022062510A1 - 实现热迁移的设备及方法 - Google Patents

实现热迁移的设备及方法 Download PDF

Info

Publication number
WO2022062510A1
WO2022062510A1 PCT/CN2021/102073 CN2021102073W WO2022062510A1 WO 2022062510 A1 WO2022062510 A1 WO 2022062510A1 CN 2021102073 W CN2021102073 W CN 2021102073W WO 2022062510 A1 WO2022062510 A1 WO 2022062510A1
Authority
WO
WIPO (PCT)
Prior art keywords
identifier
information
data
layer
migrated
Prior art date
Application number
PCT/CN2021/102073
Other languages
English (en)
French (fr)
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
Priority claimed from CN202011045832.7A external-priority patent/CN114281467A/zh
Priority claimed from CN202011043865.8A external-priority patent/CN114281750A/zh
Priority claimed from CN202011043849.9A external-priority patent/CN114328366A/zh
Priority claimed from CN202011043863.9A external-priority patent/CN114281749A/zh
Priority claimed from CN202011045841.6A external-priority patent/CN114281468A/zh
Application filed by 中科寒武纪科技股份有限公司 filed Critical 中科寒武纪科技股份有限公司
Priority to US18/003,689 priority Critical patent/US12067234B2/en
Publication of WO2022062510A1 publication Critical patent/WO2022062510A1/zh

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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F15/00Digital computers in general; Data processing equipment in general
    • G06F15/76Architectures of general purpose stored program computers
    • G06F15/78Architectures of general purpose stored program computers comprising a single central processing unit
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0647Migration mechanisms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]
    • 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
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45579I/O management, e.g. providing access to device drivers or storage

Definitions

  • the present disclosure generally relates to the field of computers. More particularly, the present disclosure relates to an apparatus and method for implementing thermal migration.
  • Live Migration also known as live migration and live migration, means that the virtual machine completely saves the running state of the entire virtual machine through the save (SAVE)/restore (LOAD) program, and migrates from one physical server to another. on a physical server. After recovery, the virtual machine still runs smoothly and the user will not notice any difference.
  • SAVE save
  • LAD restore
  • the solution of the present disclosure provides an apparatus and method for realizing thermal migration.
  • a system for implementing hot migration storage which is connected to the kernel space and includes: a read-only storage device and a serialization device.
  • the read-only storage device stores firmware
  • the firmware includes a physical function, virtualized into a plurality of virtual functions
  • the physical function receives a live migration start request from the kernel space
  • the live migration start request specifies a live migration specific virtual function.
  • the specific virtual function is one of the plurality of virtual functions.
  • the serialization device is used for generating a data structure of the information to be migrated in response to the live migration start request, the data structure includes a protocol layer, and the protocol layer includes a domain identifier for recording the specific virtual function.
  • the physical function sends the information to be migrated to the kernel space.
  • a system for implementing hot migration recovery connected to the kernel space, and comprising: a read-only storage device and a deserialization device.
  • the read-only storage device stores firmware, the firmware includes a physical function, virtualized into a plurality of virtual functions, the physical function receives information to be migrated, the data structure of the information to be migrated includes a protocol layer, and the protocol layer includes a domain identifier.
  • the deserialization device is used for: extracting information of a specific virtual function from the domain identifier, the specific virtual function is one of the plurality of virtual functions; and restoring the to-be-migrated information to the specific virtual function middle.
  • a method for hot-migrating a save path for a system is provided, the system is connected to a kernel space and includes a read-only storage device, the read-only storage device stores firmware, the firmware includes a physical function, the physical function is virtualized into multiple virtual functions, and the method includes: receiving a live migration start request, the live migration start request specifying a live migration specific virtual function, and the specific virtual function is the multiple virtual functions One of: generating a data structure of the information to be migrated, the data structure including a domain identifier for recording the specific virtual function; and sending the information to be migrated to the kernel space.
  • a method of hot-migrating a recovery path for a system the system being connected to kernel space and including a read-only storage device storing firmware, the firmware including physical
  • the physical function is virtualized into a plurality of virtual functions, and the method includes: receiving information to be migrated, the data structure of the information to be migrated includes a domain identifier; extracting information of a specific virtual function from the domain identifier , the specific virtual function is one of the plurality of virtual functions; and the information to be migrated is restored to the specific virtual function.
  • a system for implementing hot migration storage comprising a serialization device for: responding to a hot migration start request to generate a data structure of information to be migrated, where the information to be migrated includes a structure; A symbol identifier is generated in the data structure to mark the structure; and a prefix symbol and the name of the structure are placed in the symbol identifier.
  • a system for implementing hot migration recovery comprising: a read-only storage device and a deserialization device.
  • the read-only storage device stores firmware, the firmware includes a physical function, virtualized into a plurality of virtual functions, the physical function receives information to be migrated, the information to be migrated includes a structure, and the data structure of the information to be migrated includes A symbolic identifier to mark the structure, and the symbolic identifier includes a prefix symbol and the name of the structure.
  • the deserialization device is used for identifying the name of the structure according to the prefix symbol.
  • a method for generating a data structure of information to be migrated including: receiving a live migration start request; and generating the data structure in response to the live migration start request, and the information to be migrated includes a structure
  • the step of generating the data structure includes: generating a symbol identifier to mark the structure, the symbol identifier including a prefix symbol and the name of the structure; and sending the information to be migrated.
  • a method for interpreting information to be migrated comprising: receiving the information to be migrated, the information to be migrated includes a structure, the data structure of the information to be migrated includes a symbol identifier, and a to mark the structure, the symbol identifier includes a prefix symbol and the name of the structure; identifies the prefix symbol; and identifies the name of the structure according to the prefix symbol.
  • a system for serializing tree data including: a memory and a serializing device.
  • Memory is used to store the tree data.
  • the serialization device is used for: responding to a hot migration start request to generate information to be migrated, the data structure of the information to be migrated includes a numerical identifier; traversing the tree data in a specific order to form serialized data; and converting the sequence The denaturation data is placed in the numerical identifier.
  • a system for deserializing tree data including a deserializing device and a memory.
  • the deserialization device is used for: receiving information to be migrated, the data structure of the information to be migrated includes a numerical identifier; extracting serialized data from the numerical identifier; and restoring to the tree data in a specific order.
  • Memory is used to store the tree data.
  • a method for serializing tree data comprising: responding to a live migration start request to generate information to be migrated, the data structure of the information to be migrated includes a numerical identifier; traversing the information in a specific order tree data to form serialized data; and placing the serialized data into the numerical identifier.
  • a method for deserializing tree data comprising: receiving information to be migrated, the data structure of the information to be migrated includes a numerical identifier; and extracting serialized data from the numerical identifier ; restore to the tree data in a specific order; and store the tree data to memory.
  • a system for serializing nested data where the nested data includes at least a first-level structure and a second-level structure, and the system includes: a memory and a serialization device.
  • Memory is used to store the nested data.
  • the serialization device is used to generate information to be migrated in response to a hot migration start request, and the data structure of the information to be migrated includes: a data structure layer, including a first symbol identifier, used to record the name of the first layer structure; and the serialization layer, including a second symbol identifier for recording the name of the second layer structure.
  • a system for deserializing nested data where the nested data includes at least a first-level structure and a second-level structure
  • the system includes: a deserialization device and a memory.
  • the deserialization device is used for: receiving information to be migrated, the data structure of the information to be migrated includes: a data structure layer, including a first symbol identifier; and a serialization layer, including a second symbol identifier; according to the first symbol extracting the first serialized data by the identifier; extracting the second serialized data according to the second symbol identifier; restoring the first serialized data into the first layer structure; and serializing the second Data is restored to the second level structure.
  • the memory is used for storing the first layer structure and the second layer structure.
  • a method for serializing nested data where the nested data includes at least a first-level structure and a second-level structure, and the method includes: in response to a warm migration start request, generating information to be migrated, the step of generating the information to be migrated includes: generating a first symbol identifier in the data structure layer of the information to be migrated, to record the name of the first layer structure; and A second symbol identifier is generated in the serialization layer of the migration information to record the name of the second layer structure.
  • a method for deserializing nested data where the nested data at least includes a first-level structure and a second-level structure
  • the method includes: receiving information to be migrated;
  • the data structure of the information to be migrated includes: a data structure layer, including a first symbol identifier; and a serialization layer, including a second symbol identifier; fetching the first serialized data according to the first symbol identifier;
  • the second symbolic identifier retrieves the second serialized data; restores the first serialized data into the first-level structure; restores the second serialized data into the second-level structure; and stores the first layer structure and the second layer structure.
  • a system for serializing logical pointers including: a memory and a serializing device.
  • the memory is used for storing the first structure and the second structure.
  • the serialization device is used for: generating information to be migrated in response to a warm migration start request; generating a first symbol identifier and a first entity identifier in the data structure of the information to be migrated; setting the first symbol identifier in the inserting the name of the first structure; and inserting the name of the logical pointer into the first entity identifier, where the name of the logical pointer is the name of the second structure.
  • a system for deserializing logical pointers including a deserializing device for: receiving information to be migrated, the data structure of the information to be migrated includes a first symbol identifier and a first entity identifier; extract the name of the first structure from the first symbolic identifier; and extract the name of the second structure from the first entity identifier.
  • a method for serializing a logical pointer where the logical pointer associates a first structure with a second structure, the method comprising: responding to a warm migration start request to generate information to be migrated ; generate a first symbolic identifier and a first entity identifier in the data structure of the information to be migrated; insert the name of the first structure into the first symbolic identifier; and in the first symbolic identifier The name of the second structure is placed in the entity identifier.
  • a method for deserializing a logical pointer comprising: receiving information to be migrated, the data structure of the information to be migrated includes a first symbol identifier and a first entity identifier; The name of the first structure is extracted from the first symbolic identifier; and the name of the second structure is extracted from the first entity identifier.
  • the present disclosure can realize the serialization of the information on the source server, and the deserialization of the information on the destination server, so as to achieve the technical effect of hot migration.
  • FIG. 1 is a schematic diagram illustrating an artificial intelligence chip framework according to an embodiment of the present disclosure
  • FIG. 2 is a schematic diagram illustrating an internal structure of a computing device according to an embodiment of the present disclosure
  • FIG. 3 is a flowchart of a migration saving path according to an embodiment of the present disclosure
  • FIG. 4 is a schematic diagram illustrating a migration and storage path performed by an origin server according to an embodiment of the present disclosure
  • Fig. 5 is the data structure diagram showing the information to be migrated
  • FIG. 6 is a schematic diagram illustrating a structure at a data structure layer according to an embodiment of the present disclosure
  • FIG. 7 is exemplary tree data illustrating an embodiment of the present disclosure.
  • FIG. 8 is a diagram illustrating serialized data obtained when traversing tree data according to an embodiment of the present disclosure
  • Fig. 9 is the data structure that is generated when showing nested data serialization
  • FIG. 10 is a schematic diagram illustrating that a serialization device serializes a structure including a logical pointer into information to be migrated;
  • 11 is a flowchart illustrating a data structure for generating information to be migrated
  • FIG. 12 is a flowchart illustrating a data structure for generating information to be migrated
  • FIG. 13 is a flowchart illustrating serializing tree data according to an embodiment of the present disclosure
  • FIG. 14 is a flowchart illustrating the generation of information to be migrated according to an embodiment of the present disclosure
  • FIG. 15 is a flowchart illustrating serialization of logical pointers according to an embodiment of the present disclosure
  • 16 is a flowchart illustrating a migration recovery path of an embodiment of the present disclosure
  • FIG. 17 is a schematic diagram illustrating a migration recovery path performed by a destination server in an embodiment of the present disclosure
  • FIG. 18 is a flowchart illustrating that a deserialization apparatus according to an embodiment of the present disclosure implements a hot migration recovery path
  • FIG. 19 is a flowchart illustrating a deserialization protocol layer of a deserialization apparatus according to an embodiment of the present disclosure
  • 20 is a flowchart illustrating deserialization configuration information of an embodiment of the present disclosure
  • 21 is a flowchart illustrating deserialized data information of an embodiment of the present disclosure.
  • FIG. 22 is a flowchart illustrating identifying or retrieving information of a serialization layer according to an embodiment of the present disclosure
  • 24 is a flowchart illustrating deserializing nested data of an embodiment of the present disclosure
  • 25 is a schematic diagram illustrating nested data of an embodiment of the present disclosure.
  • FIG. 26 is a flowchart illustrating an embodiment of the present disclosure identifying or retrieving information of a second-layer structure
  • FIG. 27 is a flowchart illustrating deserialization of logical pointers of an embodiment of the present disclosure
  • FIG. 28 is a block diagram illustrating an integrated circuit device of an embodiment of the present disclosure.
  • 29 is a schematic diagram illustrating a board of an embodiment of the present disclosure.
  • the term “if” may be contextually interpreted as “when” or “once” or “in response to determining” or “in response to detecting”.
  • the present disclosure relates to a framework using virtualization technology, which is applied on an application-specific integrated circuit, such as a machine learning device for neural networks, where the machine learning device can be a convolutional neural network accelerator.
  • an application-specific integrated circuit such as a machine learning device for neural networks
  • the machine learning device can be a convolutional neural network accelerator.
  • the following will take an example of an artificial intelligence chip.
  • FIG. 1 is a framework diagram of artificial intelligence chip virtualization.
  • the framework 100 includes a user space 102, a kernel space 104, and a system-on-chip 106, which are separated by dotted lines on the diagram.
  • the user space 102 is the running space of the user program. It only executes simple operations and cannot directly call system resources. Instructions can be issued to the kernel space 104 only through a system interface.
  • the kernel space 104 is the space where the kernel code runs, and can execute arbitrary commands and call all resources of the system.
  • the system-on-chip 106 is each module of the artificial intelligence chip, and cooperates with the user space 102 through the kernel space 104 .
  • the hardware of the user space 102 is collectively referred to as a device or a device, and the hardware of the system-on-chip 106 is collectively referred to as a device or a unit, as a distinction.
  • a device or a device the hardware of the system-on-chip 106 is collectively referred to as a device or a unit, as a distinction.
  • Such an arrangement is only for describing the technology of this embodiment more clearly, and does not impose any limitation on the technology of the present disclosure.
  • this embodiment is exemplified by virtualizing one physical part into four virtual parts, but the present disclosure does not limit the number of virtual parts.
  • the user space 102 is controlled by the hardware monitor tool 108 before the virtualization is executed, and the information of the system-on-chip 106 is obtained by calling the interface.
  • the hardware monitor tool 108 can not only collect the information of the SoC 106, but also can obtain the overhead of the upper-layer software on the SoC 106 resources in real time, so as to grasp the detailed information and status of the current SoC 106 for the user in real time. These detailed information and status can be: Dozens of data such as hardware device model, firmware version number, driver version number, device utilization, storage device overhead status, board power consumption and board peak power consumption, and Peripheral Component Interconnect Express (PCIe). Based on different versions and usage scenarios of the hardware monitor tool 108, the content and quantity of the monitored information will vary.
  • PCIe Peripheral Component Interconnect Express
  • the user virtual machine 110 is an abstraction and simulation of the real computing environment.
  • the system will allocate a set of data structures to manage the state of the user virtual machine 110. Its data structures include a full set of registers, the usage of physical memory, the state of virtual devices, and more.
  • the physical space of the user space 102 in this embodiment is virtualized into four virtual spaces 112 , 114 , 116 , and 118 .
  • the four virtual spaces 112 , 114 , 116 , and 118 are independent and do not affect each other, and can carry different guest operating systems respectively.
  • the guest operating system can be Windows, Linux, Unix, iOS, Android, etc. Run different applications.
  • the user virtual machine 110 is implemented as a Express Emulator (QEMU).
  • QEMU is an open source virtualization software written in C language. It virtualizes the interface through dynamic binary conversion and provides a series of hardware models, making guest operating system 1, guest operating system 2, guest operating system 3, guest operating system 4 Both consider themselves directly accessing the system-on-chip 106 .
  • the user space 102 includes processors, memory, I/O devices, etc.
  • QEMU can virtualize the processors of the user space 102 into four virtual processors, virtualize the memory into four virtual memories, and also virtualize the I/O devices.
  • the virtualization is four virtual I/O devices.
  • Each guest operating system occupies a part of the resources of the user space 102, for example, each occupies a quarter, that is, each guest operating system can access a virtual processor, a virtual memory and a virtual I/O device to execute the functions of the guest operating system. Task. Through this mode, guest operating system 1, guest operating system 2, guest operating system 3, and guest operating system 4 can operate independently.
  • the kernel space 104 carries a kernel virtual machine 120 and a chip driver 122 .
  • the kernel virtual machine 120 is collocated with QEMU, and is mainly responsible for the virtualization of the kernel space 104 and the SoC 106 , so that each guest operating system can obtain its own address space when accessing the SoC 106 .
  • the space on the system-on-chip 106 that is mapped to the guest operating system is actually a virtual component that is mapped to this process.
  • the kernel virtual machine 120 includes a physical function driver, which is a driver specialized in managing the global functions of the SR-IOV device, and generally requires a higher authority than a common virtual machine to operate it.
  • the physical function driver contains all the functions of a traditional driver, enabling user space 102 to access the I/O resources of the system on chip 106 .
  • QEMU From the perspective of the user virtual machine 110, during the running of the virtual machine, QEMU performs kernel settings through the system call interface provided by the kernel virtual machine 120. QEMU uses the virtualization function of the kernel virtual machine 120 to provide hardware for its own virtual machine Virtualization acceleration to improve the performance of virtual machines. From the perspective of the kernel virtual machine 120 , when the user cannot directly interact with the kernel space 104 , the management tool of the user space 102 needs to be used, so it is necessary to use QEMU, a tool running in the user space 102 .
  • the chip driver 122 is used to drive the physical function (PF) 126.
  • PF physical function
  • the user space 102 does not access the on-chip system 106 by the hardware monitor tool 108 through the chip driver 122. Therefore, the guest operating system 1, the guest The operating system 2 , the guest operating system 3 , and the guest operating system 4 are respectively configured with a client kernel space 124 for loading the chip driver 122 , so that each guest operating system can still drive the SoC 106 .
  • the system-on-chip 106 is virtualized through single root I/O virtualization (SR-IOV) technology.
  • SR-IOV single root I/O virtualization
  • the components of the system-on-chip 106 are virtualized.
  • SR-IOV technology is a virtualization solution that allows efficient sharing of PCIe resources among virtual machines.
  • SR-IOV technology enables a single PCIe resource to be shared by multiple virtual components of the system-on-chip 106, providing dedicated resources for these virtual components . In this way, each virtual component has its own corresponding uniquely accessible resource.
  • the system-on-chip 106 of this embodiment includes hardware and firmware.
  • the hardware includes a read-only storage device ROM (not shown) for storing firmware
  • the firmware includes a physical function 126 for supporting or cooperating with the PCIe functions of SR-IOV, which has the power to fully configure the PCIe resources .
  • the physical function 126 is virtualized into a plurality of virtual functions (VFs) 128 , four virtual functions 128 in this embodiment.
  • Virtual function 128 is a lightweight PCIe function that is managed by physical function 126 and may share PCIe physical resources with physical function 126 and other virtual functions 128 associated with the same physical function 126 .
  • the virtual function 128 only allows control of the resources that the physical function 126 configures to itself.
  • each virtual function 128 can access its own PCIe configuration space through its own bus, device and function numbers.
  • Each virtual function 128 has a memory space for mapping its register set.
  • the virtual function 128 driver operates on the set of registers to enable its functions and is directly assigned to the corresponding user virtual machine 110 . Although it is virtual, it makes the user virtual machine 110 think that it is an actual PCIe device.
  • the hardware of the system-on-chip 106 further includes a computing device 130 , a video encoding and decoding device 132 , a JPEG encoding and decoding device 134 , a storage device 136 and a PCIe 138 .
  • the computing device 130 is an intelligent processing unit (IPU), which is used to perform the convolution calculation of the neural network; the video encoding and decoding device 132 is used for encoding and decoding the video data; the JPEG encoding and decoding device 134 In order to encode and decode the static picture that adopts JPEG algorithm;
  • the storage device 136 can be dynamic random access memory (DRAM), in order to store data;
  • PCIe 138 is the aforementioned PCIe, during the virtual machine running, PCIe 138 will virtual Converted into four virtual interfaces 140, the virtual function 128 and the virtual interface 140 have a one-to-one correspondence, that is, the first virtual function is connected to the first virtual interface, the second virtual function is connected to the second virtual interface, and so on.
  • the computing device 130 is virtualized into four virtual computing devices 142
  • the video codec device 132 is virtualized into four virtual video codec devices 144
  • the JPEG codec device 134 is virtualized into four virtual JPEG devices
  • the codec device 146 virtualizes the storage device 136 into four virtual storage devices 148 .
  • Each guest operating system is configured with a set of virtual packages, each set of virtual packages includes a user virtual machine 110, a virtual interface 140, a virtual function 128, a virtual computing device 142, a virtual video codec device 144, and a virtual JPEG Codec device 146 and a virtual storage device 148 .
  • Each group of virtual packages runs independently without affecting each other, and is used to execute the tasks delivered by the corresponding guest operating system, so as to ensure that each guest operating system can access the configured virtual interface through the configured virtual interface 140 and the virtual function 128.
  • Computing device 142 , virtual video codec device 144 , virtual JPEG codec device 146 , and virtual storage device 148 .
  • the response to the task may be different, and the hardware to be accessed may also be different.
  • the guest operating system will configure The virtual interface 140 and virtual function 128 of the guest operating system access the configured virtual computing device 142; if a certain task is to perform video encoding and decoding, the guest operating system will access the configured virtual video through the configured virtual interface 140 and virtual function 128.
  • the encoding and decoding device 144 if a certain task is to perform JPEG encoding and decoding, the guest operating system will access the configured virtual JPEG encoding and decoding device 146 through the configured virtual interface 140 and virtual function 128; if a certain task is to read Or write data, the guest operating system will access the configured virtual storage device 148 through the configured virtual interface 140 and virtual function 128 .
  • FIG. 2 shows a schematic diagram of the internal structure of a multi-core computing device 130 .
  • the computing device 130 has a total of sixteen processing unit cores (processing unit core 0 to processing unit core 15 ) for performing matrix computing tasks, and every four processing unit cores form a processing unit group, that is, a cluster.
  • the processing unit core 0 to the processing unit core 3 form the first cluster 202
  • the processing unit core 4 to the processing unit core 7 form the second cluster 204
  • the processing unit core 8 to the processing unit core 11 form the third cluster 206
  • the processing unit cores 12 to 15 form a fourth cluster 208 .
  • the computing device 130 basically performs computing tasks in a unit of a cluster.
  • the computing device 130 also includes a storage unit core 210 and a shared storage unit 212 .
  • the storage unit core 210 is mainly used to control data exchange, as a communication channel between the computing device 130 and the storage device 136 .
  • the shared storage unit 212 is used to temporarily store the calculation intermediate values of the clusters 202 , 204 , 206 , 208 .
  • the storage unit core 210 is divided into four virtual storage unit cores, and the shared storage unit 212 is also divided into four virtual shared storage units.
  • Each virtual computing device 142 is configured with a virtual storage unit core, a virtual shared storage unit, and a cluster to support the tasks of a specific guest operating system. Likewise, each virtual computing device 142 operates independently without affecting each other.
  • the number of clusters of the computing device 130 should be at least the same as the number of virtual computing devices 142 to ensure that each virtual computing device 142 can be configured with a cluster.
  • Clusters are appropriately configured to virtual computing devices 142 to increase hardware configuration flexibility.
  • the video codec device 132 of this embodiment includes six video codec units.
  • the video codec device 132 can flexibly allocate video codec units as a unit according to the number of virtual components and required resources. For example, the video codec device 132 is virtualized into four virtual video codec devices 144. If the first virtual video codec device and the second virtual video codec device require more video codec resources, two virtual video codec devices can be configured respectively.
  • the video codec unit is assigned to the first virtual video codec device and the second virtual video codec device, and one video codec unit is respectively allocated to the other virtual video codec devices 144 .
  • the video codec device 132 is virtualized into three virtual video codec devices 144. If any virtual video codec device does not require more video codec resources, two video codecs can be configured respectively. unit to each virtual video codec device 144 .
  • the number of video codec units should be at least the same as the number of virtual video codec devices 144 to ensure that each virtual video codec device 144 can be configured with one video codec unit.
  • the video codec unit can be appropriately configured to the virtual video codec device 144 according to actual needs, so as to increase the flexibility of hardware configuration.
  • the JPEG codec device 134 of this embodiment includes six JPEG codec units.
  • the JPEG codec device 134 can flexibly allocate JPEG codec units as a unit according to the number of virtual components and required resources.
  • the allocation method is the same as that of the video codec device 132 , so it is not repeated here.
  • the storage device 136 can adopt a non-uniform memory access (NUMA) architecture, including multiple DDR channels, and the storage device 136 can flexibly use DDR channels as a unit according to the number of virtual components and required resources.
  • NUMA non-uniform memory access
  • the allocation method is the same as that of the computing device 130 , the video encoding and decoding device 132 , and the JPEG encoding and decoding device 134 , so it is not repeated here.
  • An application scenario of the present disclosure is a data center in the cloud.
  • the data center needs maintenance work to ensure the stability and smoothness of the entire system. These maintenance work involves computer sharing, database backup, troubleshooting, uneven resource allocation (such as heavy load, light load) and routine maintenance, etc. . While performing the aforementioned maintenance work, the data center must ensure the normal operation of the system so that users will not notice any difference.
  • the present disclosure implements a hot migration technology, which completely preserves the running state of the entire virtual machine and quickly restores it to the original hardware platform or even a different hardware platform. After recovery, the virtual machine still runs smoothly.
  • the hot migration solution of the present disclosure is divided into two stages: the first stage is to package and send the configuration and data on the source server to the destination server, that is, to migrate the storage path; The state and data are placed in the corresponding place of the destination server, that is, the migration recovery path.
  • This hot migration solution is to completely save the running state and data of the entire virtual machine, and then quickly restore it to the original hardware platform or even a different hardware platform.
  • the source server and the destination server have the architecture shown in Figure 1 and Figure 2, and the hardware, software, and firmware versions of the destination server must be equal to or higher than the hardware, software, and firmware versions of the source server. , to ensure that the destination server can correctly identify the information during migration recovery.
  • the two stages of the hot migration scheme will be described separately.
  • FIG. 3 is a flowchart illustrating another embodiment of the present disclosure, which is a flow chart of migrating a save path.
  • the source server of this embodiment may be the system disclosed in FIG. 1
  • FIG. 4 shows that the source server with the architecture of FIG. Schematic diagram of the migration save path.
  • the "status information" It may include state information of virtual function drivers, firmware and hardware state information, state machines, registers, context state information of hardware internal states, software state machines, variables, and constant runtime context state information, etc.
  • the virtualization management software initiates a migration request to the emulated virtual machine QEMU 402.
  • the virtualization management software of this embodiment is Libvirt 401.
  • Libvirt 401 is an open source application programming interface (API), background program and management tool for managing virtualization platforms, and it can be used to manage the virtualization technology of QEMU 402 .
  • API application programming interface
  • the Libvirt 401 will start the live migration to ensure the normal operation of the virtual machine service.
  • step 302 QEMU 402 notifies the physical function driver 403 to start the migration, that is, QEMU 402 initiates a live migration start request.
  • This embodiment provides a model to manage the entire process of migrating and saving the path, and the model is the virtual machine learning unit QEMU object model (VMLU QOM) 404, wherein the virtual machine learning unit refers to the virtualized artificial intelligence shown in FIG. 1 . SoC 106, while the QEMU object model emulates PCIe.
  • VMLU QOM virtual machine learning unit QEMU object model
  • the role of the VMLU QOM 404 is to add a virtual PCIe device to the QEMU 402, register it in the QEMU 402 as a QEMU object model, and indicate to the QEMU 402 that it has the capability of hot migration, and at the same time provides the scheduling routines related to the hot migration. (dispatch routine) function, so that QEMU 402 can be successfully scheduled during live migration.
  • the QEMU 402 operates the physical function driver 403 through the scheduling routine function, so as to notify and control the physical function driver 403 to cooperate with the live migration.
  • Memory mapping I/O Memory mapping I/O, MMIO
  • I/O devices are placed in memory space instead of I/O space. From the point of view of the processor in the user space 102, after the memory-mapped I/O, the system accessing other devices is the same as accessing the memory, which simplifies the difficulty of programming and the complexity of the interface.
  • the VMLU QOM 404 in the QEMU 402 initializes the live migration start request, and sends the live migration start request to the physical function driver 403.
  • the physical function driver 403 notifies the virtual function driver 405 to initiate migration.
  • the virtual function driver 405 is stored in the virtual machine kernel space.
  • the user space 102 based on what it sees during the live migration process is the aforementioned virtual PCIe device, and there is a readable and writable memory mapped I/O space.
  • the read and write operations of the virtual function driver 405 to the memory-mapped I/O space ie, the SoC 106
  • the VMLU QOM 404 can return the value that should be returned according to the needs of the virtual function driver 405, so that the virtual function driver 405 and the physical function driver 403 are synchronized.
  • the VMLU QOM 404 acquires the migration state of the physical function driver 403 by calling the interface of the physical function driver 403.
  • the virtual function driver 405 wants to read the memory-mapped I/O space of the VMLU QOM 404
  • the VMLU QOM 404 returns the state of the physical function 406 to the virtual function driver 405.
  • the VMLU QOM 404 drives the physical function
  • the state that the program 403 is ready for hot migration is passed to the virtual function driver 405 .
  • step 304 virtual function driver 405 suspends execution of tasks from user space 102 .
  • the method adopted in this embodiment is that the virtual function driver 405 does not return the control of the processor to the application program in the user space 102, and the guest operating system will continue to wait and will not send the next task to the virtual function driver 405. , to suspend the execution of user space 102 tasks.
  • step 305 the virtual function driver 405 notifies the physical function driver 403 to prepare for migration. After the execution of the instruction from the user space 102 is suspended, the virtual function driver 405 notifies the physical function driver 403 that the user space 102 is ready, and there will be no instruction issuing interference during the live migration.
  • the physical function driver 403 notifies the physical function 406 that it is ready to migrate.
  • the physical function driver 403 sends a live migration start request to the physical function 406, and the live migration start request specifies the specific virtual hardware 408 to perform the live migration.
  • the specific virtual hardware 408 is one of multiple virtual hardwares of the system-on-chip 106 . For the convenience of description, it is assumed here that the live migration start request is for a specific virtual function 407 and its corresponding specific virtual hardware 408 .
  • the specific virtual hardware 408 may be a specific virtual computing device, such as the virtual computing device 142 in FIG. 1 , and the information to be migrated includes the configuration of the virtual computing device 142, the calculation intermediate value stored in the virtual shared storage unit, and the virtual computing device 142. storage unit core data, etc.
  • the specific virtual hardware 408 may also be the specific virtual storage device 148 in FIG. 1 , and the information to be migrated includes data stored in the specific virtual storage device 148 .
  • the specific virtual hardware 408 may also be the virtual video codec device 144 or the virtual JPEG codec device 146, and the information to be migrated includes the configuration of the virtual video codec device 144 or the virtual JPEG codec device 146, and the corresponding codec information .
  • the physical function 406 uploads to the physical function driver 403 data including the driver of the specific virtual function 407, firmware and information of the specific virtual hardware 408, context information and its state information.
  • the physical function 406 sends an instruction to the physical function driver 403 in the kernel space 104, which records information about a particular virtual hardware 408, so that the physical function driver 403 knows how much data needs to be migrated.
  • the VMLU QOM 404 is in the stop and copy stage, and will not allocate physical resources to the user space 102.
  • the user space 102 does not have a time slice to run the program, thereby interrupting the connection between the user space 102 and the specific virtual function 407, but Other virtual functions and their corresponding virtual hardware operate as usual.
  • the physical function 406 fetches the information to be migrated from the specific virtual hardware 408 in batches, and sends it to the physical function driver 403 . After the information to be migrated is sent, the physical function 406 sends an end signal to the physical function driver 403 .
  • step 308 the VMLU QOM 404 obtains the information to be migrated from the physical function driver 403.
  • the physical function driver 403 in the kernel space sends the information to be migrated to the VMLU QOM 404.
  • step 309 the VMLU QOM 404 embeds the information to be migrated into the instruction to be migrated and transmits it to Libvirt 401.
  • step 310 after the instruction to be migrated is sent, the physical function 406 releases the resources of the specific virtual hardware 408 and the specific virtual function 407, the VMLU QOM 404 sends an end signal to the virtual function driver 405, and the virtual function driver 405 sends a control signal To the interface 409 of the virtual function driver, the guest operating system restarts and issues the task. End the entire migration save path.
  • the system of FIG. 4 also includes a serialization device 410 for responding to the warm migration start request, in step 307, the driver, firmware of the specific virtual function 407 and the information, context information and the specific virtual hardware 408 Data such as status information is serialized to generate information to be migrated and uploaded to the physical function driver 403 .
  • the serialization device 410 of this embodiment may be implemented using hardware or firmware. In the case of hardware, the serialization device 410 is configured in the SoC 106 ; in the case of firmware, it is stored in the read-only storage device of the SoC 106 .
  • the information to be migrated generated in step 307 must follow the protocol, the source server generates the information to be migrated based on the protocol, and the destination server interprets the information to be migrated according to the protocol, so that the configuration and data.
  • the data structure of the information to be migrated in the protocol specification of this embodiment is shown in FIG. 5, and the serializer 410 generates a three-layer framework under this protocol: the protocol layer 51. Data structure layer 52 and serialization layer 53.
  • the protocol layer 51 is used to record information such as the protocol version of the information to be migrated, the attribution of the data, and the length.
  • the serialization device 410 generates 10 identifiers at the protocol layer 51, which are magic number identifier 501, version identifier 502, request response identifier 503, command identifier 504, sequence number identifier 505, data identifier Source Identifier 506, Byte Identifier 507, Field Identifier 508, Reserved Identifier 509, Payload Identifier 510.
  • the role of these identifiers is exemplarily explained below.
  • the magic number identifier 501 is set to 4 bytes, which is used to mark the beginning of the information to be migrated. More specifically, the characters of the magic number identifier 501 are fixed. The characters in the magic number identifier 501 can know that this is the information to be migrated, and then start the operation of the migration recovery path.
  • the version identifier 502 is set to 2 bytes to mark the version of the information to be migrated. As mentioned above, if the system version of the source server is inconsistent with the system version of the destination server, especially when the system version of the source server is higher than that of the destination server, compatibility problems will arise. In order to enable the destination server to judge the compatibility , the protocol layer 51 uses the version identifier 502 to record the version of the information to be migrated, that is, to record the system version of the source server.
  • the request response identifier 503 is set to 1 byte to indicate that the command is a request or a response.
  • the command identifier 504 is set to 1 byte to indicate the task type of the information to be migrated.
  • the task type in this embodiment includes migration status/data and update data dictionary.
  • the migration status and data have been described above and will not be repeated here.
  • Data dictionary refers to the definition and description of data items, data structures, data flows, data storage, processing logic, etc. of data, and its purpose is to make detailed descriptions of various elements of data. Simply put, a data dictionary is a collection of information describing data, a collection of definitions for all data elements used in a system.
  • the update data dictionary is to define and describe the data items, data structure, data flow, data storage, processing logic, etc. of the updated data.
  • the serial number identifier 505 is set to 4 bytes, and is used to record the serial number of the information to be migrated, and the serial number corresponds to the sequence of the information to be migrated.
  • the data source identifier 506 is set to 2 bytes, which is used to record which device the information in the information to be migrated comes from, that is, the specific hardware 408 in FIG. At least one of a virtual video codec device, a virtual JPEG codec device, and a virtual storage device.
  • the byte identifier 507 is set to 8 bytes to record the total number of bytes of the information to be migrated or the total number of bytes of the payload.
  • the domain identifier 508 is used to mark the specific virtual function to be live migrated, that is, the specific virtual function 407 in FIG. 4 .
  • the reserved identifier 509 is set to 2 bytes and is reserved for use when other information needs to be recorded in the future.
  • the payload identifier 510 is used to record the information of the data structure layer 52 .
  • the data structure layer 52 is used to represent the organizational structure of the information to be migrated. For live migration, it is usually not necessary to describe the data topology and the relationship between data structures in too much detail, because the source server and the destination server have similar or even identical frameworks, so the data structure layer 52 of this embodiment does not Too much information needs to be recorded, as long as the destination server has enough information to understand the information to be migrated from the source server.
  • the information to be migrated in the present disclosure is divided into two types, one is configuration and the other is data.
  • the protocol frame generated by the serialization device 410 in the data structure layer 52 is shown in the configuration frame 54, including generating a domain identifier 511, a chip identifier 512, a board Card Identifier 513, Microcontroller Identifier 514, Firmware Identifier 515, Host Driver Identifier 516, Virtual Machine Identifier 517, Reserved Identifier 518, Computing Device Identifier 519, Storage Identifier 520, Video Codec Identifier Identifier 521 , JPEG codec device identifier 522 , PCIe identifier 523 , and reserved identifier 524 .
  • the domain identifier 511 is used to mark the specific virtual function 407; the chip identifier 512 is used to record the chipset model of the source server; the board identifier 513 is used to record the version or model of the board card of the source server.
  • the microcontroller identifier 514 is used to record the version of the origin server's microcontroller, which is a general-purpose control element in the system-on-chip 106 used to detect or control the server environment, such as detecting or controlling the server temperature and operating frequency.
  • the firmware identifier 515 is used to record the firmware version of the source server; the host driver identifier 516 is used to record the host driver software version of the source server; the virtual machine identifier 517 is used to record the virtual machine driver software version of the source server; reserved identifier 518
  • the reserved identifier 524 is not used for the time being, and is reserved for use when other information needs to be recorded in the future.
  • the computing device identifier 519 , the storage device identifier 520 , the video codec device identifier 521 , and the JPEG codec device identifier 522 are collectively referred to as specific device identifiers, which are used to record the configuration of the specific hardware 408 in FIG. 4 . More specifically, the computing device identifier 519 is used to record the configuration of the virtual computing device of the source server (such as the virtual computing device 142 in FIG. 1 ); the storage device identifier 520 is used to record the virtual storage device of the source server (as shown in FIG. 1 ).
  • the video codec device identifier 521 is used to record the configuration of the virtual video codec device of the source server (such as the virtual video codec device 144 in FIG. 1); the JPEG codec device identifier The symbol 522 is used to record the configuration of the virtual JPEG codec device of the origin server (such as the virtual JPEG codec device 146 in FIG. 1 ).
  • the PCIe identifier 523 is used to record the configuration of the virtual interface of the source server (such as the virtual interface 140 of FIG. 1 ), where the virtual interface refers to the PCIe virtual interface assigned to the specific virtual function 407 .
  • the data information is originally stored in the memory
  • the memory here is a virtual storage unit that can be directly accessed by the specific hardware 408, which may be the virtual computing device 142, the virtual video codec device 144 or the virtual JPEG
  • the internal storage space of the codec device 146 is, for example, a virtual shared storage unit in the virtual computing device 142
  • the memory may also be the virtual storage device 148 .
  • the serializer 410 generates the data frame 55 to carry the information. This embodiment considers that some complex scenarios may need to describe the relationship between the data, so the serialization device 410 uses a specific symbol to display the relationship between the data, so that the destination server can completely and accurately restore the data according to the information.
  • the data information recorded in the data structure layer 52 may be several data of different types but related.
  • the serialization device 410 of this embodiment defines a structure according to the relationship between the data, which includes at least one type, and each type is composed of at least one variable (ie, data). In other words, several related variables are grouped into a type, and several related types are grouped into a structure. These structures, types, variables and their relationships are stored in the aforementioned memory.
  • the serializer 410 When marking a structure, the serializer 410 will add a prefix before the name of the structure, which is used as a starting symbol to describe the structure.
  • a string is used as the prefix symbol, and the prefix symbol can be any non-English letter and numeric characters, such as ".”, "$”, “/”, “#”, “%”, “&”, “*”, and "-”.
  • the English period ".” will be uniformly used as the prefix symbol below.
  • the data frame 55 generated by the serializer 410 includes a symbol identifier 525, a type identifier 526, a key identifier 527, and an entity identifier 528, which are used to describe and record structures, types, and variables.
  • the symbol identifier 525 is used to mark the beginning of the structure or data frame 55.
  • the serializer 410 places the prefix symbol and the name of the structure in the symbol identifier 525 according to the protocol. Taking the structure name "foo_nested” as an example, its symbol identifier 525 is recorded as ".foo_nested". Since the source server and the destination server follow the same protocol, when the destination server recognizes the prefix symbol ".”, it knows that the prefix symbol is followed by the structure name, and the following identifiers are all related descriptions of the structure.
  • the type identifier 526 is used to record various types under the structure, and the types include tree, image, linked list, heap, integer, and floating-point number.
  • the name of the type may be defined by the serializer 410 or used for data storage in memory. For example, if the integer a (its value is 20) and the integer b (its value is 10) are defined as the same type under the structure, and the serializer 410 names this type as "foo_nested_t", the type identifier 526 records The class name "foo_nested_t" for integer a and integer b.
  • the key identifier 527 is used to record the variable name under this type.
  • the serializer 410 adds a prefix to the variable name, the prefix is the content of the symbol identifier 525 plus the prefix symbol plus the variable name.
  • the serializer 410 first describes the integer a in the data frame 55, so the key identifier 527 of the integer a is "" .foo_nested.a".
  • the entity identifier 528 then describes the value of the variable, and the value of the integer a is 20, so the entity identifier 528 directly describes "20".
  • serializer 410 generates magic number identifier 529, length identifier 530, byte order identifier 531, compression identifier 532, type identifier 533, key identifier 534, count under serialization layer 53 Identifier 535, Format Identifier 536, and Value Identifier 537.
  • the magic number identifier 529 is a specific character used to mark the beginning of a new data segment, that is, the beginning of the serialization layer 53.
  • the destination server reads the magic number identifier 529, it can know that the serialization layer is next. 53 information and deal with it accordingly.
  • the length identifier 530 is used to indicate the length of the serialization layer 53 .
  • the byte order identifier 531 is used to indicate the storage byte order of the data in the serialization layer 53, and the data is generally stored in big endian mode or little endian mode. Big-endian mode means that the high byte of the data is stored in the low address of the memory, and the low byte of the data is stored in the high address of the memory. This storage mode is similar to the sequential processing of the data as a string, that is, the address is Small to large increases, and data is stored from high to low. Little-endian mode means that the high byte of the data is stored in the high address of the memory, and the low byte of the data is stored in the low address of the memory. This storage mode effectively combines the high and low address and data bits, and the high address Some parts have high weights, and parts with low addresses have low weights.
  • the compression identifier 532 is used to identify the compressed form of the data information. When the data is transmitted, it will be properly compressed to reduce the amount of transmission. This embodiment does not limit the compression form, but BDI (base delta immediate) compression is preferably used.
  • the type identifier 533 is used to indicate the type of the data information.
  • the type identifier 533 is different from the content recorded by the type identifier 526.
  • the type identifier 526 is used to record various types under the structure, and the type identifier 533 is used to indicate the type of the data itself.
  • the key identifier 534 is used to identify the variable name under the type in the type identifier 533 .
  • the count identifier 535 is used to indicate the number of variables under the type in the type identifier 533 .
  • the format identifier 536 is used to indicate the variable format under the type in the type identifier 533.
  • int 16 int 32, and int 64 indicate whether the variable is a 16-bit integer, a 32-bit integer or a 64-bit integer, respectively.
  • the numerical identifier 537 is a numerical value or a character string describing the variable.
  • the format identifier 536 is directly followed by multiple value identifiers 537 to record each value.
  • a variable is a list containing 128 values
  • the type identifier 533 indicates that the data is a list
  • the count identifier 535 indicates that there are 128 values in total
  • the value identifier 537 has 128 values, respectively storing the 128 values.
  • More complex data such as tree data, nested data or logical pointers need to use the serialization layer 53 .
  • the so-called tree data refers to a binary tree, which is a type of tree structure.
  • a binary tree is a collection of multiple elements (also known as nodes), which is either empty or consists of an element called the root and two disjoint,
  • a binary tree consisting of left subtree and right subtree, respectively, is an ordered tree.
  • FIG. 7 shows exemplary tree data, including nodes 701 to 707 , wherein each node corresponds to a value, for example, the value of node 701 is 20, the value of node 702 is 8, and so on.
  • Nested data refers to a data format in which one or more tables, images, layers, or functions are added to an existing table, image, layer, or function.
  • a logical pointer is a structure that points to another structure by adding an identifier to establish an association between structures. How the serialization device 410 serializes tree data, nested data or logical pointers will be described one by one below.
  • the serializer 410 When the data is tree data, the serializer 410 indicates the beginning of the information of the tree data in the magic number identifier 529, the length of the serialization layer 53 in the length identifier 530, and the byte order identifier 531.
  • the tree data is stored in big endian mode or little endian mode, the compressed form of the tree data is indicated in the compression identifier 532, the type is binary tree in the type identifier 533, and the variable of the tree data is indicated in the key identifier 534 name, the number of elements in the tree data at count identifier 535, and the element format of the tree data at format identifier 536.
  • the value identifier 537 records the value of each element of the tree data. When recording these values, the tree data needs to be serialized. First, the binary tree is traversed in a specific order to form serialized data. The specific sequence may be agreed in the protocol, which is one of pre-order, mid-order, post-order, and reverse post-order, and then the traversed values are sequentially placed into the value identifier 537 .
  • Preorder traversal is for the current tree data, first output the root node, and then output its left subtree, in order until there is no left subtree, and then output its right subtree.
  • its root node is node 701
  • the value of node 701 is recorded as 20
  • the value of 8 of its left subtree node 702 is recorded
  • the value of 4 of its left subtree node 703 is recorded.
  • 703 has no left subtree, so NIL is recorded (indicated as empty), and then the right subtree of node 703 is output.
  • Node 703 also has no right subtree, so NIL is recorded again, and back to the upper node 702, its right subtree For node 704, record its value 12, and then record the value of its left subtree node 705, 10, node 705 has no left subtree and right subtree, respectively record NIL, go back to the right subtree 706 of node 704, record its value 14.
  • Node 706 also has no left subtree and right subtree, and records NIL respectively, and finally returns to the root node 701. Its right subtree is node 707, and its value is recorded as 22. Node 707 also has no left subtree and right subtree. The tree, which records NIL respectively, ends the traversal process.
  • the serialized data obtained in sequence are: 20, 8, 4, NIL, NIL, 12, 10, NIL, NIL, 14, NIL, NIL, 22, NIL , NIL, the numerical identifier 537 of which is shown in FIG. 8 .
  • In-order traversal is for the current node, output its left subtree first, then output the node, and finally output its right subtree.
  • the serialized data obtained in sequence are: NIL, 4, NIL, 8, NIL, 10, NIL, 12, NIL, 14, NIL, 20, NIL, 22. NIL.
  • Post-order traversal For the current node, first output its left subtree, then output its right subtree, and finally output the node.
  • the serialized data obtained are in sequence: NIL, NIL, 4, NIL, NIL, 10, NIL, NIL, 14, 12, 8, NIL, NIL, 22 , 20.
  • Serializer 410 converts the tree data to serialized data and places the serialized data into value identifier 537 in any of the foregoing manners. This embodiment does not limit the manner of traversing the tree data, but it is better to traverse in a preorder manner.
  • the nested data may include multiple layers of nested structure. For the convenience of description, the following will take the nested data with two layers of data as an example.
  • the serialization device 410 also presents the nested data in the form of a structure, which is divided into a first-level structure (upper structure) and a second-level structure (lower structure), that is, the second-level structure is nested in the first level structure. in the layer structure.
  • the serializer 410 When the serializer 410 generates the information to be migrated, it will be divided into two sections in the data structure layer 52, the first section has a symbol identifier 525 (first symbol identifier) and a type identifier 526 (first type identifier) and the key identifier 527 (first key identifier) respectively record the related information of the first layer structure, and expand the serialization layer 53 of the first layer structure in the entity identifier 528 (first entity identifier).
  • the serialization device 410 generates each identifier in the serialization layer 53 of the first-level structure as follows: the magic number identifier 529 indicates the start of serialization of the first-level structure, and the length identifier 530 describes the sequence of the first-level structure
  • the byte order identifier 531 indicates that the first layer structure is stored in big endian mode or little endian mode, the compression identifier 532 indicates the compressed form of the first layer structure, and the type identifier 533 indicates the first layer structure.
  • the type of the first-level structure indicates the variable name in the first-level structure
  • the count identifier 535 indicates the number of variables in the first-level structure
  • the format identifier 536 indicates the variable of the first-level structure format
  • the value identifier 537 describes the value of each variable in the first-level structure.
  • the serializer 410 then generates a description of the second-level structure.
  • the serializer 410 generates a key identifier 527 (second key identifier) to describe the name of the second-level structure, and expands the serialization layer 53 of the second-level structure in the entity identifier 528 (second entity identifier) .
  • the way of recording each identifier of the serialization layer 53 of the second-layer structure is the same as that of the first-layer structure, and will not be repeated.
  • the preceding code expresses that the nested data includes a two-level structure.
  • the first-level structure is named "foo_nested” and includes three types.
  • the first type is an integer number array, the variable name is "array”, and the array is ⁇ 26, 91,1029 ⁇ ;
  • the second type is the second-level structure, including the number 91 and the string Hello world;
  • the third type is the integer number 10029.
  • Figure 9 shows the resulting data structure when nested data is serialized. Since only the serialization of nested data is described here, each identifier of the protocol layer 51 is omitted and not described.
  • the first symbol identifier 901 records the name of the first layer structure, that is, ".foo_nested”;
  • the first type identifier 902 records the type of the first layer structure, that is, "foo_nested_t” ;
  • the first key identifier 903 and the first entity identifier 904 record the information of the first type of integer number array ⁇ 26, 91, 1029 ⁇ , wherein the first key identifier 903 records its variable name as ".foo_nested.array” , the first entity identifier 904 records three values of the array, namely integer numbers 26, 91, and 1029. Since the array is simple data, the first entity identifier 904 does not need to expand the serialization layer 53 .
  • the second type of information is then recorded.
  • the second type is a second-level structure of nested data, and its name is "foo1", according to the protocol, the second key identifier 905 It is recorded as ".foo_nested.foo1", which means the “foo1" structure nested under the "foo_nested” structure.
  • the serializer 410 expands the serialization layer 53 at the second entity identifier 906 to represent the second layer structure, wherein the magic number identifier 907 indicates the beginning of the second layer structure, and the length identifier 908 records the serialization layer
  • the length of 53, the byte order identifier 909 indicates that the second layer structure is stored in big endian mode or little endian mode, the compression identifier 910 indicates the compressed form of the second layer structure, and the second symbol identifier 911 records the second layer.
  • the name of the layer structure is ".foo_nested.foo1" according to the protocol; the second type identifier 912 records the type name of the second layer structure, that is, "foo1_t".
  • the serializer 410 records the relevant information with two sets of key identifiers and entity identifiers, respectively.
  • the third key identifier 913 and the third entity identifier 914 are used to record the number, wherein the third key identifier 913 records the variable name as ".foo_nested.foo1.integer", and the third entity identifier 914 records the value "91” ”;
  • the fourth key identifier 915 and the fourth entity identifier 916 are used to record the string, wherein the fourth key identifier 915 records that the variable name is “.foo_nested.foo1.str”, and the fourth entity identifier 916 records The string is "Hello world”.
  • the serializer 410 After the identification of the second type of information is completed, the third type of information is then recorded in the data structure layer 52 .
  • the serializer 410 adds a fifth key identifier 917 to record the variable name of the third type, namely ".foo_nested.seq", and records the third type of variable name in the fifth entity identifier 918 The variable value of , that is, "10029". So far, the serialization device 410 loads the information of all the nested data into the information to be migrated.
  • the serializer 410 uses the data structure layer 52 and the serialization layer 53 to fully express the relationship pointed to by the pointer.
  • the aforementioned code expresses the first structure, whose name is "foo_nested”, includes a first type whose name is “foo_nested_t", the first type includes two variables, the first variable is the logical pointer "foo1", It points to the second structure foo2, the second variable is an integer, its name is seq, and the value is 10029.
  • the second structure foo2 also includes a second type whose name is "foo2_t", and the second type includes an integer variable whose name is "interger” and whose value is 91.
  • FIG. 10 shows a schematic diagram of the serialization device 410 serializing the above-mentioned structure including logical pointers into information to be migrated. Likewise, the serialization of logical pointers is only disclosed here, so the identifiers of the protocol layer 51 are omitted.
  • the serialization device 410 records the name of the first structure in the first symbol identifier 1001 according to the protocol, that is, ".foo_nested”; the first type identifier 1002 records the name of the first type, that is, “foo_nested_t” ”; the first key identifier 1003 and the first entity identifier 1004 record the information of the logical pointer, the first key identifier 1003 records the logical pointer name as “.foo_nested.foo1” according to the protocol, and the first entity identifier 1004 records the logical pointer Points to ".foo2".
  • the second key identifier 1005 and the second entity identifier 1006 record the information of the second variable
  • the second key identifier 1005 records the second variable name as ".foo_nested.seq" according to the protocol
  • the second entity identifier 1006 records the first variable name.
  • the value of the binary variable is "10029".
  • the serializer 410 will appropriately place the information of the second structure foo2 in a certain segment in the same data structure of the information to be migrated. As shown in FIG. 10 , after the second entity identifier 1006, there is information of a plurality of other structures.
  • the serializer 410 then records the information of the second structure, and the second symbol identifier 1007 records the name of the second structure, that is, ".foo2", and the English period is for the system to identify here is a symbol identifier, which is the beginning of a structure information; the second type identifier 1008 records the name of the second type, namely "foo2_t"; the third key identifier 1009 and the third entity identifier 1010 record the name of the second type In the variable information, the third key identifier 1009 records the variable name as ".foo2.integer", and the third entity identifier 1010 records the variable value as "91".
  • each data structure of the information to be migrated must include the serialization layer 53 or every identifier of the serialization layer 53 .
  • the serialization device 410 when the serialization device 410 generates the information to be migrated, it can splicing multiple identifiers according to actual needs to appropriately extend the lengths of the data structure layer 52 and the serialization layer 53, and then convert the total bytes of the information to be migrated. The number is recorded in the byte identifier 507.
  • the data structure layer 52 and the serialization layer 53 may include a plurality of symbol identifiers, type identifiers, key identifiers or entity identifiers concatenated together to record different data entities respectively.
  • the physical function 406 sends the information to be migrated to the physical function driver 403 of the kernel space 104 in step 307 to complete the process of data serialization.
  • Another embodiment of the present disclosure is a method for hot-migrating a storage path for a system.
  • this embodiment is a process of generating a data structure of the information to be migrated in step 307, and FIG. 11 shows the flow chart. .
  • a live migration start request is received, and the live migration start request specifies a specific virtual function for live migration, where the specific virtual function is one of a plurality of virtual functions.
  • the physical function driver 403 sends a live migration start request to notify the physical function 406 that it is ready to migrate, and the physical function 406 receives the live migration start request, wherein the live migration specific virtual function 407 is specified.
  • step 1102 a data structure of the information to be migrated is generated.
  • the serialization device 410 generates a data structure of the information to be migrated in response to the hot migration start request. This step can be further refined into the process shown in FIG. 12 .
  • step 1201 the protocol layer of the data structure is generated; in step 1202, the data structure layer of the data structure is generated; in step 1203, the serialization layer of the data structure is generated.
  • magic number identifier version identifier In step 1204, magic number identifier version identifier, request response identifier, command identifier, sequence number identifier, data source identifier, byte identifier, field identifier, reserved identifier, payload identifier are generated in the protocol layer at least one of identifiers, etc.
  • step 1205 it is determined whether the information to be migrated is configuration or data.
  • step 1206 If it is configuration, perform step 1206 to generate domain identifier, chip identifier, board identifier, microcontroller identifier, firmware identifier, host driver identifier, virtual machine identifier, reserved identifier in the data structure layer at least one of an identifier, a computing device identifier, a storage device identifier, a video codec device identifier, a JPEG codec device identifier, a PCIe identifier, and the like.
  • step 1207 is executed to generate at least one of a symbol identifier, a type identifier, a key identifier, and an entity identifier in the data structure layer.
  • step 1208 is executed to generate magic number identifiers, length identifiers, byte order identifiers, compression identifiers, type identifiers, key identifiers, count identifiers, format identifiers, and value identifiers in the serialization layer. at least one of them.
  • the information to be migrated is sent to the kernel space.
  • the serialization device 410 After the serialization device 410 generates the information to be migrated, the physical function 406 sends the information to be migrated to the physical function driver 403 of the kernel space 104 .
  • Another embodiment of the present disclosure is a method for serializing tree data, the flowchart of which is shown in FIG. 13 and includes the following steps.
  • the information to be migrated is generated in response to a hot migration start request, and the data structure of the information to be migrated includes a numerical identifier;
  • the tree data is traversed in a specific order to form serialized data;
  • the serialized data is placed in the numerical identifier.
  • the details of the serialized tree data have been described in the foregoing embodiments, so they are not repeated here.
  • Another embodiment of the present disclosure is a method for serializing nested data, where the nested data at least includes a first-level structure and a second-level structure, and the serialization device 410 responds to a hot migration start request to generate a to-be-migrated information, the steps of generating the information to be migrated are shown in FIG. 14 .
  • a first symbol identifier is generated in the data structure layer of the information to be migrated to record the name of the first layer structure; in step 1402, a second symbol is generated in the serialization layer The identifier is used to record the name of the second structure.
  • Another embodiment of the present disclosure is a method for serializing a logical pointer, where the logical pointer associates a first structure with a second structure, the flowchart of which is shown in FIG. 15 and includes the following steps.
  • step 1501 the information to be migrated is generated in response to the hot migration start request; in step 1502, a first symbol identifier and a first entity identifier are generated in the data structure of the information to be migrated; in step 1503, in the The name of the first structure is placed in the first symbol identifier; in step 1504, the value of the logical pointer is placed in the first entity identifier, and the value of the logical pointer is the Describe the name of the second structure.
  • the details of the serialized logical pointers have been described in the foregoing embodiments, so they are not repeated here.
  • the present disclosure implements data serialization in the migration storage path. While executing the foregoing process, for non-specific virtual functions and hardware, tasks from the user space 102 are still executed without being affected.
  • FIG. 16 is a flow chart illustrating the migration recovery path
  • FIG. 17 is a schematic diagram of the migration recovery path in the environment of FIG. 1 . More specifically, in this embodiment, the information to be migrated is then migrated to the destination server after the migration and storage path is completed in the embodiment of FIG. 3 and FIG. 4 .
  • Libvirt 1701 initiates a request to QEMU 1702 to import the information to be migrated.
  • the QEMU 1702 receives the commands to be migrated issued in the embodiments of FIG. 3 and FIG. 4 from off-chip, and initiates a warm migration start request.
  • the off-chip refers to the source server, and the source server and the destination server may be on the same hardware platform or different hardware platforms.
  • step 1602 the VMLU QOM 1704 sends the information to be migrated to the physical function driver 1703.
  • the VMLU QOM 1704 calls the write function in response to the hot migration start request, and sends the information to be migrated to the physical function driver 1703.
  • step 1603 the physical function 1706 receives the information to be migrated.
  • the VMLU QOM 1704 sends the information to be migrated to the physical function driver 1703, and the physical function driver 1703 sends the information to be migrated to the physical function 1706.
  • step 1604 the configuration, data and its context are restored for the specific virtual function 1707 and the specific virtual hardware 1708.
  • physical functions 1706 idle certain virtual functions 1707 so that they temporarily do not communicate with user space 102, but other virtual functions operate as usual. After the specific virtual function 1707 is idle, the physical function 1706 sends the information to be migrated to the specific virtual hardware 1708 through the specific virtual function 1707 .
  • the specific virtual hardware 1708 may be the virtual computing device of FIG. 1, a specific virtual storage device, a virtual video codec device, or a virtual JPEG codec device.
  • the information to be migrated includes drivers, firmware and hardware information, context information, status information, etc. related to the specific virtual hardware 1708 .
  • the specific virtual function 1707 and the specific virtual hardware 1708 have exactly the same environment and data as the specific virtual function 407 and the specific virtual hardware 408 .
  • step 1605 the physical function 1706 reports to the physical function driver 1703 that the migration has been completed.
  • the physical function 1706 sends an end signal to the physical function driver 603 in the kernel space 104.
  • step 1606 the physical function driver 1703 notifies the VMLU QOM 1704 that the live migration has been completed, that is, the physical function driver 1703 sends an end signal to the QEMU 1702.
  • step 1607 the VMLU QOM 1704 changes state to notify the virtual function driver 1705 that the live migration has completed.
  • the VMLU QOM 1704 notifies the virtual function driver 1705 that the live migration has been completed, and at the same time changes the state of the base address register to point to the specific virtual function 1707 and specific virtual hardware 1708 of the destination server.
  • step 1608 the virtual function driver 1705 sends a control signal to the interface 1709 of the virtual function driver to resume the task of executing the guest operating system.
  • step 1609 the interface 1709 of the virtual function driver notifies the virtual function driver 1705 to resume the task of executing the guest operating system.
  • the virtual function driver 1705 again receives tasks from the processor of the user space 102 through the interface 1709 of the virtual function driver. These tasks no longer access the specific virtual hardware 408 of the source server, but instead access the specific virtual hardware 1708 of the destination server.
  • step 1610 the VMLU QOM 1704 informs the Libvirt 1701 that the live migration is complete, and the Libvirt 1701 cleans up the hardware resources allocated on the source server. This completes the migration recovery path.
  • the present disclosure can realize the hot migration of the virtualized ASIC.
  • the system of FIG. 17 further includes a deserialization device 1710 for responding to the hot migration start request, and in step 1604, according to the information to be migrated, restores the driver program of the specific virtual function 1707, the firmware and the information of the specific virtual hardware 1708, Data such as contextual information and its state information.
  • the deserialization device 1710 of this embodiment may be implemented by hardware or firmware.
  • the deserialization device 1710 is configured in the SoC 106 ; in the case of firmware, it is stored in the read-only storage device of the SoC 106 .
  • the deserialization device 1710 implements a method for a hot migration recovery path, and the flow is as described in FIG. 18 .
  • the deserializer 1710 receives the information to be migrated.
  • the deserialization device 1710 deserializes the information of the protocol layer 51, and this step is refined into the flow of FIG. 19 .
  • the deserializer 1710 can identify the data structure of FIG. 5, which identifies from the magic number identifier 501 that this is the beginning of the protocol layer 51 of the information to be migrated.
  • the version of the information to be migrated is identified from the version identifier 502 to confirm that the system version of the destination server is equal to or higher than that of the source server.
  • the information instruction is identified from the request response identifier 503 as a request or a response. If it is a request, continue to execute the migration recovery path. If it is a response, it means that the information is not to be migrated, and the recovery is stopped.
  • step 1904 the task type of the information to be migrated is identified from the command identifier 504 as migrating status and data or updating the data dictionary.
  • step 1905 the serial number of the information to be migrated is identified from the serial number identifier 505 to determine the ranking of the information to be migrated in the entire hot migration recovery path.
  • a specific virtual package is identified from the data source identifier 506, wherein the specific virtual package includes at least one of a virtual computing device, a virtual video codec device, a virtual JPEG codec device, and a virtual storage device, and the solution
  • the string device 1710 restores the information to be migrated to the specified specific virtual package according to the information of the data source identifier 506 .
  • step 1907 the total number of bytes of the information to be migrated or the total number of bytes of the payload is identified from the byte identifier 507.
  • step 1908 the information of the specific virtual function is extracted from the domain identifier 508 , and the information to be migrated is restored to the specific virtual function 1707 .
  • step 1909 the information of the data structure layer 52 is extracted from the payload identifier 510.
  • step 1803 the deserialization device 1710 starts to deserialize the information of the data structure layer 52, and firstly determines whether the data structure layer 52 records configuration information or data information.
  • step 1804 is executed to deserialize the configuration information. This step is refined into the flow of FIG. 20 .
  • the deserializer 1710 retrieves the information of the specific hardware from the domain identifier 511 , and prepares to restore the information to be migrated to the specific hardware 1708 .
  • the chip set model of the source server is identified from the chip identifier 512 to determine whether it is compatible with the chip set of the destination server.
  • the version or model of the board of the source server is identified from the board identifier 513 to determine whether it is compatible with the board of the destination server.
  • the model of the microcontroller of the source server is identified from the microcontroller identifier 514 to determine whether it is compatible with the microcontroller of the destination server.
  • step 2005 the firmware version of the source server is then identified from the firmware identifier 515 to determine whether it is compatible with the firmware of the destination server.
  • step 2006 the host driver software version of the source server is identified from the host driver identifier 516 to determine whether it is compatible with the host driver software of the destination server.
  • step 2008 the information of the specific device identifier is retrieved, that is, the information is retrieved from the computing device identifier 519, the storage device identifier 520, the video codec device identifier 521, and the JPEG codec device identifier 522 to restore the specific device
  • the specific device is the specific hardware 1708, which is one of a virtual computing device, a virtual video codec device, a virtual JPEG codec device, and a virtual storage device.
  • step 2009 the configuration of the virtual interface is restored according to the information of the PCIe identifier 523.
  • step 1805 is executed to deserialize the data information. This step is refined into the flow of FIG. 21 .
  • the deserializer 1710 identifies the beginning of the marked structure from the symbol identifier 525 and extracts the name of the structure. More specifically, since the symbol identifier 525 includes a prefix symbol, the deserializer 1710 first identifies the prefix symbol, the name of the structure, and various identifiers after it, can be identified based on the prefix symbol.
  • the type is identified from the type identifier 526.
  • step 2103 the name of the variable is extracted from the key identifier 527.
  • the deserializer 1710 first recognizes the prefix symbol, and can then extract the variable name according to the prefix symbol.
  • the information of the serialization layer 53 is extracted from the entity identifier 528.
  • step 1806 is then executed to identify or retrieve the information of the serialization layer 53 .
  • This step is refined into the flow of FIG. 22 .
  • the deserializer 1710 then identifies the start of the serialization layer 53 based on the magic number identifier 529.
  • the length of the serialization layer 53 is identified from the length identifier 530.
  • the storage byte order of the data identified from the byte order identifier 531 is big endian or little endian.
  • the compressed form of the data is identified from the compression identifier 532.
  • the type is identified from the type identifier 533.
  • step 2206 the variable name is fetched from key identifier 534.
  • step 2207 the variable quantity is identified from the count identifier 535.
  • step 2208 the variable format is identified from the format identifier 536.
  • step 2209 the value or string of the variable is retrieved from the value identifier 537.
  • the deserialization device 1710 When the deserialization encounters relatively complex data, such as tree data, nested data or logical pointers, the deserialization device 1710 will perform the following deserialization process respectively.
  • the deserializing device 1710 When deserializing the tree data, the deserializing device 1710 will execute the process of FIG. 23 .
  • the type is identified from the type identifier 533 as a binary tree.
  • the tree data name is retrieved from the key identifier 534.
  • the number of elements of the tree data is identified from the count identifier 535.
  • the element format of the tree data is identified from the format identifier 536.
  • the serialized element data is retrieved from the value identifier 537.
  • the tree data is restored in a specific order.
  • the deserialization device 1710 When deserializing the nested data, the deserialization device 1710 is used to receive the information to be migrated, the data structure layer 52 of the information to be migrated includes the first symbol identifier, and the serialization layer 53 includes the second symbol identifier, according to extracting the first serialized data from the first symbol identifier; extracting the second serialized data according to the second symbol identifier; restoring the first serialized data into the first layer structure; The second serialized data is restored to the second layer structure. Finally, the first layer structure and the second layer structure are stored in the memory.
  • the deserialization device 1710 executes the flow shown in FIG. 24 for the first layer structure.
  • the nested data of FIG. 25 will be described below as an example.
  • the data structure of the information to be migrated includes a data structure layer 52 and a serialization layer 53, wherein the data structure layer 52 includes a first symbol identifier 2501, and the serialization layer 53 includes a second symbol Identifier 2509.
  • the first serialized data is identified and retrieved according to the first symbol identifier 2501, and its structure name is "foo_nested”.
  • the first type is restored from the first type identifier 2502, and its type name is "foo_nested_t".
  • step 2404 the variable name in the first level structure is restored from the first key identifier 2503, which is "foo1".
  • step 2405 the serialization layer 53 information is extracted from the first entity identifier 2504, that is, the information of the second layer structure is identified or extracted. This step can be further refined into the flow shown in FIG. 26 .
  • step 2601 the start of the second level structure is identified from the magic number identifier 2505.
  • step 2602 the length of the serialization layer 53 identified in the length identifier 2506.
  • step 2603 the storage endianness of the data in the second level structure is identified from the endianness identifier 2507.
  • step 2604 the compressed form of the data in the second level structure is identified from the compression identifier 2508.
  • step 2605 the name of the second-level structure is identified from the second symbolic identifier 2509 as "foo_nested_foo1".
  • step 2606 a second type is identified from the second type identifier 2510 with the name "foo_t”.
  • step 2607 the variable quantity is identified from the count identifier 2511.
  • step 2608 the variable format is identified from the format identifier 2512.
  • step 2609 the name “integer” of the first variable is retrieved from the second key identifier 2513.
  • step 2610 the value "91” of the first variable is retrieved from the first value identifier 2514.
  • step 2611 the name "str” of the second variable is extracted from the third key identifier 2515.
  • step 2612 the string "Hello world” of the second variable is extracted from the second value identifier 2516.
  • step 2613 the first layer and the second layer structure are stored, that is, all the information under the first layer and the second layer structure is restored.
  • the deserializing device 1710 When deserializing the logical pointer, the deserializing device 1710 will execute the process of FIG. 27 , while referring to the information to be migrated including the logical pointer in FIG. 10 .
  • step 2701 information to be migrated is received.
  • step 2702 the name of the first structure is extracted from the first symbol identifier 1001.
  • step 2703 the first type is identified from the first type identifier 1002.
  • the name of the logical pointer is retrieved from the first key identifier 1003.
  • the name of the second structure is extracted from the first entity identifier 1004.
  • the name of the second structure is extracted from the second symbol identifier 1007.
  • step 2707 the second type is identified from the second type identifier 1008.
  • step 2708 the name of the variable is retrieved from the second key identifier 1009.
  • step 2709 the information of the variable is retrieved from the second entity identifier 1010.
  • step 2710 the information of the first structure body and the second structure body is restored.
  • the deserialization device 1710 deserializes the information to be migrated, and restores the driver, firmware and hardware information, context information and state information of the specific virtual function 407 and specific hardware 408 in the source server to the destination server through the physical function 1706 specific virtual function 1707 and specific hardware 1708 memory.
  • FIG. 28 is a block diagram illustrating an integrated circuit device 2800 according to an embodiment of the present disclosure.
  • the integrated circuit device 2800 is the system-on-chip 106 in the foregoing embodiments, and includes a specific virtual kit 2802, and the specific virtual kit 2802 is a virtual computing device, a virtual video codec device, and a virtual JPEG codec device at least one of them.
  • the integrated circuit device 2800 also includes a general interconnect interface 2804 and other processing devices 2806.
  • the other processing devices 2806 may be one or more types of general-purpose and/or special-purpose processors such as a central processing unit, a graphics processing unit, an artificial intelligence processor, etc., the number of which is not limited but is determined according to actual needs .
  • the other processing device 2806 serves as an interface between the specific virtual suite 2802 and external data and control, and performs basic control including but not limited to data transfer, and completes the starting and stopping of the specific virtual suite 2802 .
  • Other processing devices 2806 may also cooperate with the specific virtual suite 2802 to complete computing tasks.
  • the general interconnect interface 2804 may be used to transfer data and control instructions between a particular virtual suite 2802 and other processing devices 2806.
  • the specific virtual suite 2802 can obtain the required input data from other processing devices 2806 via the general interconnection interface 2804, and write it into the storage unit on the specific virtual suite 2802 chip.
  • the specific virtual suite 2802 can obtain control instructions from other processing devices 2806 via the general interconnection interface 2804, and write the control instructions into the on-chip control cache of the specific virtual suite 2802.
  • the generic interconnect interface 2804 may also read data in the storage modules of a particular virtual suite 2802 and transmit to other processing devices 2806.
  • the integrated circuit device 2800 also includes storage devices 2808, which may be connected to the particular virtual suite 2802 and other processing devices 2806, respectively.
  • the storage device 2808 is the virtual storage device 148, which is used to save the data of the specific virtual package 2802 and other processing devices 2806, especially for the data required for the calculation that cannot be fully stored in the internal storage of the specific virtual package 2802 or other processing devices 2806. The data.
  • the integrated circuit device 2800 can be used as a system-on-chip (SOC) for mobile phones, robots, drones, video capture and other equipment, thereby effectively reducing the core area of the control part, improving the processing speed and reducing the overall power consumption .
  • the general interconnect interface 2804 of the integrated circuit arrangement 2800 is connected to certain components of the device. Some of the components here can be, for example, a camera, a display, a mouse, a keyboard, a network card or a wifi interface.
  • the present disclosure also discloses a chip or integrated circuit chip, which includes an integrated circuit device 2800 .
  • the present disclosure also discloses a chip package structure including the above-mentioned chip.
  • the board 2900 may also include other supporting components including a storage device 2904 , an interface device 2906 and a control device 2908 .
  • the memory device 2904 is connected to the chip 2902 in the chip package structure through a bus 2914 for storing data.
  • the memory device 2904 may include groups of memory cells 2910 .
  • the interface device 2906 is electrically connected to the chip 2902 in the chip package structure.
  • the interface device 2906 is used to realize data transmission between the chip 2902 and an external device 2912 (such as a server or a computer).
  • the interface device 2906 is a standard PCIe interface, and the data to be processed is transmitted from the server to the chip 2902 through the standard PCIe interface to realize data transfer.
  • the calculation result of the chip 2902 is also sent back to the external device 2912 by the interface device 2906 .
  • the control device 2908 is electrically connected to the chip 2902 to monitor the state of the chip 2902. Specifically, the chip 2902 and the control device 2908 may be electrically connected through an SPI interface.
  • the control device 2908 may include a Microcontroller ("MCU", Micro Controller Unit).
  • electronic equipment or devices may include data processing devices, robots, computers, printers, scanners, tablet computers, smart terminals, mobile phones, driving recorders, navigators, sensors, cameras, servers, cloud servers, cameras , cameras, projectors, watches, headphones, mobile storage, wearables, vehicles, home appliances, and/or medical equipment.
  • the vehicles include airplanes, ships and/or vehicles;
  • the household appliances include televisions, air conditioners, microwave ovens, refrigerators, rice cookers, humidifiers, washing machines, electric lamps, gas stoves, and range hoods;
  • the medical equipment includes nuclear magnetic resonance instruments, B-ultrasound and/or electrocardiograph.
  • Another embodiment of the present disclosure is a computer-readable storage medium on which serialized or deserialized computer program code is stored, and when the computer program code is executed by a processor, the aforementioned method is performed.
  • the present disclosure can realize the hot migration of virtual specific functions and virtual hardware drivers, firmware and hardware information, context information and state information in the source server to the destination server, which utilizes serialization technology to generate information to be migrated to facilitate transmission , the destination server deserializes the information to be migrated based on the same protocol, and restores its configuration and data.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Computer Hardware Design (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本公开涉及实现热迁移的设备及方法,其中本公开的片上系统包括在集成电路装置中,该集成电路装置包括通用互联接口和其他处理装置。计算装置与其他处理装置进行交互,共同完成用户指定的计算操作。集成电路装置还可以包括存储装置,存储装置分别与计算装置和其他处理装置连接,用于计算装置和其他处理装置的数据存储。摘要附图:图28

Description

实现热迁移的设备及方法
相关申请的交叉引用
本申请要求以下专利申请案的优先权,在此将其全文引入作为参考:于2020年9月28日申请的,申请号为202011045832.7,名称为“实现热迁移的方法、装置和存储介质”的中国专利申请;于2020年9月28日申请的,申请号为202011045841.6,名称为“实现热迁移的装置、相关方法和其可读存储介质”的中国专利申请;于2020年9月28日申请的,申请号为202011043863.9,名称为“实现序列化及反序列化树数据的装置、方法、和存储介质”的中国专利申请;于2020年9月28日申请的,申请号为202011043849.9,名称为“实现序列化及反序列化嵌套数据的方法、装置和存储介质”的中国专利申请;以及于2020年9月28日申请的,申请号为202011043865.8,名称为“实现序列化及反序列化逻辑指针的方法、装置和存储介质”的中国专利申请。
技术领域
本公开一般涉及计算机领域。更具体地,本公开涉及一种实现热迁移的设备及方法。
背景技术
热迁移(Live Migration)又称为动态迁移、实时迁移,即虚拟机通过保存(SAVE)/恢复(LOAD)的程序,将整个虚拟机的运行状态完整保存下来,从一台物理服务器迁移到另一台物理服务器上。恢复以后,虚拟机仍旧平滑运行,用户不会察觉到任何差异。
在人工智能领域中,由于专用集成电路(ASIC)的复杂度高,以至于无法完全实现热迁移。特别是在热迁移过程中,源服务器如何序列化信息以及目的服务器如何反序列化信息,是现有技术中需要解决的问题。
发明内容
为了至少部分地解决背景技术中提到的技术问题,本公开的方案提供了一种实现热迁移的设备及方法。
根据本公开的第一方面,提供一种实现热迁移保存的系统,连接至内 核空间,包括:只读存储装置及串化装置。只读存储装置存储有固件,所述固件包括物理功能,虚拟化为多个虚拟功能,所述物理功能接收来自所述内核空间的热迁移启动请求,所述热迁移启动请求指定热迁移特定虚拟功能,所述特定虚拟功能为所述多个虚拟功能其中之一。串化装置用以响应所述热迁移启动请求以生成待迁移信息的数据结构,所述数据结构包括协议层,所述协议层包括域标识符,用以记载所述特定虚拟功能。其中,所述物理功能发送所述待迁移信息至所述内核空间。
根据本公开的另一方面,提供一种实现热迁移恢复的系统,连接至内核空间,包括:只读存储装置及解串装置。只读存储装置存储有固件,所述固件包括物理功能,虚拟化为多个虚拟功能,所述物理功能接收待迁移信息,所述待迁移信息的数据结构包括协议层,所述协议层包括域标识符。解串装置用以:自所述域标识符中取出特定虚拟功能的信息,所述特定虚拟功能为所述多个虚拟功能其中之一;以及将所述待迁移信息恢复至所述特定虚拟功能中。
根据本公开的另一方面,提供一种对系统进行热迁移保存路径的方法,所述系统连接至内核空间并包括只读存储装置,所述只读存储装置存储有固件,所述固件包括物理功能,所述物理功能虚拟化为多个虚拟功能,所述方法包括:接收热迁移启动请求,所述热迁移启动请求指定热迁移特定虚拟功能,所述特定虚拟功能为所述多个虚拟功能其中之一;生成待迁移信息的数据结构,所述数据结构包括域标识符,用以记载所述特定虚拟功能;以及发送所述待迁移信息至所述内核空间。
根据本公开的另一方面,提供一种对系统进行热迁移恢复路径的方法,所述系统连接至内核空间并包括只读存储装置,所述只读存储装置存储有固件,所述固件包括物理功能,所述物理功能虚拟化为多个虚拟功能,所述方法包括:接收待迁移信息,所述待迁移信息的数据结构包括域标识符;自所述域标识符中取出特定虚拟功能的信息,所述特定虚拟功能为所述多个虚拟功能其中之一;以及将所述待迁移信息恢复至所述特定虚拟功能中。
根据本公开的另一方面,提供一种实现热迁移保存的系统,包括串化装置,用以:响应热迁移启动请求以生成待迁移信息的数据结构,所述待迁移信息包括结构体;在所述数据结构中生成符号标识符,用以标记所述结构体;以及在所述符号标识符中置入前缀符号及所述结构体的名称。
根据本公开的另一方面,提供一种实现热迁移恢复的系统,包括:只读存储装置及解串装置。只读存储装置存储有固件,所述固件包括物理功能,虚拟化为多个虚拟功能,所述物理功能接收待迁移信息,所述待迁移 信息包括结构体,所述待迁移信息的数据结构包括符号标识符,用以标记所述结构体,所述符号标识符包括前缀符号及所述结构体的名称。解串装置用以根据所述前缀符号识别所述结构体的名称。
根据本公开的另一方面,提供一种生成待迁移信息的数据结构的方法,包括:接收热迁移启动请求;响应所述热迁移启动请求,生成所述数据结构,所述待迁移信息包括结构体,所述生成所述数据结构的步骤包括:生成符号标识符,用以标记所述结构体,所述符号标识符包括前缀符号及所述结构体的名称;以及发送所述待迁移信息。
根据本公开的另一方面,提供一种判读待迁移信息的方法,包括:接收所述待迁移信息,所述待迁移信息包括结构体,所述待迁移信息的数据结构包括符号标识符,用以标记所述结构体,所述符号标识符包括前缀符号及所述结构体的名称;识别所述前缀符号;以及根据所述前缀符号识别所述结构体的名称。
根据本公开的另一方面,提供一种序列化树数据的系统,包括:内存及串化装置。内存用以存储所述树数据。串化装置用以:响应热迁移启动请求以生成待迁移信息,所述待迁移信息的数据结构包括数值标识符;依特定顺序遍历所述树数据,以形成序列化数据;以及将所述序列化数据置入所述数值标识符中。
根据本公开的另一方面,提供一种反序列化树数据的系统,包括解串装置及内存。解串装置用以:接收待迁移信息,所述待迁移信息的数据结构包括数值标识符;自所述数值标识符中取出序列化数据;以及依特定顺序还原成所述树数据。内存用以存储所述树数据。
根据本公开的另一方面,提供一种序列化树数据的方法,包括:响应热迁移启动请求以生成待迁移信息,所述待迁移信息的数据结构包括数值标识符;依特定顺序遍历所述树数据,以形成序列化数据;以及将所述序列化数据置入所述数值标识符中。
根据本公开的另一方面,提供一种反序列化树数据的方法,包括:接收待迁移信息,所述待迁移信息的数据结构包括数值标识符;自所述数值标识符中取出序列化数据;依特定顺序还原成所述树数据;以及将所述树数据存储至内存。
根据本公开的另一方面,提供一种序列化嵌套数据的系统,所述嵌套数据至少包括第一层结构体及第二层结构体,所述系统包括:内存及串化装置。内存用以存储所述嵌套数据。串化装置用以响应热迁移启动请求以生成待迁移信息,所述待迁移信息的数据结构包括:数据结构层,包括第 一符号标识符,用以记载所述第一层结构体的名称;以及序列化层,包括第二符号标识符,用以记载所述第二层结构体的名称。
根据本公开的另一方面,提供一种反序列化嵌套数据的系统,所述嵌套数据至少包括第一层结构体及第二层结构体,所述系统包括:解串装置及内存。解串装置用以:接收待迁移信息,所述待迁移信息的数据结构包括:数据结构层,包括第一符号标识符;以及序列化层,包括第二符号标识符;根据所述第一符号标识符取出第一序列化数据;根据所述第二符号标识符取出第二序列化数据;将所述第一序列化数据还原成所述第一层结构体;以及将所述第二序列化数据还原成所述第二层结构体。内存用以存储所述第一层结构体及所述第二层结构体。
根据本公开的另一方面,提供一种序列化嵌套数据的方法,所述嵌套数据至少包括第一层结构体及第二层结构体,所述方法包括:响应热迁移启动请求,生成待迁移信息,所述生成待迁移信息的步骤包括:在所述待迁移信息的数据结构层中生成第一符号标识符,用以记载所述第一层结构体的名称;以及在所述待迁移信息的序列化层中生成第二符号标识符,用以记载所述第二层结构体的名称。
根据本公开的另一方面,提供一种反序列化嵌套数据的方法,所述嵌套数据至少包括第一层结构体及第二层结构体,所述方法包括:接收待迁移信息,所述待迁移信息的数据结构包括:数据结构层,包括第一符号标识符;以及序列化层,包括第二符号标识符;根据所述第一符号标识符取出第一序列化数据;根据所述第二符号标识符取出第二序列化数据;将所述第一序列化数据还原成所述第一层结构体;将所述第二序列化数据还原成所述第二层结构体;以及存储所述第一层结构体及所述第二层结构体。
根据本公开的另一方面,提供一种序列化逻辑指针的系统,包括:内存及串化装置。内存用以存储第一结构体及第二结构体。串化装置用以:响应热迁移启动请求以生成待迁移信息;在所述待迁移信息的数据结构中生成第一符号标识符及第一实体标识符;在所述第一符号标识符中置入所述第一结构体的名称;以及在所述第一实体标识符中置入所述逻辑指针的名称,所述逻辑指针的名称为所述第二结构体的名称。
根据本公开的另一方面,提供一种反序列化逻辑指针的系统,包括解串装置,用以:接收待迁移信息,所述待迁移信息的数据结构包括第一符号标识符及第一实体标识符;自所述第一符号标识符中取出所述第一结构体的名称;以及自所述第一实体标识符中取出所述第二结构体的名称。
根据本公开的另一方面,提供一种序列化逻辑指针的方法,所述逻辑 指针将第一结构体与第二结构体建立关联,所述方法包括:响应热迁移启动请求以生成待迁移信息;在所述待迁移信息的数据结构中生成第一符号标识符及第一实体标识符;在所述第一符号标识符中置入所述第一结构体的名称;以及在所述第一实体标识符中置入所述第二结构体的名称。
根据本公开的另一方面,提供一种反序列化逻辑指针的方法,包括:接收待迁移信息,所述待迁移信息的数据结构包括第一符号标识符及第一实体标识符;自所述第一符号标识符中取出所述第一结构体的名称;以及自所述第一实体标识符中取出所述第二结构体的名称。
本公开可以实现将源服务器上的信息序列化,并在目的服务器上反序列化信息,达到热迁移的技术效果。
附图说明
通过参考附图阅读下文的详细描述,本公开示例性实施方式的说明以及其他目的、特征和优点将变得易于理解。在附图中,以示例性而非限制性的方式示出了本公开的若干实施方式,并且相同或对应的标号表示相同或对应的部分,其中:
图1是示出本公开实施例的人工智能芯片框架的示意图;
图2是示出本公开实施例的计算装置的内部结构示意图;
图3是本公开实施例的迁移保存路径的流程图;
图4是示出本公开实施例的源服务器端进行迁移保存路径的示意图;
图5是示出待迁移信息的数据结构示意图;
图6是示出本公开实施例的结构体在数据结构层的示意图;
图7是示出本公开实施例的示例性的树数据;
图8是示出本公开实施例遍历树数据时所得序列化数据;
图9是示出嵌套数据序列化时所生成的数据结构;
图10是示出串化装置将包括逻辑指针的结构体序列化成待迁移信息的示意图;
图11是示出生成待迁移信息的数据结构的流程图;
图12是示出生成待迁移信息的数据结构的流程图;
图13是示出本公开实施例序列化树数据的流程图;
图14是示出本公开实施例生成待迁移信息的流程图;
图15是示出本公开实施例序列化逻辑指针的流程图;
图16是示出本公开实施例的迁移恢复路径的流程图;
图17是示出本公开实施例的目的服务器端进行迁移恢复路径的示意 图;
图18是示出本公开实施例的解串装置实现热迁移恢复路径的流程图;
图19是示出本公开实施例的解串装置反序列化协议层的流程图;
图20是示出本公开实施例的反序列化组态信息的流程图;
图21是示出本公开实施例的反序列化数据信息的流程图;
图22是示出本公开实施例的识别或取出序列化层的信息的流程图;
图23是示出本公开实施例的反序列化树数据的流程图;
图24是示出本公开实施例的反序列化嵌套数据的流程图;
图25是示出本公开实施例的嵌套数据的示意图;
图26是示出本公开实施例识别或取出第二层结构体的信息的流程图;
图27是示出本公开实施例的反序列化逻辑指针的流程图;
图28是示出本公开实施例的集成电路装置的结构图;以及
图29是示出本公开实施例的板卡的示意图。
具体实施方式
下面将结合本公开实施例中的附图,对本公开实施例中的技术方案进行清楚、完整地描述。所描述的实施例是本公开一部分实施例,而不是全部的实施例。基于本公开中的实施例,本领域技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本公开保护的范围。
应当理解,本公开的权利要求、说明书及附图中的术语“第一”、“第二”、“第三”和“第四”等是用于区别不同对象,而不是用于描述特定顺序。本公开的说明书和权利要求书中使用的术语“包括”和“包含”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。
还应当理解,在此本公开说明书中所使用的术语仅仅是出于描述特定实施例的目的,而并不意在限定本公开。如在本公开说明书和权利要求书中所使用的那样,除非上下文清楚地指明其它情况,否则单数形式的“一”、“一个”及“该”意在包括复数形式。还应当进一步理解,在本公开说明书和权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。
如在本说明书和权利要求书中所使用的那样,术语“如果”可以依据上下文被解释为“当...时”或“一旦”或“响应于确定”或“响应于检测到”。
下面结合附图来详细描述本公开的具体实施方式。
本公开涉及一种采用虚拟化技术的框架,应用在专用集成电路上,例如用于神经网络的机器学习设备上,该机器学习设备可以是卷积神经网络加速器。以下将以人工智能芯片示例说明。
图1是人工智能芯片虚拟化的框架图,该框架100包括用户空间102、内核空间104及片上系统106,在图上以虚线区隔开。用户空间102为用户程序的运行空间,只执行简单的运算,不能直接调用系统资源,必须通过系统接口,才能向内核空间104发出指令。内核空间104是内核代码运行的空间,可以执行任意命令,调用系统的一切资源。片上系统106为人工智能芯片的各模块,通过内核空间104与用户空间102进行协作。
在此实施例中,用户空间102的硬件统一称之为器或设备,片上系统106的硬件统一称之为装置或单元,作为区分。这样的安排只为了更清楚的描述此实施例的技术,并非对本公开的技术做任何的限制。
除非另行强调,此实施例以将一个实体部件虚拟化为四个虚拟部件来示例说明,但本公开不限制虚拟部件的数量。
用户空间102在未运行虚拟化前,是由硬件监测器工具108所控制,通过调用接口获取片上系统106的信息。硬件监测器工具108不仅可以采集片上系统106的信息,还可以实时获取上层软件对片上系统106资源的开销,为用户实时掌握当前片上系统106的详细信息和状态,这些详细信息和状态可以是:硬件设备型号、固件版本号、驱动版本号、设备利用率、存储装置开销状态、板卡功耗和板卡峰值功耗、快速外设组件互连(PCIe)等数十种数据。基于硬件监测器工具108的版本及使用场景的不同,所监测的信息内容及数量会有所差异。
在系统启动虚拟化后,用户空间102的操作改由用户虚拟机110接管,用户虚拟机110是对真实计算环境的抽象和模拟,系统会分配一套数据结构来管理用户虚拟机110的状态,其数据结构包括全套寄存器、物理内存的使用情况、虚拟设备的状态等等。此实施例的用户空间102的物理空间虚拟化为四个虚拟空间112、114、116、118,这四个虚拟空间112、114、116、118独立互不影响,可分别搭载不同的客户操作系统,如图中所示的客户操作系统1、客户操作系统2、客户操作系统3及客户操作系统4,客户操作系统可以是Windows、Linux、Unix、iOS、安卓等,每个客户操作系统上分别运行不同的应用程序。
在本公开的环境里,用户虚拟机110是以快速仿真器(QEMU)来实现。QEMU是一个用C语言编写的开源虚拟化软件,通过动态二进制转换 将接口虚拟化,并提供一系列的硬件模型,使得客户操作系统1、客户操作系统2、客户操作系统3、客户操作系统4都认为自己直接访问片上系统106。用户空间102包括处理器、存储器、I/O设备等,QEMU可以将用户空间102的处理器虚拟化为四个虚拟处理器,并将存储器虚拟化为四个虚拟存储器,亦将I/O设备的虚拟化为四个虚拟I/O设备。每个客户操作系统各占用一部分用户空间102的资源,例如各占四分之一,也就是分别能访问一个虚拟处理器、一个虚拟存储器及一个虚拟I/O设备,以执行该客户操作系统的任务。通过这种模式,客户操作系统1、客户操作系统2、客户操作系统3、客户操作系统4就能独立运作。
内核空间104载有内核虚拟机120及芯片驱动程序122。内核虚拟机120与QEMU搭配,主要负责内核空间104及片上系统106的虚拟化,使得每个客户操作系统在访问片上系统106时都能获得自己的地址空间。更详细来说,映射给客户操作系统的片上系统106上的空间实际上是映射给这个进程的虚拟部件。
内核虚拟机120包括物理功能驱动程序,是一个专门管理SR-IOV设备全局功能的驱动程序,一般需要具有比普通虚拟机更高的权限才能对其进行操作。物理功能驱动程序包含了所有传统驱动程序的功能,使得用户空间102能够访问片上系统106的I/O资源。
从用户虚拟机110的角度来看,在虚拟机运行期间,QEMU通过内核虚拟机120提供的系统调用接口进行内核设置,QEMU使用了内核虚拟机120的虚拟化功能,为自己的虚拟机提供硬件虚拟化加速以提高虚拟机的性能。从内核虚拟机120的角度来看,当用户无法直接跟内核空间104交互时,需要借助用户空间102的管理工具,因此需要借助QEMU这个运行在用户空间102的工具。
芯片驱动程序122用以驱动物理功能(physical function,PF)126,在虚拟机运行期间,用户空间102不由硬件监测器工具108经芯片驱动程序122来访问片上系统106,因此客户操作系统1、客户操作系统2、客户操作系统3、客户操作系统4分别组态有用户端内核空间124,用以载入芯片驱动程序122,使得各客户操作系统依然可以驱动片上系统106。
片上系统106是通过单根I/O虚拟化(single root I/O virtualization,SR-IOV)技术来执行虚拟化的,更详细来说,在本公开的环境里,SR-IOV技术是以软硬件结合实现的,使得片上系统106的各部件虚拟化。SR-IOV技术是一种虚拟化解决方案,允许在虚拟机之间高效共享PCIe资源,SR-IOV技术使得单个PCIe资源可由片上系统106的多个虚拟部件共享, 为这些虚拟部件提供专用的资源。这样,每个虚拟部件都有自己对应的唯一可访问的资源。
此实施例的片上系统106包含硬件和固件。硬件包括只读存储装置ROM(未显示于图中),用以存储固件,而固件包括物理功能126,用于支持或协作SR-IOV的PCIe功能,物理功能126拥有完全组态PCIe资源的权力。在实施SR-IOV技术时,物理功能126会虚拟化出多个虚拟功能(virtual function,VF)128,在此实施例中为四个虚拟功能128。虚拟功能128是一种轻量级PCIe功能,受物理功能126管理,可与物理功能126以及与同一物理功能126关联的其他虚拟功能128共享PCIe物理资源。虚拟功能128仅允许控制物理功能126组态给自己的资源。
一旦在物理功能126中启用了SR-IOV,各个虚拟功能128就可以通过自身的总线、设备和功能编号去访问自己的PCIe组态空间。每个虚拟功能128都具有一个内存空间,用于映射其寄存器集。虚拟功能128驱动程序对寄存器集进行操作以启用其功能,并直接指定给对应的用户虚拟机110。虽然是虚拟的,但会让用户虚拟机110认为是实际存在的PCIe设备。
片上系统106的硬件还包括计算装置130、视频编解码装置132、JPEG编解码装置134、存储装置136及PCIe 138。在此实施例中,计算装置130为智能处理装置(intelligent processing unit,IPU),用以执行神经网络的卷积计算;视频编解码装置132用以对视频数据进行编解码;JPEG编解码装置134用以对采用JPEG算法的静态图片进行编解码;存储装置136可以为动态随机存取存储器(DRAM),用以存储数据;PCIe 138即为前述的PCIe,在虚拟机运行期间,PCIe 138会虚拟化为四个虚拟接口140,虚拟功能128与虚拟接口140为一对一对应关系,也就是第一虚拟功能对接第一虚拟接口,第二虚拟功能对接第二虚拟接口,以此类推。
通过SR-IOV技术,计算装置130虚拟化为四个虚拟计算装置142、将视频编解码装置132虚拟化为四个虚拟视频编解码装置144、将JPEG编解码装置134虚拟化为四个虚拟JPEG编解码装置146、将存储装置136虚拟化为四个虚拟存储装置148。
每个客户操作系统分别配置一组虚拟套件,每组虚拟套件包括一个用户虚拟机110、一个虚拟接口140、一个虚拟功能128、一个虚拟计算装置142、一个虚拟视频编解码装置144、一个虚拟JPEG编解码装置146及一个虚拟存储装置148。每组虚拟套件各自独立运行互不影响,用来执行相对应的客户操作系统所交付的任务,以确定每个客户操作系统能通过所组态的虚拟接口140及虚拟功能128访问所配置的虚拟计算装置142、虚拟 视频编解码装置144、虚拟JPEG编解码装置146及虚拟存储装置148。
更详细来说,每个客户操作系统在执行任务时,响应任务的不同,所需访问的硬件可能也不同,例如:某个任务是进行矩阵卷积计算,则该客户操作系统会通过所配置的虚拟接口140及虚拟功能128访问所配置的虚拟计算装置142;如某个任务是进行视频编解码,则该客户操作系统会通过所配置的虚拟接口140及虚拟功能128访问所配置的虚拟视频编解码装置144;如某个任务是进行JPEG编解码,则该客户操作系统会通过所配置的虚拟接口140及虚拟功能128访问所配置的虚拟JPEG编解码装置146;如某个任务是读取或写入数据,则该客户操作系统会通过所配置的虚拟接口140及虚拟功能128访问所配置的虚拟存储装置148。
图2示出了一种多核计算装置130的内部结构示意图。计算装置130共有十六个处理单元核(处理单元核0至处理单元核15),用于执行矩阵计算任务,每四个处理单元核组成一个处理单元组,也就是集群(cluster)。更详细来说,处理单元核0至处理单元核3组成第一集群202,处理单元核4至处理单元核7组成第二集群204,处理单元核8至处理单元核11组成第三集群206,处理单元核12至处理单元核15组成第四集群208。计算装置130基本上是以集群为单元执行计算任务。
计算装置130还包括存储单元核210及共享存储单元212。存储单元核210主要用于控制数据交换,作为计算装置130与存储装置136沟通的渠道。共享存储单元212用以暂存这些集群202、204、206、208的计算中间值。在虚拟化运行期间,存储单元核210会切分为四个虚拟存储单元核,共享存储单元212也同样会切分为四个虚拟共享存储单元。
每个虚拟计算装置142分别配置一个虚拟存储单元核、一个虚拟共享存储单元以及一个集群,以支撑特定客户操作系统的任务。同样地,每个虚拟计算装置142各自独立运作,互不影响。
计算装置130的集群数量至少应与虚拟计算装置142的数量相同,以确保每个虚拟计算装置142能配置一个集群,当集群数量多于虚拟计算装置142的数量时,便可以根据实际需求,将集群适当地配置给虚拟计算装置142,以增加硬件配置弹性。
此实施例的视频编解码装置132包括六个视频编解码单元。视频编解码装置132可以弹性地根据虚拟部件的数量以及所需资源,以视频编解码单元为单位做弹性的调配。例如:视频编解码装置132虚拟化为四个虚拟视频编解码装置144,假设第一虚拟视频编解码装置及第二虚拟视频编解码装置需要较多的视频编解码资源,则可以分别配置两个视频编解码单元 给第一虚拟视频编解码装置及第二虚拟视频编解码装置,而分别配置一个视频编解码单元给其他虚拟视频编解码装置144。又例如:视频编解码装置132虚拟化为三个虚拟视频编解码装置144,在任一个虚拟视频编解码装置均不需要较多的视频编解码资源的情况下,则可以分别配置两个视频编解码单元给每个虚拟视频编解码装置144。
视频编解码单元的数量至少应与虚拟视频编解码装置144的数量相同,以确保每个虚拟视频编解码装置144能配置一个视频编解码单元,当视频编解码单元数量多于虚拟视频编解码装置144的数量时,便可以根据实际需求,将视频编解码单元适当地配置给虚拟视频编解码装置144,以增加硬件配置弹性。
同样地,此实施例的JPEG编解码装置134包括六个JPEG编解码单元。JPEG编解码装置134可以弹性地根据虚拟部件的数量以及所需资源,以JPEG编解码单元为单位做弹性的调配,其调配方式与视频编解码装置132无异,故不赘述。
存储装置136可以采用非统一内存存取(non-uniform memory access,NUMA)架构,包括多个DDR通道,存储装置136可以弹性地根据虚拟部件的数量以及所需资源,以DDR通道为单位做弹性的调配,其调配方式与计算装置130、视频编解码装置132及JPEG编解码装置134无异,故不赘述。
本公开的一种应用场景是云端的数据中心。数据中心需要进行维护工作,以确保整个系统的稳定性及流畅度,这些维护工作涉及到计算机共享、数据库备份、故障排除、资源分配不均(如负载过重、负载过轻)和日常维护等。数据中心在进行前述的维护工作的同时,又必须确保系统的正常运作,使得用户不会察觉到任何差异。本公开基于图1和图2的架构,实现一种热迁移技术,将整个虚拟机的运行状态完整保存下来,并快速的恢复到原有硬件平台甚至是不同硬件平台上。恢复以后,虚拟机仍旧平滑运行。
基于前述示例性的框架,本公开的热迁移方案分为两阶段:第一阶段是将源服务器上的组态及数据打包并发送至目的服务器,即迁移保存路径;第二阶段是将这些组态及数据放置到目的服务器的相应处,即迁移恢复路径。此热迁移方案是将整个虚拟机的运行状态及数据完整保存下来,再快速恢复到原有硬件平台甚至是不同硬件平台上。不论是否在同一个平台上,源服务器和目的服务器都具有如图1和图2所示的架构,且目的服务器的硬件、软件、固件版本需等于或高于源服务器的硬件、软件、固件版本, 以确保在迁移恢复时目的服务器能正确识别信息。热迁移方案的两阶段将分别说明之。
图3是示出本公开的另一个实施例,其为迁移保存路径的流程图,此实施例的源服务器可以是图1所揭示的系统,图4则示出具有图1架构的源服务器进行迁移保存路径的示意图。此实施例在用户空间102仍在运行时将片上系统106上的特定虚拟硬件相关的驱动程序、固件和硬件信息、上下文信息及其状态信息打包好自源服务器送出,所述的“状态信息”可以包括虚拟功能的驱动程序的状态信息、固件和硬件的状态信息、状态机、寄存器、硬件内部状态的上下文状态信息、软件的状态机、变量、常量运行时的上下文状态信息等。
在步骤301中,虚拟化管理软件向仿真虚拟机QEMU 402发起迁移请求。此实施例的虚拟化管理软件是Libvirt 401,Libvirt 401是一种用于管理虚拟化平台的开源应用程序编程接口(API)、后台程序和管理工具,它可以用来管理QEMU 402的虚拟化技术。当片上系统106出现如前所述的需要维护情况时,Libvirt 401便会启动热迁移来保证虚拟机业务的正常运行。
在步骤302中,QEMU 402通知物理功能驱动程序403启动迁移,即QEMU 402初始化热迁移启动请求。此实施例提供一种模型来管理整个迁移保存路径的过程,该模型为虚拟机器学习单元QEMU对象模型(VMLU QOM)404,其中虚拟机器学习单元指的是针对图1所示的虚拟化人工智能片上系统106,而QEMU对象模型则是模拟PCIe。
更详细来说,VMLU QOM 404的作用是在QEMU 402中添加一个虚拟PCIe设备,作为QEMU对象模型注册到QEMU 402里,并向QEMU 402表明具备热迁移能力,同时提供热迁移相关的调度例程(dispatch routine)函数,如此QEMU 402在热迁移时才能顺利调度。在此步骤中,QEMU 402通过调度例程函数对物理功能驱动程序403进行操作,以通知并控制物理功能驱动程序403配合展开热迁移。
至于用户空间102和物理功能驱动程序403之间的互动,便是通过VMLU QOM 404的内存映射I/O(Memory mapping I/O,MMIO)实现的。内存映射I/O是PCI规范的一部分,I/O设备被放置在内存空间而不是I/O空间。从用户空间102的处理器的角度来看,内存映射I/O后系统访问其他设备是与访问内存相同的,简化了程序设计的难度和接口的复杂性。
在此步骤中,QEMU 402中的VMLU QOM 404初始化热迁移启动请求,并将热迁移启动请求发送至物理功能驱动程序403。
在步骤303中,物理功能驱动程序403通知虚拟功能驱动程序405启动迁移。虚拟功能驱动程序405存储在虚拟机内核空间中,对用户空间102而言,基于在热迁移的过程中它所见到的就是前述的虚拟PCIe设备,有可读写的内存映射I/O空间,虚拟功能驱动程序405对内存映射I/O空间(即片上系统106)的读和写操作会被VMLU QOM 404捕捉并管理。对于读操作,VMLU QOM 404可以根据虚拟功能驱动程序405的需要返回应返回的值,使得虚拟功能驱动程序405和物理功能驱动程序403之间同步。
VMLU QOM 404通过调用物理功能驱动程序403的接口获取物理功能驱动程序403的迁移状态。当虚拟功能驱动程序405欲读取VMLU QOM404的内存映射I/O空间时,VMLU QOM 404便将物理功能406的状态返回给虚拟功能驱动程序405,在此步骤中,VMLU QOM 404将物理功能驱动程序403准备进行热迁移的状态传递至虚拟功能驱动程序405。
在步骤304中,虚拟功能驱动程序405暂停执行来自用户空间102的任务。此实施例所采取的方式是,虚拟功能驱动程序405不把处理器的控制权返还给用户空间102的应用程序,客户操作系统便会继续等待,不会发出下一个任务给虚拟功能驱动程序405,以暂停执行用户空间102的任务。
在步骤305中,虚拟功能驱动程序405通知物理功能驱动程序403准备进行迁移。当暂停执行来自用户空间102的指令后,虚拟功能驱动程序405通知物理功能驱动程序403用户空间102已准备就绪,在热迁移期间不会有指令下发干扰。
在步骤306中,物理功能驱动程序403通知物理功能406准备进行迁移。物理功能驱动程序403发送热迁移启动请求至物理功能406,所述热迁移启动请求指定特定虚拟硬件408进行热迁移。特定虚拟硬件408为片上系统106多个虚拟硬件其中之一,为说明方便,在此假设热迁移启动请求是针对特定虚拟功能407及其相对应的特定虚拟硬件408。
特定虚拟硬件408可以是特定的虚拟计算装置,例如图1中的虚拟计算装置142,则待迁移信息包括虚拟计算装置142的组态、存储在虚拟共享存储单元的计算中间值,以及存储在虚拟存储单元核的数据等。特定虚拟硬件408也可以是图1的特定虚拟存储装置148,则待迁移信息包括存储在特定虚拟存储装置148的数据。特定虚拟硬件408还可以是虚拟视频编解码装置144或是虚拟JPEG编解码装置146,则待迁移信息包括虚拟视频编解码装置144或虚拟JPEG编解码装置146的组态,以及相应的 编解码信息。
在步骤307中,物理功能406向物理功能驱动程序403上传包括特定虚拟功能407的驱动程序、固件和特定虚拟硬件408的信息、上下文信息及其状态信息的数据。首先,物理功能406发送指令至内核空间104的物理功能驱动程序403,所述指令记录了与特定虚拟硬件408有关的信息,使物理功能驱动程序403知悉有多少数据需要迁移。此时VMLU QOM 404处于停止-复制(stop and copy)阶段,不会为用户空间102分配物理资源,用户空间102自然没有时间片运行程序,进而中断用户空间102与特定虚拟功能407的联系,但其他的虚拟功能及其相对应的虚拟硬件则照常运行。在闲置特定虚拟功能407后,物理功能406自特定虚拟硬件408分批取出待迁移信息,并发送至物理功能驱动程序403。当待迁移信息发送完毕后,物理功能406发送结束信号至物理功能驱动程序403。
在步骤308中,VMLU QOM 404从物理功能驱动程序403获取待迁移信息。内核空间的物理功能驱动程序403将待迁移信息发送至VMLU QOM 404。
在步骤309中,VMLU QOM 404将待迁移信息嵌入待迁移指令中,传输到Libvirt 401。
在步骤310中,当待迁移指令发送完毕后,物理功能406释放特定虚拟硬件408及特定虚拟功能407的资源,VMLU QOM 404发送结束信号至虚拟功能驱动程序405,虚拟功能驱动程序405发送控制信号至虚拟功能驱动程序的接口409,客户操作系统重启下发任务。结束整个迁移保存路径。
更详细来说,图4的系统还包括串化装置410,用以响应热迁移启动请求,在步骤307中把特定虚拟功能407的驱动程序、固件和特定虚拟硬件408的信息、上下文信息及其状态信息等数据序列化,以生成待迁移信息,上传至物理功能驱动程序403。此实施例的串化装置410可以利用硬件或固件来实现。如是硬件,串化装置410是配置在片上系统106中;如是固件,则存储在片上系统106的只读存储装置中。
为了确保目的服务器能顺利完成迁移恢复路径,在步骤307中生成的待迁移信息必须依循协议,源服务器基于该协议生成待迁移信息,目的服务器根据该协议判读待迁移信息,才能正确恢复组态和数据。为了完整描述特定虚拟功能407和特定硬件408的状态及数据,此实施例的协议规范的待迁移信息的数据结构如图5所示,串化装置410在此协议下生成三层框架:协议层51、数据结构层52及序列化层53。
协议层51用以记载待迁移信息的协议版本、数据的归属、长度等信息。在此实施例中,串化装置410在协议层51生成10个标识符,分别是幻数标识符501、版本标识符502、请求响应标识符503、命令标识符504、序号标识符505、数据来源标识符506、字节标识符507、域标识符508、保留标识符509、载荷标识符510。以下就这些标识符的作用进行示例性的说明。
幻数标识符501设置为4字节,用来标记待迁移信息的开始,更具体来说,幻数标识符501的字元是固定的,当目的服务器收到某个指令时,只要识别到幻数标识符501里的字元,就能知悉此为待迁移信息,进而启动迁移恢复路径的运行。
版本标识符502设置为2字节,用以标记待迁移信息的版本。如前所述,倘若源服务器的系统版本与目的服务器的系统版本不一致,特别是源服务器的系统版本高于目的服务器的系统版本时,会产生兼容性的问题,为了使目的服务器可以判断兼容性,协议层51利用版本标识符502来记载待迁移信息版本,也就是记载源服务器的系统版本。
请求响应标识符503设置为1字节,用以表示该指令是请求或响应。
命令标识符504设置为1字节,用以标示待迁移信息的任务种类,此实施例的任务种类包括迁移状态/数据和更新数据字典。迁移状态和数据已在前说明,不再赘述。数据字典是指对数据的数据项、数据结构、数据流、数据存储、处理逻辑等进行定义和描述,其目的是对数据的各个元素做出详细的说明。简而言之,数据字典是描述数据的信息集合,是对系统中使用的所有数据元素的定义的集合。更新数据字典便是更新数据的数据项、数据结构、数据流、数据存储、处理逻辑等进行定义和描述。
序号标识符505设置为4字节,用以记载待迁移信息的流水号,该流水号对应各待迁移信息间的先后顺序。
数据来源标识符506设置为2字节,用以记载待迁移信息中的信息来自哪个装置,即图4中的特定硬件408,也就是特定虚拟功能407对应的欲进行热迁移的虚拟计算装置、虚拟视频编解码装置、虚拟JPEG编解码装置及虚拟存储装置至少其中之一。
字节标识符507设置为8字节,用以记录待迁移信息的总字节数或是有效载荷的总字节数。
域标识符508用以标记欲进行热迁移的特定虚拟功能,即图4中的特定虚拟功能407。
保留标识符509设置为2字节,保留为日后需要记载其他信息时使 用。
载荷标识符510则用以记载数据结构层52的信息。数据结构层52用于表示待迁移信息的组织结构。对于热迁移来说,通常不需要太过详细地描述数据拓扑以及数据结构之间的关联,原因是源服务器与目的服务器具有类似的甚至完全相同的框架,所以此实施例的数据结构层52不需记载太多的信息,只要让目的服务器有足够的信息来理解源服务器的待迁移信息即可。
本公开的待迁移信息分为两种,一种是组态,另一种是数据。
当待迁移信息是组态时,在此实施例中,串化装置410在数据结构层52中生成的协议框架如组态框架54所示,包括生成域标识符511、芯片标识符512、板卡标识符513、微控制器标识符514、固件标识符515、主机驱动标识符516、虚拟机标识符517、保留标识符518、计算装置标识符519、存储装置标识符520、视频编解码装置标识符521、JPEG编解码装置标识符522、PCIe标识符523及保留标识符524。
域标识符511用以标记特定虚拟功能407;芯片标识符512用以记载源服务器的芯片组型号;板卡标识符513用以记载源服务器的板卡版本或型号。
微控制器标识符514用以记载源服务器的微控制器的版本,微控制器在片上系统106中是一种通用控制元件,用来侦测或控制服务器环境的,例如侦测或控制服务器温度及工作频率等。
固件标识符515用以记载源服务器的固件版本;主机驱动标识符516用以记载源服务器的主机驱动软件版本;虚拟机标识符517用以记载源服务器的虚拟机驱动软件版本;保留标识符518和保留标识符524暂不使用,保留为日后需要记载其他信息时使用。
而计算装置标识符519、存储装置标识符520、视频编解码装置标识符521、JPEG编解码装置标识符522统称为特定装置标识符,用以记载图4中的特定硬件408的组态。更详细来说,计算装置标识符519用以记载源服务器的虚拟计算装置(如图1的虚拟计算装置142)的组态;存储装置标识符520用以记载源服务器的虚拟存储装置(如图1的虚拟存储装置148)的组态;视频编解码装置标识符521用以记载源服务器的虚拟视频编解码装置(如图1的虚拟视频编解码装置144)的组态;JPEG编解码装置标识符522用以记载源服务器的虚拟JPEG编解码装置(如图1的虚拟JPEG编解码装置146)的组态。
PCIe标识符523用以记载源服务器的虚拟接口(如图1的虚拟接口 140)的组态,此处虚拟接口指的是指派给特定虚拟功能407的PCIe虚拟接口。
当待迁移信息是数据信息时,这些数据信息原本存储在内存中,此处的内存为特定硬件408可以直接访问的虚拟存储单位,可能是虚拟计算装置142、虚拟视频编解码装置144或虚拟JPEG编解码装置146的内部存储空间,例如虚拟计算装置142中的虚拟共享存储单元,内存也可以是虚拟存储装置148。串化装置410会生成数据框架55来搭载信息。此实施例考虑到某些复杂的场景可能需要描述数据之间的关联,因此串化装置410采用特定符号来显示数据之间的关联性,使得目的服务器可以根据这些信息完整并准确地恢复数据。
数据结构层52所记载的数据信息可能是类型不同但是又相关的若干数据。此实施例的串化装置410根据数据之间的关联性,定义一种结构体,其包括至少一个类型,每个类型又是由至少一个变量(即数据)所组成。换言之,数个相关的变量集合成一个类型,数个相关的类型集合成一个结构体。这些结构体、类型、变量及其关系均存储在前述的内存中。
在标记结构体时,串化装置410会在结构体名称前面添加前缀,用来作为表述结构体的起始符号,在此实施例中用字符串作为前缀符号,前缀符号可以是任何非英文字母和数字的字符,像是“.”、“$”、“/”、“#”、“%”、“&”、“*”及“-”等。为方便说明,以下将统一使用英文句号“.”作为前缀符号。
具体来说,串化装置410所生成的数据框架55包括符号标识符525、类型标识符526、键标识符527及实体标识符528,这些标识符用来描述及记载结构体、类型及变量。
符号标识符525用以标记结构体或是数据框架55的开始,串化装置410根据协议在符号标识符525中置入前缀符号及结构体的名称。以结构体名称为“foo_nested”为例,其符号标识符525记载为“.foo_nested”。由于源服务器与目的服务器遵循相同协议,因此当目的服务器识别到前缀符号“.”时,便知悉前缀符号后紧跟着是结构体名称,且之后的标识符均是该结构体的相关描述。
类型标识符526用以记载该结构体下的各种类型,类型包括树、图像、链表、堆、整数及浮点数等。类型的名称可以由串化装置410所定义或是数据存储在内存中所使用的。例如将整数a(其值为20)与整数b(其值为10)定义为该结构体下的同一类型,而串化装置410将此类型命名为“foo_nested_t”,则类型标识符526便记载整数a与整数b的类别名称 “foo_nested_t”。
键标识符527用以记载在该类型下的变量名称。在标记变量时,根据协议,串化装置410会在变量名称前面添加前缀,其前缀为符号标识符525的内容加上前缀符号加上变量名称。以前述整数a与整数b为例,由于类型“foo_nested_t”具有2个变量整数a与整数b,因此串化装置410在数据框架55中先描述整数a,因此整数a的键标识符527为“.foo_nested.a”。实体标识符528接着记载变量的数值,整数a的数值为20,因此实体标识符528直接记载“20”。
由于类型“foo_nested_t”还有一个变量b,因此在描述整数a的键标识符527和实体标识符528后,会接续整数b的键标识符527和实体标识符528,分别记载“.foo_nested.b”及数值“10”。
此结构体“foo_nested”在数据结构层52的记载如图6所示。由前述说明可知,此实施例在待迁移信息中描述一个结构体时,先在符号标识符525记载结构体名称,在类型标识符526记载该结构体下的类型的名称,在键标识符527描述该类型下的变量名称,并在实体标识符528描述变量数值或字串。如果同一个类型具有多个变量,则在描述该类型的类型标识符526后重复键标识符527和实体标识符528,直到所有变量都描述完毕。倘若该结构体具有多个类型,则先描述第一个类型及第一个类型的所有变量,接着描述第二个类型及第二个类型的所有变量,以此类推,将该结构体的成员完整描述。
如果当变量是数值、字串、数列、列表等简单结构,则数据框架55已足够记载所有信息。当变量具有复杂结构时,实体标识符528会进一步展开成序列化层53,以将复杂结构序列化。回到图5,串化装置410在序列化层53下生成幻数标识符529、长度标识符530、字节次序标识符531、压缩标识符532、类型标识符533、键标识符534、计数标识符535、格式标识符536及数值标识符537。
幻数标识符529是特定字元,用以标示新数据段的开始,也就是序列化层53的开始,当目的服务器读取到幻数标识符529时,便能知悉接下来是序列化层53的信息并进行相应的处理。
长度标识符530用以表示该序列化层53的长度。
字节次序标识符531用以表示该序列化层53中的数据的存储字节序,一般是以大端模式或小端模式存储数据的。大端模式是指数据的高字节保存在内存的低地址中,而数据的低字节保存在内存的高地址中,这样的存储模式类似于把数据当作字符串顺序处理,即地址由小向大增加,而数据 从高位往低位存放。小端模式是指数据的高字节保存在内存的高地址中,而数据的低字节保存在内存的低地址中,这种存储模式将地址的高低和数据位有效地结合起来,高地址部分权值高,低地址部分权值低。
压缩标识符532用以标示数据信息的压缩形式。数据在进行传输时,会适当地进行压缩,以减少传输量,此实施例不限制压缩形式,但较佳的使用BDI(base delta immediate)压缩。
类型标识符533用以标示数据信息的类型。类型标识符533与类型标识符526所记载的内容不同,类型标识符526用以记载结构体下的各种类型,而类型标识符533用以标示数据本身的类型。
键标识符534用以标示类型标识符533中的类型下的变量名称。
计数标识符535用以标示类型标识符533中的类型下的变量数量。
格式标识符536用以标示类型标识符533中的类型下的变量格式,例如int 16、int 32及int 64分别表示变量是16位整数、32位整数或是64位整数。
数值标识符537则是记载变量的数值或字串。在此实施例中,如果某一变量存在多个数值,则在格式标识符536后直接接续多个数值标识符537以分别记载每个数值,例如某变量为内含128个数值的列表,则类型标识符533标示数据为列表,计数标识符535标示共有128个数值,而数值标识符537会有128个,分别存放所述128个数值。
较为复杂的数据像是树数据、嵌套数据或逻辑指针等需要使用序列化层53。所谓树数据指的是二叉树,是一种树形结构类型,二叉树是多个元素(又称节点)的集合,该集合或者为空、或者由一个称为根的元素及两个不相交的、被分别称为左子树和右子树的二叉树所组成,是有序树。图7示出示例性的树数据,包括节点701至707,其中各节点对应有数值,例如节点701的数值为20、节点702的数值为8等。嵌套数据指的是在已有的表格、图像、图层或函数中再加进去一个或多个表格、图像、图层或函数的数据格式。逻辑指针是一个结构体通过添加标识,指向另一个结构体,在结构体之间建立关联。以下将逐一说明串化装置410如何序列化树数据、嵌套数据或逻辑指针。
当数据为树数据时,串化装置410在幻数标识符529标示所述树数据的信息的开始,在长度标识符530记载该序列化层53的长度,在字节次序标识符531标示该树数据以大端模式或小端模式存储的,在压缩标识符532标示该树数据的压缩形式,在类型标识符533标示类型为二元树,在键标识符534标示了该树数据的变量名称,在计数标识符535标示该树 数据中的元素数量,在格式标识符536标示该树数据的元素格式。
数值标识符537则是记载该树数据的各元素数值,在记载这些数值时需要将树数据序列化,首先依特定顺序遍历此二元树,以形成序列化数据。所述特定顺序可以在协议里约定,为前序、中序、后序、逆后序其中之一,接着将遍历后的数值依序置入数值标识符537中。
前序遍历是对于当前树数据,先输出根节点,然后输出其左子树,依序直到没有左子树后,再输出其右子树。以图7的树数据为例,其根节点为节点701,故先记载节点701的数值20,再记载其左子树节点702的数值8,再记载其左子树节点703的数值4,节点703没有左子树,故记载NIL(表示为空),接着输出节点703的右子树,节点703也没有右子树,故再次记载NIL,往回到上一层节点702,其右子树为节点704,记载其值12,再记载其左子树节点705的数值10,节点705亦没有左子树和右子树,分别记载NIL,回到节点704的右子树706,记载其值14,节点706亦没有左子树和右子树,分别记载NIL,最后一路回到根节点701,其右子树为节点707,记载其值为22,节点707同样没有左子树和右子树,分别记载NIL,结束遍历流程。因此串化装置410以前序遍历图7的树数据时,所得序列化数据依序为:20、8、4、NIL、NIL、12、10、NIL、NIL、14、NIL、NIL、22、NIL、NIL,其数值标识符537如图8所示。
中序遍历则是对于当前节点,先输出其左子树,再输出该节点,最后输出其右子树。以图7为例,串化装置410以中序遍历时,所得序列化数据依序为:NIL、4、NIL、8、NIL、10、NIL、12、NIL、14、NIL、20、NIL、22、NIL。
后序遍历对于当前节点,先输出其左子树,然后输出其右子树,最后输出该节点。以图7为例,串化装置410以后序遍历时,所得序列化数据依序为:NIL、NIL、4、NIL、NIL、10、NIL、NIL、14、12、8、NIL、NIL、22、20。
逆后序遍历则是将后序遍历的结果反过来,同样以图7为例,串化装置410以逆后序遍历时,所得序列化数据依序为:20、22、NIL、NIL、8、12、14、NIL、NIL、10、NIL、NIL、4、NIL、NIL。
通过前述方式的任何一种,串化装置410将树数据转换成序列化数据,并将序列化数据置入数值标识符537中。此实施例并不限制遍历树数据的方式,但以前序方式遍历为佳。
在处理嵌套数据时,由于嵌套数据具有层次结构,因此在进行热迁移保存时,同样需要将嵌套数据依层次序列化记载。实际上,嵌套数据可 能会包括多层嵌套结构,为方便说明,以下将以具有二层数据的嵌套数据为例。
串化装置410同样将嵌套数据以结构体方式展现,分为第一层结构体(上层结构体)及第二层结构体(下层结构体),即第二层结构体嵌套在第一层结构体中。串化装置410在生成待迁移信息时,在数据结构层52中会分为二段,第一段的符号标识符525(第一符号标识符)、类型标识符526(第一类型标识符)、键标识符527(第一键标识符)分别记载第一层结构体的相关信息,并在实体标识符528(第一实体标识符)中展开第一层结构体的序列化层53。
串化装置410在第一层结构体的序列化层53中生成各标识符如下:幻数标识符529标示第一层结构体序列化的开始,长度标识符530记载第一层结构体的序列化层53的长度,字节次序标识符531表示第一层结构体以大端模式或是小端模式存储的,压缩标识符532标示第一层结构体的压缩形式,类型标识符533标示第一层结构体的类型,键标识符534标示了第一层结构体中的变量名称,计数标识符535标示第一层结构体中的变量数量,格式标识符536标示第一层结构体的变量格式,数值标识符537则是记载第一层结构体的各变量数值。
在第一层结构体的实体标识符528之后,串化装置410紧接着生成描述第二层结构体。串化装置410生成键标识符527(第二键标识符)记载第二层结构体的名称,并在实体标识符528(第二实体标识符)中展开第二层结构体的序列化层53。第二层结构体的序列化层53的各标识符的记载方式与第一层结构体相同,不再赘述。
举例来说,假设有以下的嵌套数据:
Figure PCTCN2021102073-appb-000001
前述代码表述了嵌套数据包括二层结构体,第一层结构体名称为“foo_nested”,包括了三个类型,第一类型是整数数字阵列,变量名称为“array”,数列为{26,91,1029};第二类型是第二层结构体,包括数字91和字串Hello world;第三类型是整数数字10029。
图9示出嵌套数据序列化时所生成的数据结构。由于此处仅用来表述嵌套数据的序列化,故协议层51的各标识符省略不表述。串化装置410生成的数据结构层52中,第一符号标识符901记载第一层结构体名称,即“.foo_nested”;第一类型标识符902记载第一层结构体类型,即“foo_nested_t”;第一键标识符903和第一实体标识符904记载第一类型的整数数字阵列{26,91,1029}的信息,其中第一键标识符903记载其变量名称为“.foo_nested.array”,第一实体标识符904记载阵列的3个数值,即整数数字26、91、1029,由于阵列为简单数据,故第一实体标识符904无需展开序列化层53。
在描述完第一类型的信息后,接着记载第二类型的信息。在第一实体标识符904后,为第二键标识符905记载第二类型,第二类型为嵌套数据的第二层结构体,其名称“foo1”,根据协议,第二键标识符905记载为“.foo_nested.foo1”,表示为“foo_nested”结构体下嵌套的“foo1”结构体。
串化装置410在第二实体标识符906展开序列化层53,用以表述第二层结构体,其中幻数标识符907标示第二层结构体的开始,长度标识符908记载该序列化层53的长度,字节次序标识符909表示第二层结构体以大端模式或小端模式存储的,压缩标识符910标示第二层结构体的压缩形式,第二符号标识符911记载第二层结构体名称,根据协议为“.foo_nested.foo1”;第二类型标识符912记载第二层结构体的类型名称,即“foo1_t”。由于第二层结构体的数据{91,“Hello world”}包括数字“91”和字串“Hello world”,串化装置410会以两套键标识符及实体标识符分别记载相关信息。第三键标识符913及第三实体标识符914用以记载该数字,其中第三键标识符913记载变量名称为“.foo_nested.foo1.integer”,而第三实体标识符914记载数值“91”;第四键标识符915及第四实体标识符916用以记载该字串,其中第四键标识符915记载变量名称为“.foo_nested.foo1.str”,而第四实体标识符916记载字串为“Hello world”。
第二类型的信息标识完毕后,接着在数据结构层52记载第三类型的信息。串化装置410在第二实体标识符906后,再加上第五键标识符917记载第三类型的变量名称,即“.foo_nested.seq”,以及在第五实体标识符 918记载第三类型的变量数值,即“10029”。至此,串化装置410将所有嵌套数据的信息载入至待迁移信息中。
串化装置410在序列化逻辑指针时,同样地利用数据结构层52和序列化层53来完整表述指针指向的关系。
举例来说,假设有以下的结构体:
Figure PCTCN2021102073-appb-000002
前述代码表述了第一结构体,其名称为“foo_nested”,包括了一个第一类型,其名称为“foo_nested_t”,该第一类型包括二个变量,第一个变量是逻辑指针“foo1”,其指向第二结构体foo2,第二个变量是整数,其名称为seq,数值为10029。而第二结构体foo2也包括了一个第二类型,其名称为“foo2_t”,第二类型包括一个整数变量,名称为“interger”,其数值为91。
图10示出串化装置410将上述包括逻辑指针的结构体序列化成待迁移信息的示意图。同样地,此处仅用来揭示逻辑指针的序列化,故协议层51的各标识符省略不谈。在数据结构层52中,串化装置410将第一符号标识符1001根据协议记载第一结构体的名称,即“.foo_nested”;第一类型标识符1002记载第一类型的名称,即“foo_nested_t”;第一键标识符1003和第一实体标识符1004记载逻辑指针的信息,第一键标识符1003根据协议记载逻辑指针名称为“.foo_nested.foo1”,第一实体标识符1004记载逻辑指针指向“.foo2”。接着第二键标识符1005和第二实体标识符1006记载第二变量的信息,第二键标识符1005根据协议记载第二变量名称为“.foo_nested.seq”,第二实体标识符1006记载第二变量的数值为“10029”。
串化装置410会适当地在同一个待迁移信息的数据结构中的某一段置入第二结构体foo2的信息。如图10所示,在第二实体标识符1006之后 存在多个其他结构体的信息。在数据结构层52的某一段中,串化装置410接着记载第二结构体的信息,第二符号标识符1007记载第二结构体的名称,即“.foo2”,英文句号供系统识别此处为符号标识符,是一个结构体信息的开端;第二类型标识符1008记载第二类型的名称,即“foo2_t”;第三键标识符1009和第三实体标识符1010记载第二类型里的变量信息,第三键标识符1009记载变量名称为“.foo2.integer”,第三实体标识符1010记载该变量数值为“91”。
在图10的逻辑指针的示例中,由于变量足够简单,因此第一实体标识符1004、第二实体标识符1006和第三实体标识符1010均不需要展开如图5所示的序列化层53。本公开并不要求或限制每个待迁移信息的数据结构必须包括序列化层53或是序列化层53的每一个标识符。
综上所述,串化装置410在生成待迁移信息时,可以根据实际需求拼接多个标识符,以适当扩展数据结构层52和序列化层53的长度,再将待迁移信息的总字节数记载至字节标识符507中。换言之,数据结构层52和序列化层53可以包括多个符号标识符、类型标识符、键标识符或实体标识符串接在一块,分别记载不同的数据实体。
当串化装置410生成待迁移信息后,物理功能406在步骤307中发送待迁移信息至内核空间104的物理功能驱动程序403,完成数据序列化的过程。
本公开的另一个实施例是一种对系统进行热迁移保存路径的方法,更详细来说,此实施例是在步骤307中生成待迁移信息的数据结构的流程,图11示出其流程图。
在步骤1101中,接收热迁移启动请求,热迁移启动请求指定热迁移特定虚拟功能,所述特定虚拟功能为多个虚拟功能其中之一。在图3的步骤306中,物理功能驱动程序403发送热迁移启动请求以通知物理功能406准备进行迁移,物理功能406接收所述热迁移启动请求,其中指定了热迁移特定虚拟功能407。
在步骤1102中,生成待迁移信息的数据结构。串化装置410响应所述热迁移启动请求,生成待迁移信息的数据结构。此步骤更可细化为如图12所示的流程。
在步骤1201中,生成所述数据结构的协议层;在步骤1202中,生成所述数据结构的数据结构层;在步骤1203中,生成所述数据结构的序列化层。
在步骤1204中,在协议层中生成幻数标识符版本标识符、请求响应 标识符、命令标识符、序号标识符、数据来源标识符、字节标识符、域标识符、保留标识符、载荷标识符等至少其中之一。
在步骤1205中,判断待迁移信息是组态或数据。
如为组态,则执行步骤1206,在数据结构层中生成域标识符、芯片标识符、板卡标识符、微控制器标识符、固件标识符、主机驱动标识符、虚拟机标识符、保留标识符、计算装置标识符、存储装置标识符、视频编解码装置标识符、JPEG编解码装置标识符、PCIe标识符等至少其中之一。
如为数据,则执行步骤1207,在数据结构层中生成符号标识符、类型标识符、键标识符及实体标识符等至少其中之一。
接着执行步骤1208,在序列化层中生成幻数标识符、长度标识符、字节次序标识符、压缩标识符、类型标识符、键标识符、计数标识符、格式标识符及数值标识符等至少其中之一。
这些标识符的定义及记载内容均已在前述实施例中说明,细节不再赘述。
在最后执行步骤1103,发送待迁移信息至内核空间。串化装置410生成待迁移信息后,物理功能406将待迁移信息发送至内核空间104的物理功能驱动程序403。
本公开的另一个实施例为一种序列化树数据的方法,其流程图如图13所示,包括以下步骤。在步骤1301中,响应热迁移启动请求以生成待迁移信息,所述待迁移信息的数据结构包括数值标识符;在步骤1302中,依特定顺序遍历所述树数据,以形成序列化数据;在步骤1303中,将所述序列化数据置入所述数值标识符中。序列化树数据的细节在前述实施例中已说明,故不再赘述。
本公开的另一个实施例为一种序列化嵌套数据的方法,所述嵌套数据至少包括第一层结构体及第二层结构体,串化装置410响应热迁移启动请求,生成待迁移信息,所述生成待迁移信息的步骤如图14所示。在步骤1401中,在所述待迁移信息的数据结构层中生成第一符号标识符,用以记载所述第一层结构体的名称;在步骤1402中,在序列化层中生成第二符号标识符,用以记载所述第二结构体的名称。序列化嵌套数据的细节在前述实施例中已说明,故不再赘述。
本公开的另一个实施例为一种序列化逻辑指针的方法,所述逻辑指针将第一结构体与第二结构体建立关联,其流程图如图15所示,包括以下步骤。在步骤1501中,响应热迁移启动请求以生成待迁移信息;在步骤1502中,在所述待迁移信息的数据结构中生成第一符号标识符及第一 实体标识符;在步骤1503中,在所述第一符号标识符中置入所述第一结构体的名称;在步骤1504中,在所述第一实体标识符中置入所述逻辑指针的数值,所述逻辑指针的数值为所述第二结构体的名称。序列化逻辑指针的细节在前述实施例中已说明,故不再赘述。
通过上述各实施例的说明,本公开实现迁移保存路径中的数据序列化,在执行前述流程的同时,对于非特定虚拟功能及硬件来说,仍旧执行来自用户空间102的任务,不受影响。
本公开的另一个实施例是迁移恢复路径,此实施例的目的服务器亦为图1的系统,与源服务器具有同样的环境。图16是示出迁移恢复路径的流程图,图17则示出迁移恢复路径在图1环境中的示意图。更详细来说,此实施例是在图3及图4的实施例完成迁移保存路径后,接着将待迁移信息迁移到目的服务器上。
在步骤1601中,Libvirt 1701向QEMU 1702发起待迁移信息导入的请求。QEMU 1702自片外接收在图3及图4的实施例中发出的待迁移指令,并初始化热迁移启动请求。所述片外指的是源服务器,源服务器与目的服务器可能在同一个硬件平台或不同硬件平台上。
在步骤1602中,VMLU QOM 1704向物理功能驱动程序1703发送待迁移信息。VMLU QOM 1704接收到待迁移指令后,响应热迁移启动请求,调用写入函数,将其中的待迁移信息发送至物理功能驱动程序1703。
在步骤1603中,物理功能1706接收待迁移信息。在前一个步骤中,VMLU QOM 1704将待迁移信息发送至物理功能驱动程序1703,物理功能驱动程序1703再将待迁移信息发送至物理功能1706。
在步骤1604中,针对特定虚拟功能1707及特定虚拟硬件1708恢复组态、数据及其上下文。
首先,物理功能1706闲置特定虚拟功能1707,使其暂时勿与用户空间102进行沟通,但其他的虚拟功能则照常运行。在闲置特定虚拟功能1707后,物理功能1706通过特定虚拟功能1707发送待迁移信息至特定虚拟硬件1708。
同样地,特定虚拟硬件1708可以是图1的虚拟计算装置、特定虚拟存储装置、虚拟视频编解码装置或是虚拟JPEG编解码装置。待迁移信息包括与特定虚拟硬件1708相关的驱动程序、固件和硬件信息、上下文信息及状态信息等。回复后,特定虚拟功能1707及特定虚拟硬件1708与特定虚拟功能407及特定虚拟硬件408具有完全相同的环境及数据。
在步骤1605中,物理功能1706向物理功能驱动程序1703报告迁移 已经完成,当指令发送完毕后,物理功能1706发送结束信号至内核空间104的物理功能驱动程序603。
在步骤1606中,物理功能驱动程序1703通知VMLU QOM 1704热迁移已经完成,亦即物理功能驱动程序1703发送结束信号至QEMU 1702。
在步骤1607中,VMLU QOM 1704改变状态以便通知虚拟功能驱动程序1705热迁移已经完成。VMLU QOM 1704响应结束信号,通知虚拟功能驱动程序1705热迁移已完成,同时改变基地址寄存器的状态,指向目的服务器的特定虚拟功能1707及特定虚拟硬件1708。
在步骤1608中,虚拟功能驱动程序1705向虚拟功能驱动程序的接口1709发送控制信号,以重新接续执行客户操作系统的任务。
在步骤1609中,虚拟功能驱动程序的接口1709通知虚拟功能驱动程序1705重新接续执行客户操作系统的任务。虚拟功能驱动程序1705重新通过虚拟功能驱动程序的接口1709接收来自用户空间102的处理器的任务,这些任务不再访问源服务器的特定虚拟硬件408,而改以访问目的服务器的特定虚拟硬件1708。
在步骤1610中,VMLU QOM 1704通知Libvirt 1701热迁移完成,Libvirt 1701清理源服务器上所分配的硬件资源。至此完成迁移恢复路径。
结合前述迁移保存路径及迁移恢复路径的实施例,本公开得以实现虚拟化专用集成电路的热迁移。
更详细来说,图17的系统还包括解串装置1710,用以响应热迁移启动请求,在步骤1604中根据待迁移信息恢复特定虚拟功能1707的驱动程序、固件和特定虚拟硬件1708的信息、上下文信息及其状态信息等数据。此实施例的解串装置1710可以利用硬件或固件来实现。如是硬件,解串装置1710是配置在片上系统106中;如是固件,则存储在片上系统106的只读存储装置中。
解串装置1710实现热迁移恢复路径的方法,其流程如图18所述。在步骤1801中,解串装置1710接收待迁移信息。在步骤1802中,解串装置1710反序列化协议层51的信息,此步骤细化成图19的流程。
在步骤1901中,由于源服务器与目的服务器遵循相同的协议,因此解串装置1710可以识别图5的数据结构,其自幻数标识符501中识别这是待迁移信息的协议层51的开始。在步骤1902中,自版本标识符502中识别待迁移信息的版本,以确认目的服务器的系统版本等于或高于源服务器的系统版本。在步骤1903中,自请求响应标识符503中识别此信息指令为请求或是响应,如是请求,则继续执行迁移恢复路径,如为响应,表 示此信息非待迁移信息,停止恢复。
接着在步骤1904中,自命令标识符504中识别待迁移信息的任务种类为迁移状态及数据或是更新数据字典。在步骤1905中,自序号标识符505中识别待迁移信息的流水号,以判断此待迁移信息在整个热迁移恢复路径中的排位。
接着在步骤1906中,自数据来源标识符506中识别特定虚拟套件,其中所述特定虚拟套件包括虚拟计算装置、虚拟视频编解码装置、虚拟JPEG编解码装置及虚拟存储装置至少其中之一,解串装置1710根据数据来源标识符506的信息将待迁移信息恢复至指定的特定虚拟套件。
接着在步骤1907中,自字节标识符507中识别待迁移信息的总字节数或是有效载荷的总字节数。在步骤1908中,自域标识符508取出特定虚拟功能的信息,将待迁移信息恢复至特定虚拟功能1707中。在步骤1909中,自载荷标识符510中取出数据结构层52的信息。
在步骤1803中,解串装置1710开始反序列化数据结构层52的信息,首先判断数据结构层52记载的是组态信息或是数据信息。
如果数据结构层52记载的是组态信息,则执行步骤1804,反序列化组态信息,此步骤细化成图20的流程。在步骤2001中,解串装置1710自域标识符511取出特定硬件的信息,准备将待迁移信息恢复至特定硬件1708中。在步骤2002中,自芯片标识符512中识别源服务器的芯片组型号,以判断是否与目的服务器的芯片组相容。在步骤2003中,自板卡标识符513中识别源服务器的板卡版本或型号,以判断是否与目的服务器的板卡相容。在步骤2004中,自微控制器标识符514中识别源服务器的微控制器的型号,以判断是否与目的服务器的微控制器相容。
在步骤2005中,接着自固件标识符515中识别源服务器的固件版本,以判断是否与目的服务器的固件相容。在步骤2006中,自主机驱动标识符516中识别源服务器的主机驱动软件版本,以判断是否与目的服务器的主机驱动软件相容。在步骤2007中,自虚拟机标识符517中识别源服务器的虚拟机驱动软件版本,以判断是否与目的服务器的虚拟机驱动软件相容。
接着在步骤2008中,取出特定装置标识符的信息,也就是自计算装置标识符519、存储装置标识符520、视频编解码装置标识符521、JPEG编解码装置标识符522取出信息以还原特定装置的组态,所述特定装置即是特定硬件1708,为虚拟计算装置、虚拟视频编解码装置、虚拟JPEG编解码装置及虚拟存储装置其中之一。
最后在步骤2009中,根据PCIe标识符523的信息还原虚拟接口的组态。
如果数据结构层52用以记载数据信息,则执行步骤1805,反序列化数据信息,此步骤细化成图21的流程。在步骤2101中,解串装置1710自符号标识符525识别标记结构体的开始并取出结构体的名称,更详细来说,由于符号标识符525包括前缀符号,因此解串装置1710先识别出前缀符号,便可根据前缀符号识别结构体的名称,以及之后的各种标识符。在步骤2102中,自类型标识符526识别类型。在步骤2103中,自键标识符527中取出变量的名称,同样地,由于键标识符527包括前缀符号,因此解串装置1710先识别出前缀符号,便可根据前缀符号取出变量的名称。在步骤2104中,自实体标识符528取出序列化层53的信息。
回到图18,接着执行步骤1806,识别或取出序列化层53的信息,此步骤细化成图22的流程。在步骤2201中,解串装置1710接着根据幻数标识符529识别序列化层53的开始。在步骤2202中,自长度标识符530中识别序列化层53的长度。在步骤2203中,自字节次序标识符531中识别数据的存储字节序为大端模式或小端模式。在步骤2204中,自压缩标识符532中识别所述数据的压缩形式。在步骤2205中,自类型标识符533识别类型。在步骤2206中,自键标识符534中取出变量名称。在步骤2207中,自计数标识符535中识别变量数量。在步骤2208中,自格式标识符536中识别变量格式。在步骤2209中,自数值标识符537中取出变量的数值或字串。
当反序列化时遇到较为复杂的数据时,例如树数据、嵌套数据或逻辑指针,解串装置1710会分别进行以下的反序列化的流程。
在反序列化树数据时,解串装置1710会执行图23的流程。在步骤2301中,自类型标识符533中识别类型为二元树。在步骤2302中,自键标识符534中取出树数据名称。在步骤2303中,自计数标识符535中识别树数据的元素数量。在步骤2304中,自格式标识符536中识别树数据的元素格式。在步骤2305中,自数值标识符537中取出序列化的元素数据。在步骤2306中,根据协议,依特定顺序还原成树数据。
在反序列化嵌套数据时,解串装置1710用以接收待迁移信息,所述待迁移信息的数据结构层52包括第一符号标识符,且序列化层53包括第二符号标识符,根据所述第一符号标识符取出第一序列化数据;根据所述第二符号标识符取出第二序列化数据;将所述第一序列化数据还原成所述第一层结构体;以及将所述第二序列化数据还原成所述第二层结构体。最 后将所述第一层结构体及所述第二层结构体存储至内存里。
更详细来说,解串装置1710针对第一层结构体执行图24所示的流程。以下将以图25的嵌套数据作为例子说明。在步骤2401中,接收待迁移信息,所述待迁移信息的数据结构包括数据结构层52和序列化层53,其中数据结构层52包括第一符号标识符2501,序列化层53包括第二符号标识符2509。在步骤2402中,根据第一符号标识符2501识别并取出第一序列化数据,其结构体名称为“foo_nested”。在步骤2403中,自第一类型标识符2502还原第一类型,其类型名称为“foo_nested_t”。在步骤2404中,自第一键标识符2503还原第一层结构体中的变量名称,其为“foo1”。在步骤2405中,自第一实体标识符2504中取出序列化层53信息,也就是识别或取出第二层结构体的信息,此步骤可进一步细化成如图26所示的流程。
在步骤2601中,自幻数标识符2505中识别第二层结构体的开始。在步骤2602中,自长度标识符2506中识别的序列化层53的长度。在步骤2603中,自字节次序标识符2507中识别第二层结构体中数据的存储字节序。在步骤2604中,自压缩标识符2508中识别第二层结构体中数据的压缩形式。在步骤2605中,自第二符号标识符2509中识别第二层结构体的名称为“foo_nested_foo1”。在步骤2606中,自第二类型标识符2510中识别第二类型,其名称为“foo_t”。在步骤2607中,自计数标识符2511中识别变量数量。在步骤2608中,自格式标识符2512中识别变量格式。在步骤2609中,自第二键标识符2513中取出第一变量的名称“integer”。在步骤2610中,自第一数值标识符2514中取出第一变量的数值“91”。在步骤2611中,自第三键标识符2515中取出第二变量的名称“str”。在步骤2612中,自第二数值标识符2516中取出第二变量的字串“Hello world”。在步骤2613中,存储第一层及第二层结构体,即恢复第一层及第二层结构体下的所有信息。
在反序列化逻辑指针时,解串装置1710会执行图27的流程,同时参考图10中包括逻辑指针的待迁移信息。在步骤2701中,接收待迁移信息。在步骤2702中,自第一符号标识符1001中取出第一结构体的名称。在步骤2703中,自第一类型标识符1002中识别第一类型。在步骤2704中,自第一键标识符1003中取出逻辑指针的名称。在步骤2705中,自第一实体标识符1004中取出第二结构体的名称。在步骤2706中,自第二符号标识符1007中取出第二结构体的名称。在步骤2707中,自第二类型标识符1008中识别第二类型。在步骤2708中,自第二键标识符1009中取 出变量的名称。在步骤2709中,自第二实体标识符1010中取出所述变量的信息。在步骤2710中,还原第一结构体及第二结构体的信息。
解串装置1710反序列化待迁移信息,并透过物理功能1706将源服务器中的特定虚拟功能407和特定硬件408的驱动程序、固件和硬件信息、上下文信息及其状态信息恢复到目的服务器上的特定虚拟功能1707和特定硬件1708的内存中。
图28是示出根据本公开实施例的一种集成电路装置2800的结构图。如图28所示,集成电路装置2800即是前述多个实施例中的片上系统106,其包括特定虚拟套件2802,特定虚拟套件2802为虚拟计算装置、虚拟视频编解码装置、虚拟JPEG编解码装置至少其中之一。另外,集成电路装置2800还包括通用互联接口2804和其他处理装置2806。
其他处理装置2806可以是中央处理器、图形处理器、人工智能处理器等通用和/或专用处理器中的一种或多种类型的处理器,其数目不做限制而是依实际需要来确定。其他处理装置2806作为特定虚拟套件2802与外部数据和控制的接口,执行包括但不限于数据搬运,完成对特定虚拟套件2802的开启、停止等的基本控制。其他处理装置2806也可以和特定虚拟套件2802协作共同完成运算任务。
通用互联接口2804可以用于在特定虚拟套件2802与其他处理装置2806间传输数据和控制指令。例如,特定虚拟套件2802可以经由通用互联接口2804从其他处理装置2806中获取所需的输入数据,写入特定虚拟套件2802片上的存储单元。进一步,特定虚拟套件2802可以经由通用互联接口2804从其他处理装置2806中获取控制指令,写入特定虚拟套件2802片上的控制缓存。替代地或可选地,通用互联接口2804也可以读取特定虚拟套件2802的存储模块中的数据并传输给其他处理装置2806。
集成电路装置2800还包括存储装置2808,其可以分别与特定虚拟套件2802和其他处理装置2806连接。存储装置2808即为虚拟存储装置148,用于保存特定虚拟套件2802和其他处理装置2806的数据,尤其适用于所需要运算的数据在特定虚拟套件2802或其他处理装置2806的内部存储中无法全部保存的数据。
根据应用场景的不同,集成电路装置2800可以作为手机、机器人、无人机、视频采集等设备的片上系统(SOC),从而有效地降低控制部分的核心面积,提高处理速度并降低整体的功耗。在此情况时,集成电路装置2800的通用互联接口2804与设备的某些部件相连接。此处的某些部件可以例如是摄像头,显示器,鼠标,键盘,网卡或wifi接口。
本公开还揭露一种芯片或集成电路芯片,其包括了集成电路装置2800。本公开还揭露一种芯片封装结构,其包括了上述芯片。
本公开另一个实施例是一种板卡,其包括了上述芯片封装结构。参阅图29,板卡2900除了包括多个上述芯片2902以外,还可以包括其他的配套部件,该配套部件包括存储器件2904、接口装置2906和控制器件2908。
存储器件2904与芯片封装结构内的芯片2902通过总线2914连接,用于存储数据。存储器件2904可以包括多组存储单元2910。
接口装置2906与所述芯片封装结构内的芯片2902电连接。所述接口装置2906用于实现芯片2902与外部设备2912(例如服务器或计算机)之间的数据传输。在此实施例中,接口装置2906为标准PCIe接口,待处理的数据由服务器通过标准PCIe接口传递至芯片2902,实现数据转移。芯片2902的计算结果亦由接口装置2906传送回外部设备2912。
控制器件2908与芯片2902电连接,以便对芯片2902的状态进行监控。具体地,芯片2902与控制器件2908可以通过SPI接口电连接。控制器件2908可以包括单片机(“MCU”,Micro Controller Unit)。
本公开的另一个实施例是一种电子设备或装置,其包括了上述板卡2900。根据不同的应用场景,电子设备或装置可以包括数据处理装置、机器人、电脑、打印机、扫描仪、平板电脑、智能终端、手机、行车记录仪、导航仪、传感器、摄像头、服务器、云端服务器、相机、摄像机、投影仪、手表、耳机、移动存储、可穿戴设备、交通工具、家用电器、和/或医疗设备。所述交通工具包括飞机、轮船和/或车辆;所述家用电器包括电视、空调、微波炉、冰箱、电饭煲、加湿器、洗衣机、电灯、燃气灶、油烟机;所述医疗设备包括核磁共振仪、B超仪和/或心电图仪。
本公开另一个实施例为一种计算机可读存储介质,其上存储有序列化或反序列化的计算机程序代码,当所述计算机程序代码由处理器运行时,执行前述的方法。
本公开可以实现将源服务器中的虚拟特定功能和虚拟硬件的驱动程序、固件和硬件信息、上下文信息及其状态信息热迁移到目的服务器上,其利用序列化的技术生成待迁移信息以方便传输,目的服务器再基于同样的协议反序列化待迁移信息,恢复其组态和数据。

Claims (94)

  1. 一种实现热迁移保存的系统,连接至内核空间,包括:
    只读存储装置,存储有固件,所述固件包括物理功能,虚拟化为多个虚拟功能,所述物理功能接收来自所述内核空间的热迁移启动请求,所述热迁移启动请求指定热迁移特定虚拟功能,所述特定虚拟功能为所述多个虚拟功能其中之一;以及
    串化装置,用以响应所述热迁移启动请求以生成待迁移信息的数据结构,所述数据结构包括协议层,所述协议层包括域标识符,用以记载所述特定虚拟功能;
    其中,所述物理功能发送所述待迁移信息至所述内核空间。
  2. 根据权利要求1所述的系统,其中所述串化装置在所述协议层中生成版本标识符,用以标记所述待迁移信息的版本。
  3. 根据权利要求1所述的系统,还包括套件,虚拟化为多个虚拟套件,每个虚拟功能对应一个虚拟套件,其中所述套件包括计算装置、视频编解码装置、JPEG编解码装置及存储装置至少其中之一,所述特定虚拟功能对应特定虚拟套件。
  4. 根据权利要求3所述的系统,其中所述待迁移信息来自特定装置,所述特定装置为所述计算装置、所述视频编解码装置、所述JPEG编解码装置及所述存储装置至少其中之一,所述串化装置在所述协议层中生成数据来源标识符,用以记载所述特定装置。
  5. 根据权利要求1所述的系统,其中所述数据结构还包括数据结构层,所述串化装置在所述协议层中生成包括载荷符,所述载荷符用以记载所述数据结构层的信息。
  6. 根据权利要求5所述的系统,其中所述数据结构层用以记载组态信息。
  7. 根据权利要求6所述的系统,其中所述串化装置在所述数据结构层中生成芯片标识符,用以记载所述系统的芯片组型号。
  8. 根据权利要求6所述的系统,其中所述串化装置在所述数据结构层中生成板卡标识符,用以记载所述系统的板卡版本或型号。
  9. 根据权利要求6所述的系统,其中所述串化装置在所述数据结构层中生成固件标识符,用以记载所述系统的固件版本。
  10. 根据权利要求6所述的系统,其中所述待迁移信息来自特定装置,所述特定装置为所述系统中的计算装置、视频编解码装置、JPEG编解码装置及存储装置至少其中之一,所述串化装置在所述数据结构层中生成特定装置标识符,用以记载所述特定装置的组态。
  11. 根据权利要求5所述的系统,其中所述数据结构层用以记载数据信息。
  12. 根据权利要求11所述的系统,其中所述数据信息包括结构体,所述串化装置在所述数据结构层中生成符号标识符,用以标记所述结构体的开始。
  13. 根据权利要求12所述的系统,其中所述结构体包括至少一种类型,所述串化装置在所述数据结构层中生成类型标识符,用以记载所述类型。
  14. 根据权利要求13所述的系统,其中所述类型包括至少一个变量,所述串化装置在所述数据结构层中生成键标识符,用以记载所述变量的名称。
  15. 根据权利要求13所述的系统,其中所述数据结构还包括序列化层,所述串化装置在所述数据结构层中生成实体标识符,用以记载所述序列化层的信息。
  16. 根据权利要求15所述的系统,其中所述串化装置在所述序列化层中生成幻数标识符,用以标示所述序列化层的开始。
  17. 根据权利要求15所述的系统,其中所述数据信息包括类型,所述串化装置在所述序列化层中生成类型标识符,用以标示所述类型。
  18. 根据权利要求17所述的系统,其中所述类型包括至少一个变量,所述串化装置在所述序列化层中生成键标识符,用以标示所述变量的名称。
  19. 根据权利要求18所述的系统,其中所述串化装置在所述序列化层中生成数值标识符,用以记载所述变量的数值或字串。
  20. 一种实现热迁移恢复的系统,连接至内核空间,包括:
    只读存储装置,存储有固件,所述固件包括物理功能,虚拟化为多个虚拟功能,所述物理功能接收待迁移信息,所述待迁移信息的数据结构包括协议层,所述协议层包括域标识符;以及
    解串装置,用以:
    自所述域标识符中取出特定虚拟功能的信息,所述特定虚拟功能为所述多个虚拟功能其中之一;以及
    将所述待迁移信息恢复至所述特定虚拟功能中。
  21. 根据权利要求20所述的系统,还包括套件,虚拟化为多个虚拟套件,每个虚拟功能对应一个虚拟套件,其中所述套件包括计算装置、视频编解码装置、JPEG编解码装置及存储装置至少其中之一,所述解串装置根据所述特定虚拟功能将所述待迁移信息恢复至相对应的特定虚拟套件。
  22. 根据权利要求20所述的系统,其中所述数据结构还包括数据结构层,所述协议层还包括载荷符,所述载荷符用以记载所述数据结构层的信息。
  23. 根据权利要求22所述的系统,其中所述数据结构层用以记载组态信息。
  24. 根据权利要求23所述的系统,其中所述数据结构层还包括芯片标识符,所述解串装置自所述芯片标识符中识别所述系统的芯片组型号。
  25. 根据权利要求23所述的系统,其中所述数据结构层还包括板卡标识符,所述解串装置自所述板卡标识符中识别所述系统的板卡版本或型号。
  26. 根据权利要求23所述的系统,其中所述数据结构层还包括特定装置标识符,所述解串装置根据所述特定装置标识符还原特定装置的组态,所述特定装置为所述系统中的计算装置、视频编解码装置、JPEG编解码装置及存储装置至少其中之一。
  27. 根据权利要求22所述的系统,其中所述数据结构层用以记载数据信息。
  28. 根据权利要求27所述的系统,其中所述数据信息包括结构体, 所述数据结构层还包括符号标识符,所述解串装置自所述符号标识符中识别标记所述结构体的开始。
  29. 根据权利要求28所述的系统,其中所述结构体包括至少一种类型,所述数据结构层还包括类型标识符,所述解串装置自所述类型标识符中识别所述类型。
  30. 根据权利要求29所述的系统,其中所述类型包括至少一个变量,所述数据结构层还包括键标识符,所述解串装置自所述键标识符中取出所述变量的名称。
  31. 根据权利要求29所述的系统,其中所述数据结构还包括序列化层,所述数据结构层还包括实体标识符,用以记载所述序列化层的信息。
  32. 根据权利要求31所述的系统,其中所述数据信息包括类型,所述序列化层包括类型标识符,所述解串装置自所述类型标识符中识别所述类型。
  33. 根据权利要求32所述的系统,其中所述类型包括至少一个变量,所述序列化层包括键标识符,所述解串装置自所述键标识符中取出所述变量的名称。
  34. 根据权利要求33所述的系统,其中所述序列化层包括数值标识符,所述解串装置自所述数值标识符中取出所述变量的数值或字串。
  35. 一种对系统进行热迁移保存路径的方法,所述系统连接至内核空间并包括只读存储装置,所述只读存储装置存储有固件,所述固件包括物理功能,所述物理功能虚拟化为多个虚拟功能,所述方法包括:
    接收热迁移启动请求,所述热迁移启动请求指定热迁移特定虚拟功能,所述特定虚拟功能为所述多个虚拟功能其中之一;
    生成待迁移信息的数据结构,所述数据结构包括域标识符,用以记载所述特定虚拟功能;以及
    发送所述待迁移信息至所述内核空间。
  36. 一种对系统进行热迁移恢复路径的方法,所述系统连接至内核空间并包括只读存储装置,所述只读存储装置存储有固件,所述固件包括物理功能,所述物理功能虚拟化为多个虚拟功能,所述方法包括:
    接收待迁移信息,所述待迁移信息的数据结构包括域标识符;
    自所述域标识符中取出特定虚拟功能的信息,所述特定虚拟功能为所述多个虚拟功能其中之一;以及
    将所述待迁移信息恢复至所述特定虚拟功能中。
  37. 一种实现热迁移保存的系统,包括串化装置,用以:
    响应热迁移启动请求以生成待迁移信息的数据结构,所述待迁移信息包括结构体;
    在所述数据结构中生成符号标识符,用以标记所述结构体;以及
    在所述符号标识符中置入前缀符号及所述结构体的名称。
  38. 根据权利要求37所述的系统,其中所述结构体包括至少一种类型,所述串化装置在所述数据结构中生成类型标识符,用以记载所述类型。
  39. 根据权利要求38所述的系统,其中所述类型包括至少一个变量,所述串化装置在所述数据结构中生成键标识符,用以标记所述变量。
  40. 根据权利要求39所述的系统,其中所述键标识符包括所述前缀符号、所述结构体的名称及所述变量的名称。
  41. 一种实现热迁移恢复的系统,包括:
    只读存储装置,存储有固件,所述固件包括物理功能,虚拟化为多个虚拟功能,所述物理功能接收待迁移信息,所述待迁移信息包括结构体,所述待迁移信息的数据结构包括符号标识符,用以标记所述结构体,所述符号标识符包括前缀符号及所述结构体的名称;以及
    解串装置,用以根据所述前缀符号识别所述结构体的名称。
  42. 根据权利要求41所述的系统,其中所述结构体包括至少一种类型,所述数据结构还包括类型标识符,用以记载所述类型,所述解串装置根据所述类型标识符识别所述类型。
  43. 根据权利要求42所述的系统,其中所述类型包括至少一个变量,所述数据结构还包括键标识符,用以标记所述变量,所述解串装置根据所述键标识符识别所述变量。
  44. 根据权利要求43所述的系统,其中所述键标识符包括所述前缀符号、所述结构体的名称及所述变量的名称。
  45. 一种生成待迁移信息的数据结构的方法,包括:
    接收热迁移启动请求;以及
    响应所述热迁移启动请求,生成所述数据结构,所述待迁移信息包括结构体,所述生成所述数据结构的步骤包括:生成符号标识符,用以标记所述结构体,所述符号标识符包括前缀符号及所述结构体的名称。
  46. 一种判读待迁移信息的方法,包括:
    接收所述待迁移信息,所述待迁移信息包括结构体,所述待迁移信息的数据结构包括符号标识符,用以标记所述结构体,所述符号标识符包括前缀符号及所述结构体的名称;
    识别所述前缀符号;以及
    根据所述前缀符号识别所述结构体的名称。
  47. 一种序列化树数据的系统,包括:
    内存,用以存储所述树数据;以及
    串化装置,用以:
    响应热迁移启动请求以生成待迁移信息,所述待迁移信息的数据结构包括数值标识符;
    依特定顺序遍历所述树数据,以形成序列化数据;以及
    将所述序列化数据置入所述数值标识符中。
  48. 根据权利要求47所述的系统,其中所述特定顺序为前序、后序、逆后序其中之一。
  49. 根据权利要求47所述的系统,其中所述待迁移信息包括结构体,所述串化装置在所述数据结构中生成符号标识符,用以记载所述结构体的名称。
  50. 根据权利要求49所述的系统,其中所述结构体包括至少一个类型,所述串化装置在所述数据结构中生成类型标识符,用以记载所述类型为二元树。
  51. 根据权利要求47所述的系统,其中所述串化装置在所述数据结构中生成键标识符,用以记载所述树数据的名称。
  52. 一种反序列化树数据的系统,包括:
    解串装置,用以:
    接收待迁移信息,所述待迁移信息的数据结构包括数值标识符;
    自所述数值标识符中取出序列化数据;以及
    依特定顺序还原成所述树数据;以及
    内存,用以存储所述树数据。
  53. 根据权利要求52所述的系统,其中所述特定顺序为前序、后序、逆后序其中之一。
  54. 根据权利要求52所述的系统,其中所述待迁移信息包括结构体,所述数据结构包括符号标识符,所述解串装置自所述符号标识符中取出所述结构体的名称。
  55. 根据权利要求54所述的系统,其中所述结构体包括至少一个类型,所述数据结构包括类型标识符,所述解串装置自所述类型标识符中识别所述类型为二元树。
  56. 根据权利要求52所述的系统,其中所述数据结构包括键标识符,所述解串装置自所述键标识符中取出所述树数据的名称。
  57. 一种序列化树数据的方法,包括:
    响应热迁移启动请求以生成待迁移信息,所述待迁移信息的数据结构包括数值标识符;
    依特定顺序遍历所述树数据,以形成序列化数据;以及
    将所述序列化数据置入所述数值标识符中。
  58. 一种反序列化树数据的方法,包括:
    接收待迁移信息,所述待迁移信息的数据结构包括数值标识符;
    自所述数值标识符中取出序列化数据;
    依特定顺序还原成所述树数据;以及
    将所述树数据存储至内存。
  59. 一种序列化嵌套数据的系统,所述嵌套数据至少包括第一层结构体及第二层结构体,所述系统包括:
    内存,用以存储所述嵌套数据;以及
    串化装置,用以响应热迁移启动请求以生成待迁移信息,所述待迁移 信息的数据结构包括:
    数据结构层,包括第一符号标识符,用以记载所述第一层结构体的名称;以及
    序列化层,包括第二符号标识符,用以记载所述第二层结构体的名称。
  60. 根据权利要求59所述的系统,其中所述第一层结构体包括至少一个第一类型,所述第二层结构体包括至少一个第二类型,所述串化装置在所述数据结构层生成第一类型标识符,所述用以记载所述第一类型,并在所述序列化层生成第二类型标识符,用以记载所述第二类型。
  61. 根据权利要求59所述的系统,其中所述串化装置在所述数据结构层生成第一键标识符,用以记载所述第一层结构体中的变量名称,并在所述序列化层生成第二键标识符,用以记载所述第二层结构体中的变量名称。
  62. 根据权利要求59所述的系统,其中所述串化装置在所述数据结构层中生成实体标识符,用以记载所述序列化层信息。
  63. 根据权利要求59所述的系统,其中所述串化装置在所述序列化层中生成幻数标识符,用以标示所述序列化层的开始。
  64. 根据权利要求59所述的系统,其中所述串化装置在所述序列化层中生成长度标识符,用以表示所述序列化层的长度。
  65. 根据权利要求59所述的系统,其中所述串化装置在所述序列化层中生成计数标识符,用以标示变量数量。
  66. 根据权利要求59所述的系统,其中所述串化装置在所述序列化层中生成格式标识符,用以标示变量格式。
  67. 根据权利要求59所述的系统,其中所述串化装置在所述序列化层中生成数值标识符,用以记载变量数值。
  68. 一种反序列化嵌套数据的系统,所述嵌套数据至少包括第一层结构体及第二层结构体,所述系统包括:
    解串装置,用以:
    接收待迁移信息,所述待迁移信息的数据结构包括:
    数据结构层,包括第一符号标识符;以及
    序列化层,包括第二符号标识符;
    根据所述第一符号标识符取出第一序列化数据;
    根据所述第二符号标识符取出第二序列化数据;
    将所述第一序列化数据还原成所述第一层结构体;以及
    将所述第二序列化数据还原成所述第二层结构体;以及
    内存,用以存储所述第一层结构体及所述第二层结构体。
  69. 根据权利要求68所述的系统,其中所述第一层结构体包括至少一个第一类型,所述第二层结构体包括至少一个第二类型,所述数据结构层包括第一类型标识符,所述序列化层包括第二类型标识符,所述解串装置用以:
    自所述第一类型标识符识别所述第一类型;以及
    自所述第二类型标识符识别所述第二类型。
  70. 根据权利要求68所述的系统,其中所述数据结构层包括第一键标识符,所述序列化层包括第二键标识符,所述解串装置用以:
    自所述第一键标识符还原所述第一层结构体中的变量名称;以及
    自所述第二键标识符还原所述第二层结构体中的变量名称。
  71. 根据权利要求68所述的系统,其中所述数据结构层包括实体标识符,所述解串装置用以:
    自所述实体标识符中取出所述序列化层信息。
  72. 根据权利要求68所述的系统,其中所述序列化层包括幻数标识符,所述解串装置用以:
    自所述幻数标识符中识别所述第二层结构体的开始。
  73. 根据权利要求68所述的系统,其中所述序列化层包括长度标识符,所述解串装置用以:
    自所述长度标识符中识别所述序列化层的长度。
  74. 根据权利要求68所述的系统,其中所述序列化层包括计数标识符,所述解串装置用以:
    自所述计数标识符中识别变量数量。
  75. 根据权利要求68所述的系统,其中所述序列化层包括格式标识符,所述解串装置用以:
    自所述格式标识符中识别变量格式。
  76. 根据权利要求68所述的系统,其中所述序列化层包括数值标识符,所述解串装置用以:
    自所述数值标识符中取出变量数值。
  77. 一种序列化嵌套数据的方法,所述嵌套数据至少包括第一层结构体及第二层结构体,所述方法包括:
    响应热迁移启动请求,生成待迁移信息,所述生成待迁移信息的步骤包括:
    在所述待迁移信息的数据结构层中生成第一符号标识符,用以记载所述第一层结构体的名称;以及
    在所述待迁移信息的序列化层中生成第二符号标识符,用以记载所述第二层结构体的名称。
  78. 一种反序列化嵌套数据的方法,所述嵌套数据至少包括第一层结构体及第二层结构体,所述方法包括:
    接收待迁移信息,所述待迁移信息的数据结构包括:
    数据结构层,包括第一符号标识符;以及
    序列化层,包括第二符号标识符;
    根据所述第一符号标识符取出第一序列化数据;
    根据所述第二符号标识符取出第二序列化数据;
    将所述第一序列化数据还原成所述第一层结构体;
    将所述第二序列化数据还原成所述第二层结构体;以及
    存储所述第一层结构体及所述第二层结构体。
  79. 一种序列化逻辑指针的系统,包括:
    内存,用以存储第一结构体及第二结构体;以及
    串化装置,用以:
    响应热迁移启动请求以生成待迁移信息;
    在所述待迁移信息的数据结构中生成第一符号标识符及第一实 体标识符;
    在所述第一符号标识符中置入所述第一结构体的名称;以及
    在所述第一实体标识符中置入所述逻辑指针的名称,所述逻辑指针的名称为所述第二结构体的名称。
  80. 根据权利要求79所述的系统,其中所述第一结构体包括至少一种第一类型,所述串化装置在所述数据结构中生成第一类型标识符,用以记载所述第一类型。
  81. 根据权利要求79所述的系统,其中所述串化装置在所述数据结构中生成第一键标识符,用以记载所述逻辑指针的名称。
  82. 根据权利要求79所述的系统,其中所述串化装置在所述数据结构中生成第二符号标识符,用以置入所述第二结构体的名称。
  83. 根据权利要求79所述的系统,其中所述第二结构体包括至少一种第二类型,所述串化装置在所述数据结构中生成第二类型标识符,用以记载所述第二类型。
  84. 根据权利要求83所述的系统,其中所述第二类型包括至少一个变量,所述串化装置在所述数据结构中生成第二键标识符,用以记载所述变量的名称。
  85. 根据权利要求84所述的系统,其中所述串化装置在所述数据结构中生成第二实体标识符,用以记载所述变量的信息。
  86. 一种反序列化逻辑指针的系统,包括:
    解串装置,用以:
    接收待迁移信息,所述待迁移信息的数据结构包括第一符号标识符及第一实体标识符;
    自所述第一符号标识符中取出所述第一结构体的名称;以及
    自所述第一实体标识符中取出所述第二结构体的名称。
  87. 根据权利要求86所述的系统,其中所述第一结构体包括至少一种第一类型,所述数据结构包括第一类型标识符,所述解串装置自所述第一类型标识符中识别所述第一类型。
  88. 根据权利要求86所述的系统,其中所述数据结构包括第一键标 识符,所述解串装置自所述第一键标识符中取出所述逻辑指针的名称。
  89. 根据权利要求86所述的系统,其中所述数据结构包括第二符号标识符,所述解串装置自所述第二符号标识符中取出所述第二结构体的名称,并与所述逻辑指针的名称进行比对。
  90. 根据权利要求86所述的系统,其中所述第二结构体包括至少一种第二类型,所述数据结构包括第二类型标识符,所述解串装置自所述第二类型标识符中识别所述第二类型。
  91. 根据权利要求90所述的系统,其中所述第二类型包括至少一个变量,所述数据结构包括第二键标识符,所述解串装置自所述第二键标识符中取出所述变量的名称。
  92. 根据权利要求91所述的系统,其中所述数据结构包括第二实体标识符,所述解串装置自所述第二实体标识符中取出所述变量的信息。
  93. 一种序列化逻辑指针的方法,所述逻辑指针将第一结构体与第二结构体建立关联,所述方法包括:
    响应热迁移启动请求以生成待迁移信息;
    在所述待迁移信息的数据结构中生成第一符号标识符及第一实体标识符;
    在所述第一符号标识符中置入所述第一结构体的名称;以及
    在所述第一实体标识符中置入所述第二结构体的名称。
  94. 一种反序列化逻辑指针的方法,包括:
    接收待迁移信息,所述待迁移信息的数据结构包括第一符号标识符及第一实体标识符;
    自所述第一符号标识符中取出所述第一结构体的名称;以及
    自所述第一实体标识符中取出所述第二结构体的名称。
PCT/CN2021/102073 2020-09-28 2021-06-24 实现热迁移的设备及方法 WO2022062510A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US18/003,689 US12067234B2 (en) 2020-09-28 2021-06-24 Device and method for implementing live migration

Applications Claiming Priority (10)

Application Number Priority Date Filing Date Title
CN202011043865.8 2020-09-28
CN202011045832.7 2020-09-28
CN202011045832.7A CN114281467A (zh) 2020-09-28 2020-09-28 实现热迁移的系统方法、装置和存储介质
CN202011043865.8A CN114281750A (zh) 2020-09-28 2020-09-28 实现序列化及反序列化逻辑指针的方法、装置和存储介质
CN202011043849.9A CN114328366A (zh) 2020-09-28 2020-09-28 实现序列化及反序列化嵌套数据的方法、装置和存储介质
CN202011043863.9A CN114281749A (zh) 2020-09-28 2020-09-28 实现序列化及反序列化树数据的装置、方法和存储介质
CN202011045841.6 2020-09-28
CN202011045841.6A CN114281468A (zh) 2020-09-28 2020-09-28 实现热迁移的装置、相关方法及其可读存储介质
CN202011043849.9 2020-09-28
CN202011043863.9 2020-09-28

Related Child Applications (2)

Application Number Title Priority Date Filing Date
US18/003,689 A-371-Of-International US12067234B2 (en) 2020-09-28 2021-06-24 Device and method for implementing live migration
US18/762,089 Continuation US20240354001A1 (en) 2020-09-28 2024-07-02 Device and method for implementing live migration

Publications (1)

Publication Number Publication Date
WO2022062510A1 true WO2022062510A1 (zh) 2022-03-31

Family

ID=80846186

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/102073 WO2022062510A1 (zh) 2020-09-28 2021-06-24 实现热迁移的设备及方法

Country Status (2)

Country Link
US (1) US12067234B2 (zh)
WO (1) WO2022062510A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114884717A (zh) * 2022-04-28 2022-08-09 浙江大学 一种面向物联网设备的用户数据深层取证分析方法及系统

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120254862A1 (en) * 2011-03-29 2012-10-04 Yaozu Dong Efficent migration of virtual functions to enable high availability and resource rebalance
US20130227551A1 (en) * 2012-02-28 2013-08-29 Michael Tsirkin System and method for hypervisor version migration
CN104135496A (zh) * 2013-05-02 2014-11-05 华中科技大学 一种同构环境下的rpc数据传输方法及系统
CN110275789A (zh) * 2019-06-24 2019-09-24 恒生电子股份有限公司 数据处理方法及装置
CN111506385A (zh) * 2019-01-31 2020-08-07 Ati科技无限责任公司 引擎抢占和复原
US20200272458A1 (en) * 2019-02-25 2020-08-27 International Business Machines Corporation Cognitive software porting assistant system

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8683478B2 (en) * 2010-12-21 2014-03-25 International Business Machines Corporation Best fit mapping of self-virtualizing input/output device virtual functions for mobile logical partitions
US10642635B2 (en) * 2014-06-07 2020-05-05 Vmware, Inc. Decentralized demand-based virtual machine migration management
US9594592B2 (en) * 2015-01-12 2017-03-14 International Business Machines Corporation Dynamic sharing of unused bandwidth capacity of virtualized input/output adapters
CN114546594A (zh) * 2015-05-29 2022-05-27 英特尔公司 对图形处理单元资源的容器访问
CN112148421B (zh) * 2019-06-29 2024-01-30 华为技术有限公司 虚拟机迁移的方法以及装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120254862A1 (en) * 2011-03-29 2012-10-04 Yaozu Dong Efficent migration of virtual functions to enable high availability and resource rebalance
US20130227551A1 (en) * 2012-02-28 2013-08-29 Michael Tsirkin System and method for hypervisor version migration
CN104135496A (zh) * 2013-05-02 2014-11-05 华中科技大学 一种同构环境下的rpc数据传输方法及系统
CN111506385A (zh) * 2019-01-31 2020-08-07 Ati科技无限责任公司 引擎抢占和复原
US20200272458A1 (en) * 2019-02-25 2020-08-27 International Business Machines Corporation Cognitive software porting assistant system
CN110275789A (zh) * 2019-06-24 2019-09-24 恒生电子股份有限公司 数据处理方法及装置

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114884717A (zh) * 2022-04-28 2022-08-09 浙江大学 一种面向物联网设备的用户数据深层取证分析方法及系统
CN114884717B (zh) * 2022-04-28 2023-08-25 浙江大学 一种面向物联网设备的用户数据深层取证分析方法及系统

Also Published As

Publication number Publication date
US12067234B2 (en) 2024-08-20
US20230244380A1 (en) 2023-08-03

Similar Documents

Publication Publication Date Title
US9817580B2 (en) Secure migratable architecture having improved performance features
US4814975A (en) Virtual machine system and method for controlling machines of different architectures
WO2017114283A1 (zh) 一种在物理主机中处理读/写请求的方法和装置
WO2017066944A1 (zh) 一种存储设备访问方法、装置和系统
CN115113973A (zh) 可配置设备接口
WO2017024783A1 (zh) 一种虚拟化方法、装置和系统
CN111309649B (zh) 一种数据传输和任务处理方法、装置及设备
KR20100058670A (ko) 크로스-시스템의 프록시-기반 태스크 오프로딩을 위한 장치, 시스템 및 방법
US20240264768A1 (en) Request Processing Method, Apparatus, and System
US12105648B2 (en) Data processing method, apparatus, and device
WO2021223744A1 (zh) 实现热迁移的方法、芯片、板卡和存储介质
US20240126567A1 (en) Data processing system, method, and apparatus
CN114281467A (zh) 实现热迁移的系统方法、装置和存储介质
WO2022062510A1 (zh) 实现热迁移的设备及方法
WO2020177567A1 (zh) 一种迁移数据的方法、装置及系统
US20230229497A1 (en) Transparent and remote kernel execution in a heterogeneous computing system
US11216211B1 (en) Emulated block storage for devices
CN117369906B (zh) Pcie验证平台、方法、装置、存储介质及电子设备
CN113568734A (zh) 基于多核处理器的虚拟化方法、系统、多核处理器和电子设备
US20240354001A1 (en) Device and method for implementing live migration
US20230111884A1 (en) Virtualization method, device, board card and computer-readable storage medium
CN114281749A (zh) 实现序列化及反序列化树数据的装置、方法和存储介质
CN114281750A (zh) 实现序列化及反序列化逻辑指针的方法、装置和存储介质
CN115202808A (zh) 一种用于虚拟化环境中片上系统的dma方法及系统
CN114281468A (zh) 实现热迁移的装置、相关方法及其可读存储介质

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

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

Country of ref document: EP

Kind code of ref document: A1