Starting method, mirror image packet generation method and related device

Through the image packet generation method, the mapping relationship between system images and processor cores is described, which solves the problem of poor flexibility caused by the development of heterogeneous multi-core processor images and the binding of cores, and realizes the efficient deployment and flexible startup of multi-core processors.

CN120469726APending Publication Date: 2025-08-12FEITENG TECH (GUANGZHOU) CO LTD +1
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510559442.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-29
Publication Date
2025-08-12

AI Technical Summary

Technical Problem

In the prior art, when heterogeneous multi-core processors deploy different operating systems, the image development and core are strictly bound to each other, resulting in poor deployment flexibility, low efficiency, and a single startup method, which cannot meet the diverse startup scenario needs.

Method used

A mirror package generation method is provided, which describes the relationship between system images and the mapping relationship with the processor core through mirror combination. The mirror package is packaged based on the first configuration information, allowing system images to be developed in parallel. The mapping relationship is adjusted only by modifying the configuration information, and there is no need to redevelop the image. It supports multiple startup scenarios such as direct mode, master-slave mode and distributed mode.

Benefits of technology

Improves the convenience and flexibility of mirror deployment of multi-core processors, improves deployment efficiency, supports diversified startup scenarios and core heterogeneous boot, and enhances the reliability and manageability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120469726A_ABST
    Figure CN120469726A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a starting method, a mirror image package used in the method comprises a mirror image combination mode and a plurality of system mirror images, and the mirror image combination mode is used for describing the relation among the system mirror images and the mapping relation between the system mirror images and processor cores. The mirror image package is packaged based on the first configuration information and the plurality of system mirror images, so that the plurality of system mirror images can be developed in parallel in the compiling process of the mirror image package, and the system mirror images do not need to be bound with the processor core during development; according to the method, the relationship among the plurality of system mirror images and the mapping relationship between the system mirror images and the processor core are defined through the first configuration information for describing the mirror image combination modes in the packaging process, so that the generation requirements of mirror image packets of different types of mirror image combination modes are met; if the mapping relation between the processor core and the system mirror image needs to be changed, only the first configuration information needs to be modified, the system mirror image does not need to be developed again, and the mirror image deployment convenience of the multi-core processor is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to the field of computer technology, specifically, to firmware technology in the field of computer technology, and more specifically, to a startup method, a method for generating an image package, and related devices. Background Art

[0002] With the continuous development of computer technology, the application scenarios of multi-core processors (especially heterogeneous multi-core processors) are becoming increasingly diverse. For example, in embedded scenarios, when heterogeneous multi-core processor cores are processing complex tasks, tasks with high computing requirements can be assigned to high-performance cores, while low-load tasks can be assigned to low-power cores, thereby reducing overall power consumption while ensuring performance. In addition, different cores can be optimized for specific tasks. For example, some cores can be dedicated to digital signal processing (DSP), while other cores are used for general computing. This design enables the processor to handle diverse workloads more efficiently.

[0003] As the demands for heterogeneous multi-core processors in various application scenarios become increasingly complex, a single operating system can no longer meet the multiple requirements of high performance, real-time performance, low power consumption, and security. Multi-system deployments can run different operating systems to handle different types of tasks. For example, one system can run a general-purpose operating system to handle complex computing tasks, while another system can run a real-time operating system (RTOS) to meet real-time requirements.

[0004] Therefore, it is necessary to improve the deployment convenience of system images for multi-core processors. Summary of the Invention

[0005] The embodiments of this specification provide a startup method, a method for generating an image package, and related devices to achieve the purpose of improving the deployment convenience of the system image of a multi-core processor.

[0006] To achieve the above technical objectives, the embodiments of this specification provide the following technical solutions:

[0007] In a first aspect, an embodiment of the present specification provides a startup method, applied to a target processor, the target processor including multiple processor cores, the startup method comprising:

[0008] In response to the startup operation, executing a startup process;

[0009] The startup process includes:

[0010] Parsing an image package to obtain an image combination method, the image package including the image combination method and multiple system images, the image combination method being used to describe a relationship between the multiple system images and a mapping relationship between the system images and the processor core; the image package being generated based on first configuration information and the multiple system images, the first configuration information being used to describe the image combination method;

[0011] Based on the image combination mode, the system image is run in the plurality of processor cores.

[0012] In a second aspect, an embodiment of the present specification provides a startup device, applied to a target processor, the target processor including multiple processor cores, the startup device including:

[0013] A startup module, configured to execute a startup process in response to a startup operation;

[0014] The startup process includes:

[0015] Parsing an image package to obtain an image combination method, the image package including the image combination method and multiple system images, the image combination method being used to describe a relationship between the multiple system images and a mapping relationship between the system images and the processor core; the image package being generated based on first configuration information and the multiple system images, the first configuration information being used to describe the image combination method;

[0016] Based on the image combination mode, the system image is run in the plurality of processor cores.

[0017] Optionally, the mirror combination mode includes a direct mode;

[0018] In the direct mode, the relationship between the multiple system images includes: the multiple system images are packaged in the image package according to a set order, and the multiple system images are run in sequence according to the set order.

[0019] Optionally, the multiple processor cores include a first target core, and when the image combination mode includes the direct mode, the startup module runs the system image in the multiple processor cores based on the image combination mode, specifically for:

[0020] The first target core runs a startup boot program to execute a boot process, which includes: searching for the multiple system images, checking the integrity of each system image, waking up the other processor cores according to the image combination method, and passing the image address of the system image corresponding to the processor core to each processor core, and guiding each processor core to run the corresponding system image in sequence according to the packaging order of each system image in the image package.

[0021] Optionally, the plurality of processor cores further include: a fixed startup core;

[0022] Before the first target core of the startup module searches for the multiple system images, the startup module is further configured to:

[0023] The fixed startup core runs the startup boot program to determine whether startup is required. If so, the fixed startup core performs the boot process as the first target core; if not, the fixed startup core wakes up the first target core to enable the first target core to run the startup boot program.

[0024] Optionally, the mirror combination mode includes a master-slave mode;

[0025] In the master-slave mode, the multiple system images include a master image and at least one slave image, and the relationship between the multiple system images includes: the at least one slave image is appended to the master image as a code segment, and the multiple system images are run in the order of the master image taking precedence over the slave image.

[0026] Optionally, the multiple processor cores include a second target core, and when the image combination mode includes a master-slave mode, the startup module runs the system image in the multiple processor cores based on the image combination mode, specifically for:

[0027] The second target core runs the master image to run a main operating system in the second target core, and searches for the address of the slave image through a core management code interface of the main operating system;

[0028] The slave image is loaded into the memory space of the main operating system according to the address of the slave image, and the slave image is deployed according to the slave image loaded in the memory space of the main operating system.

[0029] Optionally, the mirror combination mode includes a distributed mode;

[0030] In the distributed mode, the relationship between the multiple system images includes: the multiple system images are distributed in multiple mirror groups, the mirror group includes a boot program and at least one system image, and the mirror group has the function of guiding the operation of other mirror groups; each mirror group corresponds to a different processor core.

[0031] Optionally, when the image combination mode includes a distributed mode, the startup module runs the system image in the plurality of processor cores based on the image combination mode specifically for:

[0032] Waking up at least some of the processor cores, and transmitting a target address to the awakened processor cores, wherein the target address includes an address of a mirror group corresponding to the processor core;

[0033] Each of the processor cores deploys the system image included in the image group according to the target address.

[0034] Optionally, there is at least one mirror group that is a master-slave mirror group, the master-slave mirror group includes multiple system images, the multiple system images in the same master-slave mirror group include a master image and at least one slave image, and the at least one slave image is appended to the master image as a code segment.

[0035] In a third aspect, an embodiment of the present specification further provides a method for generating an image package, for generating an image package applied to a target processor, wherein the target processor includes multiple processor cores, and the method for generating the image package includes:

[0036] In response to a compile operation for a plurality of system images, a packaging operation is performed according to first configuration information to obtain the image package; the first configuration information is used to describe an image combination method, and the image combination method is used to describe a relationship between the plurality of system images and a mapping relationship between the system images and the processor core;

[0037] The image package includes the image combination mode and multiple system images.

[0038] In a fourth aspect, an embodiment of the present specification further provides a device for generating an image package, for generating an image package for a target processor, wherein the target processor includes multiple processor cores, and the device for generating the image package includes:

[0039] a compiling module, configured to, in response to a compiling operation for a plurality of system images, perform a packaging operation according to first configuration information to obtain the image package; wherein the first configuration information is used to describe an image combination method, and the image combination method is used to describe a relationship between the plurality of system images and a mapping relationship between the system images and the processor core;

[0040] The image package includes the image combination mode and multiple system images.

[0041] Optionally, the first configuration information includes: a boot program address and configuration items of the system image; wherein,

[0042] The boot program address is used to represent the address where the boot program is stored;

[0043] The configuration item of the system image is used to describe at least one of information such as whether the system image is a primary image, a storage address of the system image, an identifier of a processor core running the system image, and whether the system image is booted by the primary image.

[0044] Optionally, before performing the packaging operation according to the first configuration information, the compiling module is further configured to:

[0045] The configuration items of each system image are verified, and if the verification passes, a step of performing a packaging operation according to the first configuration information is executed.

[0046] In a fifth aspect, an embodiment of the present specification also provides a computing device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the startup method or the image package generation method as described above when executing the computer program.

[0047] In a sixth aspect, an embodiment of the present specification further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the startup method or the image package generation method as described above is implemented.

[0048] In a seventh aspect, an embodiment of this specification provides a computer program product or a computer program, wherein the computer program product includes a computer program, and the computer program is stored in a computer-readable storage medium; the processor of the computer device reads the computer program from the computer-readable storage medium, and when the processor executes the computer program, the steps of the above-mentioned startup method or image package generation method are implemented.

[0049] It can be seen from the above technical solution that the image package used in the startup method provided in the embodiment of this specification includes an image combination method and multiple system images, wherein the image combination method is used to describe the relationship between multiple system images and the mapping relationship between the system image and the processor core, and the image package is packaged based on the first configuration information and the multiple system images. In this way, during the image package compilation process, multiple system images can be developed in parallel separately, and the system image does not need to be bound to the processor core during development. It is only necessary to define the relationship between multiple system images and the mapping relationship between the system image and the processor core through the first configuration information describing the image combination method during the packaging process, thereby meeting the generation requirements of image packages of different types of image combination methods. If the mapping relationship between the processor core and the system image needs to be changed, it is only necessary to modify the first configuration information without redeveloping the system image, which is conducive to improving the convenience of image deployment of multi-core processors. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of this specification. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without any creative work.

[0051] Figure 1 A schematic flow chart of a startup method provided for one embodiment of this specification;

[0052] Figure 2 A schematic diagram of a flow chart of a method for generating an image package provided in one embodiment of this specification;

[0053] Figure 3 A schematic diagram of an application scenario of a method for generating an image package provided in one embodiment of this specification;

[0054] Figure 4 A schematic diagram of three mirror image combinations provided for one embodiment of this specification;

[0055] Figure 5 A schematic diagram of a feasible configuration file provided for one embodiment of this specification;

[0056] Figure 6 A schematic diagram of a compilation framework of an image package when the image combination mode includes a direct mode is provided for one embodiment of this specification;

[0057] Figure 7 A schematic diagram of a compilation framework of an image package when the image combination mode includes a master-slave mode, provided as an embodiment of this specification;

[0058] Figure 8 A schematic diagram of a compilation framework for an image package when the image combination mode includes a distributed mode, provided as an embodiment of this specification;

[0059] Figure 9 A schematic diagram of feasible application scenarios of three mirror combination methods provided for one embodiment of this specification;

[0060] Figure 10 This is a schematic diagram illustrating an example of multi-core direct boot in direct mode;

[0061] Figure 11 A schematic diagram illustrating details of starting, running, ending, and closing between processor cores in master-slave mode;

[0062] Figure 12 A schematic diagram illustrating the startup deployment of a target processor in a distributed mode;

[0063] Figure 13 A schematic diagram of the structure of a computing device provided for one embodiment of this specification. DETAILED DESCRIPTION

[0064] Unless otherwise defined, technical or scientific terms used in the embodiments of this specification should have the same ordinary meaning as those understood by persons of ordinary skill in the art to which this specification pertains. The terms "first," "second," and similar terms used in the embodiments of this specification do not denote any order, quantity, or importance, but are provided solely to avoid confusion between constituent elements.

[0065] Unless the context requires otherwise, throughout this specification, the term "plurality" means "at least two," and "including" is to be interpreted as open and inclusive, meaning "including, but not limited to." Throughout this specification, the terms "one embodiment," "some embodiments," "exemplary embodiments," "example," "specific example," or "some examples" are intended to indicate that a particular feature, structure, material, or characteristic associated with the embodiment or example is included in at least one embodiment or example of this specification. The schematic representations of these terms do not necessarily refer to the same embodiment or example.

[0066] The following will describe the technical solutions in the embodiments of this specification in conjunction with the drawings in the embodiments of this specification. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this specification.

[0067] Overview

[0068] Heterogeneous multi-core processors can contain multiple different types of processor cores, such as high-performance cores and low-power cores. When processing complex tasks, tasks with high computing requirements can be assigned to high-performance cores, while low-load tasks can be assigned to low-power cores, thereby reducing overall power consumption while ensuring performance. In addition, different cores can be optimized for specific tasks. For example, some cores can be used for digital signal processing (DSP), while other cores can be used for general computing. This design allows the processor to handle diverse workloads more efficiently. By processing tasks in parallel on different cores, heterogeneous multi-core processors can significantly improve the overall performance of the system. For example, in tasks with a high degree of parallelism, such as graphics rendering and scientific computing, multi-core design can achieve higher processing efficiency.

[0069] As heterogeneous multi-core processors become increasingly applicable in diverse scenarios, the demands placed on them are becoming increasingly complex. Heterogeneous multi-core processors running a single operating system are finding it increasingly difficult to meet diverse requirements, including high performance, real-time performance, low power consumption, and security. Multi-OS deployments allow different operating systems to handle different types of tasks. For example, one core can run a general-purpose operating system for complex computing tasks, while another core can run a real-time operating system (RTOS) to meet real-time requirements. Furthermore, multi-OS deployments distribute critical tasks across different operating systems. Even if one operating system fails, the others can continue to operate normally. This redundant design significantly improves system reliability and availability. Furthermore, resource isolation and access control can be implemented between different operating systems, effectively preventing the spread of security vulnerabilities.

[0070] Currently, in order to meet the needs of deploying different operating systems in heterogeneous multi-core processors, developers need to develop targeted images for the cores running the operating systems (images can include accurate copies of files or storage devices containing the operating system and related software configuration information, and can be used to install, back up, or restore the operating system) to ensure that the specific operating system corresponds to the core and that the specific operating system can be correctly booted and run by the specific core. However, this development and deployment method may lead to many problems, such as: strict correspondence between the operating system and the core, a single system integration method, and a failure to cope with complex multi-system and diverse application scenarios. If the heterogeneous multi-core processor needs to replace the core to run a certain operating system, the developer needs to redevelop the image, resulting in poor deployment flexibility and low efficiency. In addition, the startup method of the heterogeneous multi-core processor is single. Once a certain operating system fails to boot and load, the entire heterogeneous multi-core processor cannot start normally, and cannot meet diverse startup scenarios such as heterogeneous booting between cores.

[0071] In order to solve this problem, the inventor provides a method for generating an image package and a startup method, wherein the image package can include an image combination method and multiple system images, wherein the image combination method is used to describe the relationship between the multiple system images and the mapping relationship between the system images and the processor core, and the image package is packaged based on the first configuration information and the multiple system images. In this way, during the image package compilation process, multiple system images can be developed in parallel, and the system images do not need to be bound to the processor core during development. It is only necessary to define the relationship between the multiple system images and the mapping relationship between the system images and the processor core during the packaging process by describing the first configuration information of the image combination method, so as to meet the generation requirements of image packages of different types of image combination methods. If the mapping relationship between the processor core and the system image needs to be changed, it is only necessary to modify the first configuration information without redeveloping the system image, which is conducive to improving the convenience of image deployment of multi-core processors, improving deployment flexibility and deployment efficiency. In addition, the image combination method can include multiple modes such as direct mode, master-slave mode and distributed mode. By configuring the first configuration information, it is possible to meet various startup scenarios such as heterogeneous booting between cores according to needs.

[0072] Based on the above concept, the embodiments of this specification provide a startup method and a method for generating a mirror package. The startup method and the method for generating a mirror package provided in the embodiments of this specification will be exemplarily described below with reference to the accompanying drawings.

[0073] Exemplary Methods

[0074] To be applied to Figure 1 Taking the target processor in as an example, an embodiment of this specification provides a startup method, wherein the target processor includes multiple processor cores, and the startup method includes:

[0075] S101: In response to a startup operation, executing a startup process;

[0076] The startup process includes:

[0077] S1011: Parse an image package to obtain an image combination method, wherein the image package includes the image combination method and multiple system images, wherein the image combination method is used to describe the relationship between the multiple system images and the mapping relationship between the system images and the processor core; the image package is generated based on first configuration information and the multiple system images, wherein the first configuration information is used to describe the image combination method;

[0078] S1012: Based on the image combination mode, run the system image in the plurality of processor cores.

[0079] In this embodiment, the image package is generated based on the first configuration information and multiple system image packages. In this way, during the development of the system image, multiple system images can be developed in parallel by different developers. There is no need to bind the system image to the processor core. It is only necessary to define the relationship between the multiple system images and the mapping relationship between the system image and the processor core through the first configuration information that describes the image combination method during the packaging process. This meets the generation requirements of image packages for different types of image combinations. If the mapping relationship between the processor core and the system image needs to be changed, it is only necessary to modify the first configuration information without redeveloping the system image, which is conducive to improving the convenience of image deployment for multi-core processors.

[0080] In order to meet the startup requirements in different application scenarios, some embodiments of this specification provide some feasible mirror combination methods. For example, in one embodiment, the mirror combination method includes a direct mode;

[0081] In the direct mode, the relationship between the multiple system images includes: the multiple system images are packaged in the image package according to a set order, and the multiple system images are run in sequence according to the set order.

[0082] In this embodiment, when the image combination method includes a direct mode, the sequential startup of multiple system images can be supported. For example, assuming that the processor core A of the target processor is started first, after booting and loading the corresponding operating system A according to the image combination method, the processor core B is booted and loaded with the corresponding operating system B, the processor core C is booted and loaded with the corresponding operating system C, and so on, in accordance with the packaging order of the multiple system images in the image package, to meet the sequential loading requirements.

[0083] In one embodiment, a feasible process for running a system image in multiple processor cores is provided. Specifically, the multiple processor cores include a first target core. When the image combination mode includes the direct mode, running the system image in the multiple processor cores based on the image combination mode includes:

[0084] The first target core runs a startup boot program to execute a boot process, which includes: searching for the multiple system images, checking the integrity of each system image, waking up the other processor cores according to the image combination method, and passing the image address of the system image corresponding to the processor core to each processor core, and guiding each processor core to run the corresponding system image in sequence according to the packaging order of each system image in the image package.

[0085] In this embodiment, the first target core may refer to the processor core corresponding to the first system image to be run in the image package. The first target core executes a boot program to check the integrity of each system image. If the check passes, the other processor cores are awakened according to the image combination method, and the image address of the system image corresponding to each processor core is passed to each processor core. Each processor core is then guided to run its corresponding system image in sequence according to the packaging order of the system images in the image package, completing the startup process of the target processor. If the integrity of each system image fails to pass, a startup exception result may be returned, stopping the startup process to ensure the normal startup of the target processor.

[0086] In one embodiment, the plurality of processor cores further comprises: a fixed boot core;

[0087] Before the first target core searches for the multiple system images, the method further includes:

[0088] The fixed startup core runs the startup boot program to determine whether startup is required. If so, the fixed startup core performs the boot process as the first target core; if not, the fixed startup core wakes up the first target core to enable the first target core to run the startup boot program.

[0089] In this embodiment, the fixed startup core refers to the processor core that is set by default in the target processor for first startup, or refers to the processor core that is configured by the user for first startup. In this embodiment, during the startup process, the fixed startup core first runs the startup boot program. It can determine whether the fixed startup core itself needs to be started based on whether there is a system image corresponding to the fixed startup core in the image package. If so, the fixed startup core acts as the first target core to execute the boot process. If not, the fixed startup core can determine the first target core based on the packaging relationship between the system images in the image package, wake up the first target core, and have the first target core run the startup boot process to execute the complete startup process. In this way, the startup method can be applied to scenarios with a fixed startup core design, ensuring normal startup in this scenario and improving the adaptability of the startup method.

[0090] In one embodiment, the mirror combination mode includes a master-slave mode;

[0091] In the master-slave mode, the multiple system images include a master image and at least one slave image, and the relationship between the multiple system images includes: the at least one slave image is appended to the master image as a code segment, and the multiple system images are run in the order of the master image taking precedence over the slave image.

[0092] In this embodiment, the processor core running the master image can be called the master core, and the processor core running the slave image can be called the slave core. The slave image corresponding to the slave core is appended as a code segment to the master image corresponding to the master core. In this case, the master core can have management authority over the slave core, and the slave core can rely on the master core management. When the master core is started, the master core can control at least one slave core to perform operations such as running the slave image, meet the hot-swap requirements of the slave core corresponding to the slave image, and achieve the purpose of dynamic deployment of the slave image.

[0093] In one embodiment, the multiple processor cores include a second target core, and when the image combination mode includes a master-slave mode, running the system image in the multiple processor cores based on the image combination mode includes:

[0094] The second target core runs the master image to run a main operating system in the second target core, and searches for the address of the slave image through a core management code interface of the main operating system;

[0095] The slave image is loaded into the memory space of the main operating system according to the address of the slave image, and the slave image is deployed according to the slave image loaded in the memory space of the main operating system.

[0096] In this embodiment, a method is provided for the main core to find the address of the slave image. The main core can find the address of the slave image through the core management code interface of its operating system, and can load the slave image into the memory space of the main core operating system. During the hot plugging of the slave core, the slave image can be found directly from the memory space of the main core operating system (i.e., the main operating system), which is conducive to improving processing efficiency.

[0097] In one embodiment, the mirror combination mode includes a distributed mode;

[0098] In the distributed mode, the relationship between the multiple system images includes: the multiple system images are distributed in multiple mirror groups, the mirror group includes a boot program and at least one system image, and the mirror group has the function of guiding the operation of other mirror groups; each mirror group corresponds to a different processor core.

[0099] When the mirror combination method includes a distributed mode, the mirror package contains multiple mirror groups, each of which can include a boot program and at least one of the system images, that is, each mirror package is a complete image containing a boot program (boot code), and each mirror group can boot each other to run. In this way, based on the mirror package, each processor core can be personalized and started according to the user configuration, such as implementing delayed startup, verifying self-test logic, querying the status of other processor cores (when a startup error occurs in other processor cores, the adjacent processor cores can be re-awakened and started, thereby providing a fault tolerance mechanism when a certain mirror group deployment fails, ensuring system stability), restart number limit (when the image deployment failure in a single processor core exceeds a certain number of times, it will no longer be re-awakened) and power consumption configuration, etc. When the mirror combination method includes a distributed mode, dynamic deployment and mutual booting between different operating systems can be achieved. Since each mirror package contains a boot program and a system image, a more flexible deployment method can be achieved, the reliability and manageability of the target processor startup can be improved, and a redundant system mirror architecture is provided, which is conducive to improving the startup success rate of each processor core of the target processor.

[0100] In one embodiment, a feasible method for running a system image in multiple processor cores in a distributed mode is provided. Specifically, when the image combination mode includes a distributed mode, running the system image in the multiple processor cores based on the image combination mode includes:

[0101] Waking up at least some of the processor cores, and transmitting a target address to the awakened processor cores, wherein the target address includes an address of a mirror group corresponding to the processor core;

[0102] Each of the processor cores deploys the system image included in the image group according to the target address.

[0103] In this embodiment, after the target processor is powered on, a certain processor core can first run a boot program. Based on the correspondence between the system image and the processor core contained in the image package, at least some of the processor cores that need to be awakened (i.e., the processor cores for which the image package contains the corresponding system image) are awakened. The processor cores that do not need to be awakened can only be tested and their status marked. After awakening at least some of the processor cores, the target address can be passed to the awakened processor cores, so that each processor core can obtain the system image from the address and deploy it according to the target address. This method does not require the image itself to be passed to the awakened processor core, which helps reduce the amount of data required to be transmitted and improves the execution efficiency of the method.

[0104] In one embodiment, a situation of mixed master-slave mode in a mirror group is provided. Specifically, there is at least one mirror group that is a master-slave mirror group, the master-slave mirror group includes multiple system images, and the multiple system images located in the same master-slave mirror group include a master image and at least one slave image, and the at least one slave image is appended to the master image as a code segment.

[0105] In this embodiment, there can be at least one master-slave mirror group in the parallel mode mirror group, thereby achieving mixed compatibility of the parallel mode and the master-slave mode. In the master-slave mirror group, each system mirror can correspond to a different processor core. Similar to the master-slave mode described above, the processor core running the master image can be called the master core, and the processor core running the slave image can be called the slave core. The slave image corresponding to the slave core is appended as a code segment to the master image corresponding to the master core. In this case, the master core can have management authority over the slave core, and the slave core can rely on the master core management. When the master core is started, the master core can control at least one slave core to perform operations such as running the slave image, meeting the hot-swap requirements of the slave core corresponding to the slave image, and achieving the purpose of dynamic deployment of the slave image.

[0106] Regarding the generation process of the mirror package corresponding to different mirror combination modes, reference may be made to the relevant description below, and the startup process of the mirror package generated by the mirror package generation method described below may refer to the relevant description above. Specifically, the embodiment of this specification also provides a mirror package generation method for generating a mirror package for a target processor, wherein the target processor includes multiple processor cores, such as Figure 2 As shown, the method for generating the mirror package includes:

[0107] S201: In response to a compile operation for a plurality of system images, performing a packaging operation according to first configuration information to obtain the image package; the first configuration information is used to describe an image combination method, and the image combination method is used to describe a relationship between the plurality of system images and a mapping relationship between the system images and the processor core;

[0108] The image package includes the image combination mode and multiple system images.

[0109] In this embodiment, the relationship between multiple system images may include at least one of a master-slave relationship between system images (a master image may be used to boot and load a slave image), whether the system image is booted by the master image, and a boot order between system images; the mapping relationship between system images and processor cores may include at least one of: on which processor core the system image runs, whether the system image is an image running as the master core, whether the system image is a slave image, and whether the system image is booted by the master image; in addition, in some embodiments, the first configuration information may further include: a boot program address and configuration items of the system image; wherein,

[0110] The boot program address is used to represent the address where the boot program is stored;

[0111] The configuration item of the system image is used to describe at least one of information such as whether the system image is a primary image, a storage address of the system image, an identifier of a processor core running the system image, and whether the system image is booted by the primary image.

[0112] In this embodiment, when an image package is generated, it is necessary to provide first configuration information and multiple system images, wherein the first configuration information is used to describe an image combination method, and the image combination method describes the relationship between multiple system images and the mapping relationship between the system images and the processor core. In this way, during the development process of multiple system images, multiple system images can be developed in parallel separately, and the system images do not need to be bound to the processor core during development. It is only necessary to define the relationship between multiple system images and the mapping relationship between the system images and the processor core during the packaging process through the first configuration information describing the image combination method, thereby meeting the generation requirements of image packages of different types of image combination methods. If the mapping relationship between the processor core and the system image needs to be changed, it is only necessary to modify the first configuration information without redeveloping the system image, which is conducive to improving the convenience of image deployment of multi-core processors.

[0113] As mentioned above, the mirror combination mode may include at least one of a direct mode, a master-slave mode and a distributed mode. Figure 3 , Figure 3 The application scenario of the image package generation method provided by the embodiment of this specification is shown. The image package generation method provided by the embodiment of this specification can be applied to a compilation host, which can be a host of X86, X64 or ARM architecture. After the compilation is completed and the image package is generated, the image package can be burned to the storage medium of the target processor. The target processor can be an embedded multi-core processor or a general multi-core processor, which is not limited in this specification. Figure 3In the description, system engineering 1 to N may refer to the entire development project of system images 1 to N, which may cover the entire life cycle from demand analysis, hardware design, software design, system integration to test deployment. Developers may design configuration files to point to various system engineering projects. In the implementation of this specification, the first configuration information required in the image packaging process may also be configured in the configuration file. The automatic script may obtain relevant configuration information based on parsing the configuration file, generate corresponding system images based on the compilation of each system engineering project, and perform packaging operations on multiple system images according to the description of the first configuration information based on the first configuration information to obtain the final image package. The image package may be burned into the storage medium of the target processor so that the target processor can perform multi-processor core based on the image package (for example, it may be as follows Figure 3 The startup operation of Core0~CoreN) shown in FIG. Figure 3 In the illustrated embodiment, the method for generating the mirror image package may be integrated into an automatic script, and the automatic script executes the relevant steps of the method for generating the mirror image package during runtime.

[0114] Specifically, Figure 3 It can include a preparation phase, a compilation phase, and a packaging phase. In the preparation phase, configuration files and automatic scripts that can identify and parse configuration files can be designed. Users can choose to modify configuration files and set the first configuration information according to their needs to meet the generation requirements of mirror packages in direct mode, master-slave mode, and distributed mode.

[0115] During the compilation phase, the automatic script can enter different system projects according to the configuration file, call the system compiler and linker described in the corresponding configuration file for corresponding compilation, and generate the corresponding single system image. The automatic script can record the basic information of the system image.

[0116] During the packaging phase, the automatic script can use the packaging and building tool to package multiple system images in layers and levels according to the first configuration information, using the system image path and the first configuration information recorded in the configuration file to generate a combined image that meets the requirements.

[0117] refer to Figure 4 , Figure 4 Three image combination methods are shown. In direct mode, the boot loader can sequentially boot system image 0, system image 1, and so on to run on their corresponding processor cores; in master-slave mode, the boot loader can boot the master image (for example, system image 1) to run, and system image 2 is inserted into system image 1 as a code segment, so that system image 1 can repeatedly boot system image 2; in distributed mode, each image package contains a boot loader and at least one system image, and each image package can boot each other.

[0118] refer to Figure 5 , Figure 5 A feasible configuration file is shown, which may include some or all of the information such as the bootloader address, system engineering path, system image and core association configuration, image configuration bit, application system engineering compilation configuration, system image configuration items, etc. Figure 5 In the command, "config0" is the index. The automatic script can find the corresponding configuration file based on this index. That is, when the configuration file index in the command in the automatic script is consistent with this index, the configuration file that should be parsed can be identified; "bootstrap". "0xb0120000" is the boot loader address; the configuration item can be used to record the relevant information of a single system image. The system images corresponding to multiple configuration items are finally packaged to generate an image package. Figure 5 In the , "path0" and other characters indicate the configuration item name; ". / " and other characters indicate the routine path, which can be used to find the routine path that needs to be compiled into AMP (asymmetric multi-core processing) multi-core operation; the core identifier (the value of the core identifier can be the identifier of the processor core, for example Figure 5 The core identifier (with values of 0, 1, and 2 representing processor cores identified as 0, 1, and 2, respectively) is used to indicate which core the system image is running on. When the system image does not need to be started by the boot loader, it only needs to be packaged. In this case, the core identifier can be set to 10000. The master core identifier (the master core identifier can have values of 0 or 1. When the master core identifier is 0, it can indicate that the system image is a slave image, and when the master core identifier is 1, it can indicate that the system image is a master image) is used to identify whether the system image is a master image (i.e., a system image run by the master core). Usually, there can only be one master image in a configuration item in a configuration file. In some cases, when the master core identifier is 1, the system image is the master image. The configuration file (for example, "**_aarch64_demo_template.config") is used to indicate the configuration file directory. The "**" can be information such as the chip name, indicating that the automatic script can compile according to the configuration file in the config directory under the loading routine path to ensure that the file exists and the chip type and operating architecture of the same configuration group are consistent.

[0119] The following examples illustrate the possible configuration files corresponding to different image combinations:

[0120] When the image combination mode includes direct mode, the configuration file only needs a bootloader address + a combination of one or more configuration items. The main core identifiers of these system image configuration items can all be 0. For example, Figure 5In the example, the main core identifiers of the configuration items of multiple system images are all 0. According to the core identifiers of these three configuration items, it can be seen that these three system images can run on core 0, core 1, and core 2 respectively.

[0121] When the image combination mode includes a master-slave mode, in some embodiments, the configuration items in the configuration file may include a boot program address + a master image configuration item (the master core identifier of the system image configuration item may be 1, indicating that the system image is the master image) + a single or multiple slave image configuration items (the core identifier of the system image configuration item may be 10000, indicating that the system image is a slave image. When the core identifier is 10000, the boot program will skip booting the system image and the processor core running the master image will wake up and start it). In some embodiments, the configuration items named "path0" and "path1" describe the configuration items of the system image running as a slave image, and the core identifiers of these configuration items are both 10000; the configuration item named "path2" describes the configuration items of the system image running as the master image, and the core identifier of the configuration item is 1, indicating that it runs on the processor core with the core identifier of 1. The master core identifier of the configuration item is 1, indicating that it is the master image. The system images described by "path0" and "path1" are managed by the master image on the processor core with the core identifier of 1.

[0122] When the image combination mode includes a distributed mode, in some embodiments, the configuration file requires a bootloader address + multiple system image configuration items. In some embodiments, the system images described by the configuration items named "path0," "path1," and "path2" can be used as independent system images, capable of self-starting and waking up and booting system images in other image packages. In some embodiments, each image package includes a system image. In some embodiments, when the image combination mode includes a distributed mode, the image package can also include multiple system images. For example, in some embodiments, it can include two mirror groups, one of which includes an independent system image and the other includes a master-slave combination image. The independent system image runs on processor core 2. This mirror group and the other mirror group combination start each other as a redundant pair to ensure the reliability of the entire target processor. In the master-slave combination of the other mirror group, the master image runs on processor core 1, and the master image determines which processor core the slave image runs on. In one embodiment, the master-slave image can be used as an application running system, and the independent image can be monitored and managed in real time to ensure reliable system operation. When an error occurs, it can be woken up and restarted.

[0123] For the compilation process, refer to Figure 6 , Figure 6The compilation framework of the image package when the image combination method includes the direct mode is shown. After running the script (i.e. running the automatic script), the automatic script first parses the configuration file and extracts key information (which may include the first configuration information). The automatic script can determine whether the configuration logic in the configuration file meets the requirements, for example, there cannot be mutually exclusive configuration items (for example, in the direct mode, the core identifiers have the same conflict; in the master-slave mode, the master core identifiers of the master image and the slave image are not configured at the same time are both 1; for example, in a certain configuration item, if the core identifier is 10000, that is, when the master image controls which processor core it runs on, the specified processor core cannot appear, etc.), then the script's command execution program enters the corresponding system project according to the extracted key information, calls the compilation instruction (i.e. calls the corresponding compiler, linker, etc.) for compilation, generates the corresponding single system image (*.elf), records the path information of each system image after successful compilation, packages the image package (packed.bin) according to the first configuration information, starts the boot project to generate the final image package, and then Figure 6 In the package, packed_image.elf indicates the name of the image package generated by the final packaging.

[0124] refer to Figure 7 , Figure 7 The figure shows the compilation framework when the image combination mode is master-slave mode. The automatic script will search for the configuration item with the master core identification as 1 in the extracted configuration items. When there are multiple configuration items with the master core identification as 1, an error may be reported. The slave images (system images described by the configuration items with the core identification as 10000) can be sorted, compiled and packaged first to generate a combined image including at least one slave image. Then, when the master image is compiled, the combined image can be inserted into the master image as a code segment to facilitate post-startup addressing and complete the generation of the image package in the master-slave mode.

[0125] refer to Figure 8 , Figure 8 The figure shows the compilation framework when the image combination mode is distributed mode. The automatic script compiles according to the order of each image group in the configuration file to generate an independent image file with a boot loader. Figure 8 The compilation process of a mixed combination of direct boot image and master-slave mode image is shown.

[0126] It should be noted that different image combinations can be logically determined based on differences between system images, such as whether there are dependencies or conflicts between system images. Specifically for AMP (asymmetric multi-processing), considerations can be made regarding issues such as duplicate boots between system images and processor core restarts and shutdowns, as well as protecting the integrity of slave images relative to the master image. These issues are application-dependent and are not discussed in detail in this specification.

[0127] After the image package is generated, it can be burned to the specified address of the storage medium on the target processor through the network or a burning tool.

[0128] refer to Figure 9 , Figure 9 The feasible application scenarios of three image combination methods are shown. After the image package is burned into the target processor, during the startup process, in direct mode, the system images corresponding to each processor core (Core0 to CoreN) are run in sequence; in master-slave mode, the processor core corresponding to the master image is first booted and started, and then after the processor core corresponding to the master image is booted, the other processor cores are managed to run the slave images; in distributed mode, each image group includes a boot program (boot), and the processor cores in each image group can autonomously boot the processor cores in other image groups. In some embodiments, in this case, a processor core (such as Core0) can immediately execute the startup process after powering on, boot and run the system image corresponding to it, and then boot the processor cores corresponding to the system images in other image groups. Among the three image combination methods, the direct mode can meet the scenario requirements of directly booting a single or multiple processor cores; the master-slave mode can meet the scenario requirements of first booting the processor core corresponding to the master image, and then the processor cores corresponding to the slave images rely on the master core for management; the distributed mode can meet the requirements of diversified distributed deployment.

[0129] refer to Figure 10 , Figure 10 The following example shows a multi-core direct boot in direct mode. After the target processor is powered on, the fixed boot core in the system-on-chip runs the boot program to determine whether it needs to be booted. If it does not need to be booted, it wakes up the processor core that needs to be booted to take over running the boot program and goes to sleep. If it needs to be booted, it searches for the system image in the image package and checks its integrity, parses the image header information of the system image, wakes up and passes the address of the system image to the corresponding processor core, so that it can specify which processor core the system image runs on. Figure 10 The figure shows that different processor cores in the embedded system run corresponding system images. Multiple processor cores (core0 to coreN) run different system images respectively. These system images can include bare metal systems, RTOS (real-time operating system) and FreeRTOS (small real-time operating system), etc. The entry point of the program of these system images can be the main() function (for example, it can be the main.c function).

[0130] refer to Figure 11 , Figure 11The figure shows an example of details of starting, running, ending and closing between processor cores in the master-slave mode, especially illustrating the situation where the master core (Master core, i.e. core 0) manages other slave cores (such as core 1 and core 2).

[0131] During the startup phase, the master core (Master) is first activated and dynamically loads the operating system's system image. After the master core boots up, it manages and coordinates the other slave cores and their system images. This means the master core controls the startup, task allocation, and resource management of the slave cores (Core 0 runs the Master image and manages the slave cores and their system images). Core 0 can then use Core 1 to run Slave Image 0. While Core 1 is running, Core 0 can proactively terminate Core 0, bringing it to a halt. After Core 1 shuts down, Core 0 can reclaim Core 1's resources and allocate them to other cores (such as Core 1). After reclaiming Core 1, Core 0 can restart and wake Core 1 to run Slave Image 1. Similarly, Core 0 can proactively terminate Core 1, which will shut down after being terminated. Core 0 can also use Core 2 to run Slave Image 0. Core 2 can be a processor core with a simpler RSICV architecture or a processor core with a low-power mode, thus allowing Slave Image 0 to run in a low-power state. Similarly, Core 0 can proactively terminate Core 2, which will shut down after being terminated. The above process of core 0 managing other slave cores can be repeated as needed to achieve requirements such as hot plugging of slave cores.

[0132] refer to Figure 12 , Figure 12 This example illustrates the startup deployment of a target processor in distributed mode. After the target processor is powered on, core 0 immediately executes independent image 0 in image group 0. Independent image 1 in image group 1 corresponding to core 1 can be delayed for 0.1 seconds to start. Independent image 2 in image group 2 corresponding to core 2 can be configured to run in a low-power state. The three processor cores monitor each other for wake-up. That is, if a processor core fails to start or malfunctions, the other processor cores can wake it up and restart it upon detecting the startup failure or malfunction. The maximum number of restarts can be set according to the configuration. This approach enables dynamic deployment and mutual guidance between different systems.

[0133] Exemplary devices

[0134] In an exemplary embodiment of the present specification, a startup device is further provided, which is applied to a target processor, wherein the target processor includes multiple processor cores, and the startup device includes:

[0135] A startup module, configured to execute a startup process in response to a startup operation;

[0136] The startup process includes:

[0137] Parsing an image package to obtain an image combination method, the image package including the image combination method and multiple system images, the image combination method being used to describe a relationship between the multiple system images and a mapping relationship between the system images and the processor core; the image package being generated based on first configuration information and the multiple system images, the first configuration information being used to describe the image combination method;

[0138] Based on the image combination mode, the system image is run in the plurality of processor cores.

[0139] Optionally, the mirror combination mode includes a direct mode;

[0140] In the direct mode, the relationship between the multiple system images includes: the multiple system images are packaged in the image package according to a set order, and the multiple system images are run in sequence according to the set order.

[0141] Optionally, the multiple processor cores include a first target core, and when the image combination mode includes the direct mode, the startup module runs the system image in the multiple processor cores based on the image combination mode, specifically for:

[0142] The first target core runs a startup boot program to execute a boot process, which includes: searching for the multiple system images, checking the integrity of each system image, waking up the other processor cores according to the image combination method, and passing the image address of the system image corresponding to the processor core to each processor core, and guiding each processor core to run the corresponding system image in sequence according to the packaging order of each system image in the image package.

[0143] Optionally, the plurality of processor cores further include: a fixed startup core;

[0144] Before the first target core of the startup module searches for the multiple system images, the startup module is further configured to:

[0145] The fixed startup core runs the startup boot program to determine whether startup is required. If so, the fixed startup core performs the boot process as the first target core; if not, the fixed startup core wakes up the first target core to enable the first target core to run the startup boot program.

[0146] Optionally, the mirror combination mode includes a master-slave mode;

[0147] In the master-slave mode, the multiple system images include a master image and at least one slave image, and the relationship between the multiple system images includes: the at least one slave image is appended to the master image as a code segment, and the multiple system images are run in the order of the master image taking precedence over the slave image.

[0148] Optionally, the multiple processor cores include a second target core, and when the image combination mode includes a master-slave mode, the startup module runs the system image in the multiple processor cores based on the image combination mode, specifically for:

[0149] The second target core runs the master image to run a main operating system in the second target core, and searches for the address of the slave image through a core management code interface of the main operating system;

[0150] The slave image is loaded into the memory space of the main operating system according to the address of the slave image, and the slave image is deployed according to the slave image loaded in the memory space of the main operating system.

[0151] Optionally, the mirror combination mode includes a distributed mode;

[0152] In the distributed mode, the relationship between the multiple system images includes: the multiple system images are distributed in multiple mirror groups, the mirror group includes a boot program and at least one system image, and the mirror group has the function of guiding the operation of other mirror groups; each mirror group corresponds to a different processor core.

[0153] Optionally, when the image combination mode includes a distributed mode, the startup module runs the system image in the plurality of processor cores based on the image combination mode specifically for:

[0154] Waking up at least some of the processor cores, and transmitting a target address to the awakened processor cores, wherein the target address includes an address of a mirror group corresponding to the processor core;

[0155] Each of the processor cores deploys the system image included in the image group according to the target address.

[0156] Optionally, there is at least one mirror group that is a master-slave mirror group, the master-slave mirror group includes multiple system images, the multiple system images in the same master-slave mirror group include a master image and at least one slave image, and the at least one slave image is appended to the master image as a code segment.

[0157] In one embodiment, a device for generating a mirror package is also provided, including:

[0158] a compiling module, configured to, in response to a compiling operation for a plurality of system images, perform a packaging operation according to first configuration information to obtain the image package; wherein the first configuration information is used to describe an image combination method, and the image combination method is used to describe a relationship between the plurality of system images and a mapping relationship between the system images and the processor core;

[0159] The image package includes the image combination mode and multiple system images.

[0160] Optionally, the first configuration information includes: a boot program address and configuration items of the system image; wherein,

[0161] The boot program address is used to represent the address where the boot program is stored;

[0162] The configuration item of the system image is used to describe at least one of information such as whether the system image is a primary image, a storage address of the system image, an identifier of a processor core running the system image, and whether the system image is booted by the primary image.

[0163] Optionally, before performing the packaging operation according to the first configuration information, the compiling module is further configured to:

[0164] The configuration items of each system image are verified, and if the verification passes, a step of performing a packaging operation according to the first configuration information is executed.

[0165] For the specific definition of the startup device or the image package generation device, please refer to the definition of the startup method or the image package generation method above, and will not be repeated here. The various modules in the above-mentioned startup device or the image package generation device can be implemented in whole or in part by software, hardware, and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0166] Exemplary computing devices

[0167] Another embodiment of this specification also provides a computing device, see Figure 13 As shown, an exemplary embodiment of the present specification further provides a computing device, including: a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, it performs the steps of the startup method or the image package generation method according to various embodiments of the present specification described in the above embodiments of the present specification.

[0168] The internal structure of the computing device can be as follows Figure 13As shown, the computing device includes a processor, memory, network interface, and input device connected via a system bus. The processor of the computing device is used to provide computing and control capabilities. The memory of the computing device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The network interface of the computing device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, the steps of the startup method or the image package generation method according to various embodiments of this specification described in the above embodiments of this specification are followed.

[0169] The processor may include a main processor, and may also include a baseband chip, a modem, etc.

[0170] The memory stores a program for executing the technical solution of the present invention, and may also store an operating system and other key services. Specifically, the program may include program code, which includes computer operating instructions. More specifically, the memory may include read-only memory (ROM), other types of static storage devices that can store static information and instructions, random access memory (RAM), other types of dynamic storage devices that can store information and instructions, disk storage, flash memory, etc.

[0171] The processor may be a general-purpose processor, such as a general-purpose central processing unit (CPU), a microprocessor, or the like, or an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the present invention. Alternatively, the processor may be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic device, discrete gate or transistor logic device, or discrete hardware components.

[0172] The input device may include a device for receiving data and information input by the user, such as a keyboard, mouse, camera, scanner, light pen, voice input device, touch screen, pedometer or gravity sensor.

[0173] Output devices may include means that allow information to be output to a user, such as display screens, printers, speakers, and the like.

[0174] The communication interface may include any device such as a transceiver to communicate with other devices or communication networks, such as Ethernet, Radio Access Network (RAN), Wireless Local Area Network (WLAN), etc.

[0175] The processor executes the program stored in the memory and calls other devices, which can be used to implement each step of any startup method or image package generation method provided in the above embodiments of this specification.

[0176] The computing device may also include a display component and a voice component. The display component may be a liquid crystal display or an electronic ink display. The input device of the computing device may be a touch layer covering the display component, or a button, trackball or touchpad provided on the housing of the computing device, or an external keyboard, touchpad or mouse.

[0177] Those skilled in the art will understand that Figure 13 The structure shown in the figure is only a block diagram of a part of the structure related to the scheme of this specification, and does not constitute a limitation on the computing device to which the scheme of this specification is applied. The specific computing device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0178] Exemplary computer program products and storage media

[0179] In addition to the above methods and devices, the startup method or image package generation method provided in the embodiments of this specification may also be a computer program product, which includes computer program instructions. When the computer program instructions are executed by a processor, the processor executes the steps of the startup method or image package generation method according to various embodiments of this specification described in the above "Exemplary Method" section of this specification.

[0180] The computer program product may be implemented in hardware, software, or a combination thereof. In one embodiment, the computer program product is implemented as a computer storage medium. In another embodiment, the computer program product is implemented as a software product, such as a software development kit (SDK).

[0181] The computer program product may be written in any combination of one or more programming languages to implement the operations of the embodiments of this specification, including object-oriented programming languages such as Java, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computing device, partially on the user's computing device, as a stand-alone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0182] In addition, an embodiment of this specification also provides a computer-readable storage medium on which a computer program is stored, and the computer program is used by a processor to execute the steps of the startup method or the image package generation method according to various embodiments of this specification described in the above "Exemplary Method" section of this specification.

[0183] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this specification can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0184] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0185] The above-described embodiments merely represent several implementation methods of this specification. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the solutions provided by the embodiments of this specification. It should be noted that a person skilled in the art can make several variations and improvements without departing from the scope of this specification, and these variations and improvements fall within the scope of protection of this specification. Therefore, the scope of protection of the patent in this specification shall be based on the appended claims.

Claims

1. A startup method, characterized in that: Applied to a target processor, the target processor includes multiple processor cores, and the startup method includes: In response to the startup operation, executing a startup process; The startup process includes: Parsing an image package to obtain an image combination method, the image package including the image combination method and multiple system images, the image combination method being used to describe a relationship between the multiple system images and a mapping relationship between the system images and the processor core; the image package being generated based on first configuration information and the multiple system images, the first configuration information being used to describe the image combination method; Based on the image combination mode, the system image is run in the plurality of processor cores.

2. The method according to claim 1, characterized in that The mirror image combination mode includes a direct mode; In the direct mode, the relationship between the multiple system images includes: the multiple system images are packaged in the image package according to a set order, and the multiple system images are run in sequence according to the set order.

3. The method according to claim 2, characterized in that The multiple processor cores include a first target core, and when the image combination mode includes the direct mode, running the system image in the multiple processor cores based on the image combination mode includes: The first target core runs a startup boot program to execute a boot process, which includes: searching for the multiple system images, checking the integrity of each system image, waking up the other processor cores according to the image combination method, and passing the image address of the system image corresponding to the processor core to each processor core, and guiding each processor core to run the corresponding system image in sequence according to the packaging order of each system image in the image package.

4. The method according to claim 3, characterized in that The plurality of processor cores further includes: a fixed boot core; Before the first target core searches for the multiple system images, the method further includes: The fixed startup core runs the startup boot program to determine whether startup is required. If so, the fixed startup core performs the boot process as the first target core; if not, the fixed startup core wakes up the first target core to enable the first target core to run the startup boot program.

5. The method according to claim 1, wherein The mirror combination mode includes a master-slave mode; In the master-slave mode, the multiple system images include a master image and at least one slave image, and the relationship between the multiple system images includes: the at least one slave image is appended to the master image as a code segment, and the multiple system images are run in the order of the master image taking precedence over the slave image.

6. The method according to claim 5, characterized in that The multiple processor cores include a second target core, and when the image combination mode includes a master-slave mode, running the system image in the multiple processor cores based on the image combination mode includes: The second target core runs the master image to run a main operating system in the second target core, and searches for the address of the slave image through a core management code interface of the main operating system; The slave image is loaded into the memory space of the main operating system according to the address of the slave image, and the slave image is deployed according to the slave image loaded in the memory space of the main operating system.

7. The method according to claim 1, characterized in that The mirror combination mode includes a distributed mode; In the distributed mode, the relationship between the multiple system images includes: the multiple system images are distributed in multiple mirror groups, the mirror group includes a boot program and at least one system image, and the mirror group has the function of guiding the operation of other mirror groups; each mirror group corresponds to a different processor core.

8. The method according to claim 7, characterized in that When the image combination mode includes a distributed mode, running the system image in the plurality of processor cores based on the image combination mode includes: Waking up at least some of the processor cores, and transmitting a target address to the awakened processor cores, wherein the target address includes an address of a mirror group corresponding to the processor core; Each of the processor cores deploys the system image included in the image group according to the target address.

9. The method according to claim 7, characterized in that There is at least one mirror group that is a master-slave mirror group, and the master-slave mirror group includes multiple system images. The multiple system images in the same master-slave mirror group include a master image and at least one slave image, and the at least one slave image is appended to the master image as a code segment.

10. A method for generating a mirror package, characterized in that: The method for generating an image package for use with a target processor, wherein the target processor includes multiple processor cores, and the method for generating the image package includes: In response to a compile operation for a plurality of system images, a packaging operation is performed according to first configuration information to obtain the image package; the first configuration information is used to describe an image combination method, and the image combination method is used to describe a relationship between the plurality of system images and a mapping relationship between the system images and the processor core; The image package includes the image combination mode and multiple system images.

11. The method according to claim 10, characterized in that The first configuration information includes: a boot program address and configuration items of the system image; wherein, The boot program address is used to represent the address where the boot program is stored; The configuration item of the system image is used to describe at least one of information such as whether the system image is a primary image, a storage address of the system image, an identifier of a processor core running the system image, and whether the system image is booted by the primary image.

12. The method according to claim 11, characterized in that Before performing the packaging operation according to the first configuration information, the method further includes: The configuration items of each system image are verified, and if the verification passes, a step of performing a packaging operation according to the first configuration information is executed.

13. A computing device, characterized in that The invention comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the startup method according to any one of claims 1 to 9 or the method for generating a mirror package according to any one of claims 10 to 12 is implemented.

14. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the computer program implements the startup method according to any one of claims 1 to 9 or the method for generating a mirror package according to any one of claims 10 to 12.

Citation Information

Cited By

  • Method and device for deploying multiple real-time operating system instances

    CN121143827A

  • A method and apparatus for deploying multiple real-time operating system instances

    CN121143827B