Hybrid deployment method, device and system for multiple operating systems and storage medium
By deploying GPOS and RTOS on bare metal hardware resources and implementing information transmission through communication channels or shared memory space, the problem of reduced real-time performance in the mixed deployment of GPOS and RTOS is solved, and the real-time and collaborative performance of business execution is improved.
Patent Information
- Application Number
- CN202410385494.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-29
- Publication Date
- 2025-09-30
AI Technical Summary
In the prior art, when a general-purpose operating system (GPOS) and a real-time operating system (RTOS) are mixedly deployed on a server, the real-time performance of the GPOS in executing non-real-time services and the real-time performance of the RTOS in executing real-time services are reduced.
By deploying the GPOS bare metal on the first hardware resource and the RTOS bare metal on the second hardware resource, and realizing information transmission and communication between the GPOS and RTOS through a communication channel or a shared memory space, it is ensured that the two can work together normally.
The real-time performance of GPOS and RTOS in executing services is improved, and the coordinated execution of non-real-time services and multiple real-time services is achieved.
Smart Images

Figure CN120723501A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of industrial control, and in particular to a hybrid deployment method, device, system and storage medium for multiple operating systems. Background Art
[0002] In the industrial control field, there is a need for collaboration between real-time and non-real-time services. As server performance gradually improves, real-time and non-real-time services can be centrally deployed on servers, thus achieving collaboration between real-time and non-real-time services on the server.
[0003] In related technologies, a first virtual machine and a second virtual machine can be started on a server. The first virtual machine is used to run a general-purpose operating system (GPOS), and the second virtual machine is used to run a real-time operating system (RTOS). The GPOS is used to execute non-real-time services, and the RTOS is used to execute real-time services, thereby realizing the centralized deployment of real-time and non-real-time services on the server.
[0004] The GPOS runs on the first virtual machine and the RTOS runs on the second virtual machine, which reduces the real-time performance of the GPOS in executing non-real-time services and the real-time performance of the RTOS in executing real-time services. Summary of the Invention
[0005] This application provides a method, device, system, and storage medium for hybrid deployment of multiple operating systems, which are used to improve the real-time performance of GPOS and RTOS execution services. The technical solution is as follows:
[0006] In a first aspect, embodiments of the present application provide a hybrid deployment system for multiple operating systems. The hybrid deployment system includes a general-purpose operating system (GPOS), a real-time operating system (RTOS), a first hardware resource, and a second hardware resource. The first hardware resource and the second hardware resource each include at least one processor core in the same processor, or each include at least one processor of the same type. The GPOS runs on the first hardware resource, and the RTOS runs on the second hardware resource. The GPOS is used to execute non-real-time services, while the RTOS is used to execute real-time services.
[0007] Because the GPOS runs on the first hardware resource and the RTOS runs on the second hardware resource, the GPOS is used to execute non-real-time services, while the RTOS is used to execute real-time services. This allows the GPOS to be deployed bare metal on the first hardware resource and the RTOS to be deployed bare metal on the second hardware resource, enabling the GPOS and RTOS to execute services more real-timely, improving their real-time performance.
[0008] In one possible design, a communication channel exists between the GPOS and the RTOS, and the communication channel is used to transmit information between the GPOS and the RTOS. This ensures that the GPOS and the RTOS can communicate normally, so that the GPOS and the RTOS can execute services normally.
[0009] In another possible design, the communication channel is a shared memory space accessible to both the GPOS and the RTOS. The shared memory space is a memory space in a hybrid deployment system, so that the GPOS and the RTOS can communicate through the shared memory space.
[0010] In another possible design, the hybrid deployment system includes multiple RTOSs and multiple second hardware resources. The multiple RTOSs correspond to the multiple second hardware resources, and each RTOS runs on the second hardware resource corresponding to each RTOS. The multiple RTOSs correspond to multiple instance services, and each RTOS is used to execute the real-time service corresponding to each RTOS. This allows for the hybrid deployment of GPOS and multiple RTOSs, and the use of multiple RTOSs to execute multiple real-time services, achieving collaboration between non-real-time services and multiple real-time services.
[0011] In another possible design, the first hardware resource and each second hardware resource further include one or more of the following: memory space, hardware space, or at least one network port.
[0012] In a second aspect, an embodiment of the present application provides a hybrid deployment method for multiple operating systems, which can be applied to the network side, such as a hybrid deployment system on the network side or components in the hybrid deployment system (such as circuits, chips or chip systems, etc.). Taking the application of this method to GPOS in the hybrid deployment system as an example, the hybrid deployment system also includes a first hardware resource and a second hardware resource, and the first hardware resource and the second hardware resource respectively include at least one processor core in the same processor, or the first hardware resource and the second hardware resource respectively include at least one processor of the same type, and the GPOS runs on the first hardware resource, and the GPOS is used to execute non-real-time services.
[0013] In this method, a GPOS obtains hardware resource configuration information indicating a second hardware resource. The GPOS installs a real-time operating system (RTOS) source program on the second hardware resource based on the hardware resource configuration information. The GPOS triggers the second hardware resource to create an RTOS based on the RTOS source program. The RTOS runs on the second hardware resource and is used to execute real-time services.
[0014] Since the GPOS runs on the first hardware resource, it obtains hardware resource configuration information, determines the second hardware resource based on that hardware resource configuration information, installs the RTOS source code on the second hardware resource, triggers the second hardware resource to create the RTOS based on the RTOS source code, and then runs the RTOS on the second hardware resource. This allows the GPOS and RTOS to execute services in a more real-time manner, improving the real-time performance of the GPOS and multiple RTOSes.
[0015] In one possible design, the second hardware resource also includes a memory space. The GPOS determines the second hardware resource based on the hardware resource configuration information. When the second hardware resource includes at least one processor core, the GPOS configures the at least one processor core to be able to access the memory space, or, when the second hardware resource includes at least one processor, configures the at least one processor to be able to access the memory space. The GPOS writes a first RTOS image file to the memory space, and the first RTOS image file includes a plurality of virtual addresses accessible to the RTOS. The GPOS configures a mapping relationship in the first RTOS image file to obtain a second RTOS image file, and the mapping relationship is used to save a mapping relationship between the plurality of virtual memory addresses and the plurality of physical memory addresses included in the memory space, and the mapping relationship is used to enable the RTOS to access the memory space, and the RTOS source program includes the second RTOS image file.
[0016] Because the at least one processor core is configured to access the memory space, or the at least one processor is configured to access the memory space, the at least one processor core or the at least one processor reads the second RTOS image file from the memory space after startup and creates the RTOS by running the second RTOS image file. After the RTOS is created, the RTOS accesses the memory space based on the mapping relationship, thereby ensuring that the RTOS can normally execute real-time services.
[0017] In another possible design, when the second hardware resource includes at least one processor core, the GPOS starts the at least one processor core. The at least one processor core is configured to read the second RTOS image file in the memory space after startup and create the RTOS by running the second RTOS image file. Alternatively, when the second hardware resource includes at least one processor, the GPOS starts the at least one processor. The at least one processor is configured to read the second RTOS image file in the memory space after startup and create the RTOS by running the second RTOS image file. Because the at least one processor core can access the memory space, or the at least one processor can access the memory space, the at least one processor core or the at least one processor can run the second RTOS image file in the memory space after startup to successfully create the RTOS.
[0018] In another possible design, the second RTOS image file includes multiple image contents, the memory space includes multiple memory areas, and the multiple memory areas correspond to the multiple image contents. The RTOS source program also includes a load file, which is used to instruct each image content to be moved to the memory area corresponding to each image content. The GPOS writes the load file to the memory space. Where the second hardware resource includes at least one processor core, the at least one processor core is further configured to read the load file in the memory space, execute the load file, and move each image content to the memory area corresponding to each image content, and then create the RTOS by executing the image contents in the multiple memory areas. Alternatively, where the second hardware resource includes at least one processor, the at least one processor is further configured to read the load file in the memory space, execute the load file, and move each image content to the memory area corresponding to each image content, and then create the RTOS by executing the image contents in the multiple memory areas. This enables the at least one processor core or the at least one processor to execute the image contents in the multiple memory areas after startup, thereby creating the RTOS.
[0019] In another possible design, the load file also includes the value of at least one variable in the second RTOS image file. Wherein, in the case where the second hardware resource includes at least one processor core, the at least one processor core is further used to set the initial value of each variable in the at least one variable in the second RTOS image file to the value of each variable, and run the image content in the multiple memory areas based on the value of each variable. Alternatively, in the case where the second hardware resource includes at least one processor, the at least one processor is further used to set the initial value of each variable in the at least one variable in the second RTOS image file to the value of each variable, and run the image content in the multiple memory areas based on the value of each variable. In this way, after startup, the at least one processor core or the at least one processor can run the image content in the multiple memory areas based on the value of each variable, and then the RTOS can be created.
[0020] In another possible design, the GPOS establishes a communication channel with the RTOS, and the communication channel is used to transmit information between the GPOS and the RTOS. This ensures that the GPOS and RTOS can communicate normally, so that the GPOS and RTOS can execute services normally.
[0021] In another possible design, the communication channel is a shared memory space accessible to both the GPOS and the RTOS. The shared memory space is a memory space in a hybrid deployment system, so that the GPOS and the RTOS can communicate through the shared memory space.
[0022] In another possible design, the GPOS verifies the validity of the second hardware resource based on the hardware resource configuration information. Upon verifying the validity of the second hardware resource, the GPOS installs the RTOS source program on the second hardware resource. This ensures that the second hardware resource can create the multiple RTOSs.
[0023] In another possible design, after the first hardware resource runs GPOS, GPOS uninstalls the network driver installed on the network card of the hybrid deployment system and installs the GPOS network driver on the network card, so that the network card is used to transmit information obtained when the GPOS executes non-real-time services, ensuring that the GPOS can normally perform non-real-time services.
[0024] In another possible design, the hybrid deployment system includes multiple second hardware resources, and the second hardware resources indicated by the hardware resource configuration information are the multiple second hardware resources. The GPOS triggers the multiple second hardware resources to create multiple RTOSes based on the RTOS source program. The multiple RTOSes correspond to the multiple second hardware resources, and each RTOS runs on the second hardware resources corresponding to each RTOS. The multiple RTOSes correspond to multiple instance services, and each RTOS is used to execute the real-time service corresponding to each RTOS. This allows for hybrid deployment of the GPOS and multiple RTOSes, and the use of multiple RTOSes to execute multiple real-time services, thereby achieving collaboration between non-real-time services and multiple real-time services.
[0025] In a third aspect, an embodiment of the present application provides a hybrid deployment method for multiple operating systems, which can be applied to the network side, such as a hybrid deployment system on the network side or a component in the hybrid deployment system (such as a circuit, a chip or a chip system, etc.). Taking the method as an example of the first RTOS included in the hybrid deployment system, the hybrid deployment system also includes a general operating system GPOS, a first hardware resource and a second hardware resource, the first hardware resource and the second hardware resource respectively include at least one processor core in the same processor, or the first hardware resource and the second hardware resource respectively include at least one processor of the same type, the GPOS runs on the first hardware resource, the GPOS is used to execute non-real-time services, the RTOS source program is installed on the second hardware resource and the second hardware resource is triggered to create the first RTOS based on the RTOS source program, the first RTOS runs on the second hardware resource, the second hardware resource also includes at least one network port, and the RTOS source program includes a network driver. In this method, the first RTOS installs a network driver on the at least one network port after being created. The first RTOS performs network configuration on the at least one network port so that the at least one network port is used to transmit information obtained when the first RTOS executes the first real-time service, ensuring that the first RTOS can execute the first real-time service normally.
[0026] In one possible design, the first RTOS starts a network communication protocol stack, which includes at least one network communication protocol. The first RTOS executes the first real-time service based on the at least one network communication protocol, ensuring that the first RTOS can normally execute the first real-time service.
[0027] In another possible design, the first RTOS is one of multiple RTOSs included in a hybrid deployment system. The hybrid deployment system includes multiple second hardware resources, and the multiple RTOSes correspond to multiple second hardware resources. Each RTOS runs on the second hardware resource corresponding to each RTOS. The multiple RTOSes correspond to multiple instance services, and each RTOS is used to execute the real-time service corresponding to each RTOS. This allows for hybrid deployment of the GPOS and multiple RTOSes, and the use of multiple RTOSes to execute multiple real-time services, enabling collaboration between non-real-time services and multiple real-time services.
[0028] In a fourth aspect, an embodiment of the present application provides a hybrid deployment device for multiple operating systems, and the hybrid deployment device has the function of implementing the above-mentioned second aspect. For example, the hybrid deployment device includes modules or units or means corresponding to executing the operations involved in the above-mentioned second aspect. The modules or units or means can be specifically implemented through software, or through hardware, or through a combination of software and hardware.
[0029] In the fifth aspect, an embodiment of the present application provides a hybrid deployment device for multiple operating systems, which has the function of implementing the above-mentioned third aspect. For example, the hybrid deployment device includes modules or units or means corresponding to executing the operations involved in the above-mentioned third aspect. The modules or units or means can be implemented through software, or through hardware, or through a combination of software and hardware.
[0030] In a sixth aspect, an embodiment of the present application provides a hybrid deployment device for multiple operating systems, the hybrid deployment device comprising a memory and one or more processors. The memory is used to store part or all of the necessary computer programs or instructions for implementing the functions involved in the second aspect above. The one or more processors can execute the computer programs or instructions. When the computer programs or instructions are executed, the hybrid deployment device implements the method in any possible design or implementation of the second aspect above.
[0031] In one possible design, the hybrid deployment device may further include an interface circuit, wherein the processor is configured to communicate with other devices or components through the interface circuit.
[0032] In one possible design, the hybrid deployment device may also include the memory.
[0033] In a seventh aspect, an embodiment of the present application provides a hybrid deployment device for multiple operating systems, the hybrid deployment device comprising a memory and one or more processors. The memory is used to store part or all of the necessary computer programs or instructions for implementing the functions involved in the third aspect above. The one or more processors can execute the computer programs or instructions. When the computer programs or instructions are executed, the hybrid deployment device implements the method in any possible design or implementation of the third aspect above.
[0034] In one possible design, the hybrid deployment device may further include an interface circuit, wherein the processor is configured to communicate with other devices or components through the interface circuit.
[0035] In one possible design, the hybrid deployment device may also include the memory.
[0036] In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-readable instructions are stored. When a computer reads and executes the computer-readable instructions, the computer executes the method in any possible design of the second to third aspects above.
[0037] In a ninth aspect, an embodiment of the present application provides a computer program product. When a computer reads and executes the computer program product, the computer executes the method in any possible design of the second to third aspects above. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 This is a schematic diagram of a network architecture applicable to the embodiments of the present application;
[0039] Figure 2 This is a schematic diagram of a hybrid deployment system structure applicable to the embodiments of the present application;
[0040] Figure 3 This is another schematic diagram of a hybrid deployment system structure applicable to the embodiments of the present application;
[0041] Figure 4 This is another schematic diagram of a hybrid deployment system structure applicable to the embodiments of the present application;
[0042] Figure 5 This is a flow chart of a hybrid deployment method for multiple operating systems applicable to an embodiment of the present application;
[0043] Figure 6 This is a schematic diagram of an ordered tree of configuration information applicable to the embodiments of the present application;
[0044] Figure 7 This is another schematic diagram of an ordered tree of configuration information applicable to the embodiment of the present application;
[0045] Figure 8 This is a schematic diagram of the structure of a hybrid deployment device for multiple operating systems applicable to an embodiment of the present application;
[0046] Figure 9 This is a schematic diagram of the structure of another hybrid deployment device for multiple operating systems applicable to an embodiment of the present application. DETAILED DESCRIPTION
[0047] The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings in the embodiments of the present application. The technical solutions in the embodiments of the present application can be applied to industrial control scenarios. In the industrial control scenario, a communication system is used for communication between the server side and the industrial production line. The communication system can be a universal mobile telecommunications system (UMTS), a wireless local area network (WLAN), a wireless fidelity (Wi-Fi) system, a 4th generation (4G) mobile communication system (such as a long term evolution (LTE) system), a fifth generation (5G) mobile communication system (such as a new radio (NR) system), or a future evolved communication system (sixth generation (6G) mobile communication system), etc.
[0048] This application will present various aspects, embodiments, or features in the context of systems that may include multiple devices, components, modules, etc. It should be understood and appreciated that each system may include additional devices, components, modules, etc., and / or may not include all of the devices, components, modules, etc. discussed in conjunction with the figures. Furthermore, combinations of these aspects may also be used.
[0049] In addition, in the embodiments of the present application, words such as "exemplarily" and "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as an "example" in this application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of the word "example" is intended to present concepts in a concrete way. In the embodiments of the present application, "of", "corresponding, relevant" and "corresponding" can sometimes be used interchangeably. It should be noted that when the distinction between them is not emphasized, the meanings to be expressed are consistent.
[0050] The communication system and industrial control scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. A person skilled in the art will appreciate that, with the evolution of network architecture and the emergence of new industrial control scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0051] Hierarchical management can be adopted in industrial control scenarios.
[0052] Management in industrial control scenarios involves the control of individual industrial equipment, production lines, factories, and enterprises. Industrial control scenarios typically adopt a hierarchical management approach.
[0053] Hierarchical management in industrial control scenarios can include five layers: L0, L1, L2, L3, and L4. L0 refers to industrial equipment on industrial production lines, such as robotic arms or CNC machine tools. L1 is the field control layer, responsible for controlling multiple pieces of industrial equipment. For example, L1 may include at least one industrial controller, which can control multiple pieces of industrial equipment, such as monitoring the operating status of industrial equipment and controlling the start and stop of industrial equipment. L2 is the process monitoring layer, responsible for managing and monitoring the control layer. L3 is the production management layer, which is mainly a management system for industrial production lines and is responsible for controlling the operating status of each industrial production line. L4 is an enterprise-level management system.
[0054] This hierarchical management logically divides the management operations required in industrial control scenarios. Regarding the physical location of each layer, L0 is located directly on the industrial production line. L1 can be located near industrial equipment, L2 can be located next to the industrial production line, and L3 can be located near multiple industrial production lines. L4 can be deployed away from the industrial production line, such as in a designated data center or in the cloud.
[0055] The server side mentioned in the embodiments of the present application can deploy L1, L2, L3 or L4. The server side can be a server or a controller, etc. For example, the server side can be an industrial server or an industrial controller, etc.
[0056] GPOS and RTOS can be centrally deployed on the server side. The deployed RTOS can be one RTOS or multiple RTOSs. GPOS and / or the one or more RTOSs can be used to control a single industrial equipment, production line, factory, or enterprise.
[0057] RTOS and GPOS are two types of operating systems designed for different purposes. RTOS offers advantages such as determinism and high performance. RTOS enables precise timing and deterministic execution. Common RTOS include Free RTOS, which can be used for real-time services. GPOS, on the other hand, provides multitasking, resource sharing, and a rich set of services and features. Common GPOS platforms include Windows or Linux. GPOS can also be added with applications with different functions based on actual needs, allowing for non-real-time services.
[0058] For the industrial control scenarios mentioned above, see Figure 1 An embodiment of the present application provides a network architecture 100 for an industrial control scenario, wherein the network architecture 100 includes a hybrid deployment system 10 of multiple operating systems and an industrial production line 20. The industrial production line 20 includes at least one device 201. The hybrid deployment system 10 can communicate with the at least one device 201, and the hybrid deployment system 10 can control and / or manage the at least one device 201.
[0059] In some embodiments, the at least one device 201 may be industrial equipment. For example, the at least one device 201 includes one or more of the following: a robotic arm, a CNC machine tool, a valve, or a sensor.
[0060] For example, the industrial production line 20 may be a final assembly line in a home appliance factory, and the at least one device 201 may include valves and / or robotic arms in the final assembly line. The hybrid deployment system 10 may control valves at various workstations in the final assembly line, control robotic arms in the final assembly line, and / or perform product quality inspection or centralized deployment of Internet of Things (IoT) data storage.
[0061] For another example, the industrial production line 20 may be a production line in the automotive industry, the steel industry, or the oil and gas industry. The hybrid deployment system 10 may control and / or manage at least one industrial equipment included in the production line.
[0062] In some embodiments, the hybrid deployment system 10 may be applied to a server side, where the server side includes one or more servers. Optionally, the one or more servers may include industrial controllers and / or industrial servers.
[0063] In some embodiments, the hybrid deployment system 10 and the at least one device 201 are both connected to the above-mentioned communication system, and the hybrid deployment system 10 communicates with the at least one device 201 through the above-mentioned communication system.
[0064] In some embodiments, the hybrid deployment system 10 can perform tasks, by which operations such as control and / or management can be performed on at least one device 201 in the industrial production line 20.
[0065] In some embodiments, the services executed by the hybrid deployment system 10 include non-real-time services and real-time services. Optionally, the real-time services executed by the hybrid deployment system 10 may be one real-time service or multiple real-time services. This allows the non-real-time services and the one or more real-time services to be centrally deployed on the hybrid deployment system 10.
[0066] For example, when the hybrid deployment system 10 is applied to one server, the non-real-time service and the one or more real-time services are centrally deployed on the single server.
[0067] In some embodiments, the real-time service may be a real-time industrial control service, and the non-real-time service may be a non-real-time industrial control service.
[0068] See also Figure 2 With respect to the hybrid deployment system 10, an embodiment of the present application provides a structural example of a multi-operating system 10. The hybrid deployment system 10 includes a GPOS 101, an RTOS 102, a first hardware resource 103, and a second hardware resource 104. That is, the multi-operating system includes the GPOS 101 and the RTOS 102.
[0069] The first hardware resource 103 includes at least one first processor core, and the second hardware resource 104 includes at least one second processor core, and the at least one first processor core and the at least one second processor core are both cores of the same processor. Alternatively, the first hardware resource 103 includes at least one first processor, and the second hardware resource 104 includes at least one second processor, and the at least one first processor and the at least one second processor are both processors of the same type. In other words, the first hardware resource and the second hardware resource each include at least one processor core of the same processor, or the first hardware resource and the second hardware resource each include at least one processor of the same type.
[0070] The GPOS 101 runs directly on the first hardware resource, and the RTOS 102 runs directly on the second hardware resource 104 .
[0071] GPOS101, used to execute non-real-time services;
[0072] RTOS102, used for real-time services.
[0073] In some embodiments, the hybrid deployment system 10 includes multiple RTOSes 102 and multiple second hardware resources 104 , that is, the hybrid deployment system 10 includes multiple RTOSes 102 and multiple second hardware resources 104 .
[0074] The GPOS 101 runs directly on the first hardware resource. The multiple second hardware resources 104 correspond one-to-one to the multiple RTOSes 102 . Each RTOS 102 runs directly on the second hardware resource 104 corresponding to each RTOS 102 . The multiple RTOSes 102 correspond to multiple real-time services.
[0075] The multiple RTOSes 102 corresponding to the multiple real-time services means that each RTOS 102 corresponds to one real-time service, i.e., the real-time services corresponding to each RTOS 102 include one real-time service, and the multiple RTOSes 102 correspond to the multiple real-time services one-to-one. Alternatively, each RTOS 102 corresponds to one or more real-time services, i.e., the real-time services corresponding to each RTOS 102 include one or more real-time services.
[0076] GPOS101, used to execute non-real-time services;
[0077] Each RTOS 102 is used to execute the real-time business corresponding to each RTOS 102 .
[0078] For example, in an industrial control scenario, each RTOS 102 is used to implement L1 functions, and GPOS 101 is used to implement L2, L3, and / or L4 functions. For each RTOS 102, as L1, the real-time services that can be executed by the RTOS 102 may include controlling industrial equipment on an industrial production line, for example, controlling the start and stop of the industrial equipment.
[0079] In some embodiments, GPOS 101, as L2, can perform non-real-time services such as controlling each RTOS 102. For example, GPOS 101 can perform one or more of the following control operations on RTOS 102: creating RTOS 102, controlling the running status of RTOS 102, collecting and monitoring data on RTOS 102, or monitoring the power consumption and loss status of industrial equipment through RTOS 102.
[0080] In some embodiments, GPOS 101, acting as L3 or L4, can perform non-real-time services such as monitoring, tracking, and controlling the workflow of an entire industrial production line. For example, GPOS 101 can manage a single industrial production line or multiple industrial production lines, control the overall status of a single industrial production line or multiple industrial production lines, control the start and stop of industrial production lines, and monitor the production efficiency of industrial production lines. Optionally, GPOS 101, acting as L3 or L4, can also perform non-real-time services such as managing the factory to which multiple industrial production lines belong, such as allocating working hours to each industrial production line in the factory and interacting with the L2 layer to instruct each industrial production line to start or stop work; monitoring the arrival of personnel within the factory; and identifying potential hidden dangers within the factory and issuing early warnings.
[0081] In some embodiments, for each RTOS 102 included in the plurality of RTOSes 102 , a communication channel exists between the GPOS 101 and the RTOS 102 , and the communication channel is used to transmit information between the GPOS 101 and the RTOS 102 .
[0082] Optionally, the information includes one or more of the following information: information obtained when the GPOS 101 executes non-real-time services, or information obtained when the RTOS 102 executes real-time services, etc. In this way, intercommunication and collaboration between non-real-time services and multiple real-time services are achieved on the hybrid deployment system 10.
[0083] In some embodiments, the communication channel is a shared memory space accessible to both the GPOS 101 and the RTOS 102 . The shared memory space is a memory space in the hybrid deployment system 10 .
[0084] In some embodiments, the first hardware resource 103 also includes one or more of the following: a first memory space, a first hardware space, or at least one first network port, and each second hardware resource 104 also includes one or more of the following: a second memory space, a second hard disk space, or at least one second network port.
[0085] The first memory space and the second memory space are different storage spaces in the memory of the hybrid deployment system 10. The first hard disk space and the second hard disk space are different storage spaces in the hard disk of the hybrid deployment system 10. The at least one first network port and the at least one second network port are different network ports on the network card of the hybrid deployment system 10. Optionally, the at least one first network port is a physical network port or a virtual network port, and the at least one second network port is a physical network port or a virtual network port.
[0086] In some embodiments, the at least one first processor and the at least one second processor are both a central processing unit (CPU), a data processing unit (DPU), a graphics processing unit (GPU), a tensor processing unit (TPU), a neural network processing unit (NPU), a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0087] In the embodiment of the present application, there is no limit on the number of multiple RTOS 102 included in the hybrid deployment system 10. The hybrid deployment system 10 may include two RTOS 102, or may include three RTOS 102, or may include more RTOS 102.
[0088] For example, see Figure 3 Next, taking the multiple RTOS1012 including the first RTOS102 and the second RTOS102 as an example, the second hardware resources corresponding to the first RTOS102 and the second RTOS102 are respectively the second hardware resources 104A and the second hardware resources 104B, and the real-time services corresponding to the first RTOS102 and the second RTOS102 are respectively the first real-time service and the second real-time service.
[0089] That is, the hybrid deployment system 101 includes a GPOS 101 , a first RTOS 102 , a second RTOS 102 , a first hardware resource 103 , a second hardware resource 104A, and a second hardware resource 104B.
[0090] GPOS 101 runs directly on the first hardware resource and can be used to execute non-real-time services;
[0091] The first RTOS 102 runs directly on the second hardware resource 104A, and the first RTOS 102 can be used to execute a first real-time service;
[0092] The second RTOS 102 runs directly on the second hardware resource 104B. The second RTOS 102 can be used to execute the second real-time service, thereby realizing the centralized deployment of non-real-time services, the first real-time service, and the second real-time service on the hybrid deployment system 10 .
[0093] In some embodiments, the first real-time service corresponding to the first RTOS 102 may include one first real-time service or multiple first real-time services. In other words, the first RTOS 102 may be used to execute one first real-time service or multiple first real-time services. Similarly, the second real-time service corresponding to the second RTOS 102 may include one second real-time service or multiple second real-time services. In other words, the second RTOS 102 may be used to execute one second real-time service or multiple second real-time services.
[0094] In some embodiments, a first communication channel 105 exists between GPOS 101 and first RTOS 102. GPOS 101 can transmit first information to first RTOS 102 via first communication channel 105. Optionally, the first information includes information obtained by GPOS 101 executing a non-real-time service and / or information obtained by first RTOS 102 executing a first real-time service. A second communication channel 106 exists between GPOS 101 and second RTOS 102. GPOS 101 can transmit second information to second RTOS 102 via second communication channel 106. Optionally, the second information includes information obtained by GPOS 101 executing a non-real-time service and / or information obtained by second RTOS 102 executing a second real-time service.
[0095] In this way, intercommunication and collaboration between the non-real-time service and the first real-time service, as well as intercommunication and collaboration between the non-real-time service and the second real-time service are achieved on the hybrid deployment system 10 .
[0096] See also, for example, Figure 4 Next, taking the multiple RTOS1012 including the first RTOS102, the second RTOS102 and the third RTOS102 as an example, the second hardware resources corresponding to the first RTOS102, the second RTOS102 and the third RTOS102 are respectively the second hardware resources 104A, the second hardware resources 104B and the second hardware resources 104C, and the real-time services corresponding to the first RTOS102, the second RTOS102 and the third RTOS102 are respectively the first real-time service, the second real-time service and the third real-time service.
[0097] That is, the hybrid deployment system 101 includes a GPOS 101 , a first RTOS 102 , a second RTOS 102 , a third RTOS 102 , a first hardware resource 103 , a second hardware resource 104A, a second hardware resource 104B, and a third hardware resource 104C.
[0098] GPOS 101 runs directly on the first hardware resource and can be used to execute non-real-time services;
[0099] The first RTOS 102 runs directly on the second hardware resource 104A, and the first RTOS 102 can be used to execute a first real-time service;
[0100] The second RTOS 102 runs directly on the second hardware resource 104B, and the second RTOS 102 can be used to execute the second real-time service;
[0101] The third RTOS 102 runs directly on the second hardware resource 104C. The third RTOS 102 can be used to execute the third real-time service, thereby realizing the centralized deployment of non-real-time services, the first real-time service, the second real-time service, and the third real-time service on the hybrid deployment system 10 .
[0102] In some embodiments, a first communication channel 105 exists between GPOS 101 and first RTOS 102, and GPOS 101 can transmit first information to first RTOS 102 via first communication channel 105. A second communication channel 106 exists between GPOS 101 and second RTOS 102, and GPOS 101 can transmit second information to second RTOS 102 via second communication channel 106. A third communication channel 107 exists between GPOS 101 and third RTOS 102, and GPOS 101 can transmit third information to third RTOS 102 via third communication channel 107. Optionally, the third information includes information obtained by GPOS 101 executing a non-real-time service and / or information obtained by third RTOS 102 executing a third real-time service.
[0103] In this way, the hybrid deployment system 10 realizes intercommunication and coordination between the non-real-time service and the first real-time service, intercommunication and coordination between the non-real-time service and the second real-time service, and intercommunication and coordination between the non-real-time service and the third real-time service.
[0104] The hybrid deployment system 10 may also include more RTOS 104, which will not be described one by one here. In order to centrally deploy non-real-time services and multiple real-time services on the hybrid deployment system 10, the multiple operating systems can be deployed through any of the following embodiments.
[0105] In an embodiment of the present application, a hybrid deployment system includes a GPOS, an RTOS, a first hardware resource, and multiple second hardware resources, wherein the first hardware resource includes at least one first processor core, each second hardware resource includes at least one second processor core, and at least one first processor core and at least one second processor core are cores in the same processor, or the first hardware resource includes at least one first processor, each second hardware resource includes at least one second processor, and at least one first processor and at least one second processor are processors of the same type. Wherein, since the GPOS runs directly on the first hardware resource, each RTOS runs directly on the second hardware resource corresponding to each RTOS, thereby realizing the bare metal deployment of the GPOS on the first hardware resource, and each RTOS is bare metal deployed on the second hardware resource corresponding to each RTOS. Bare metal deployment is relative to deployment in a virtual instance. Bare metal deployment refers to that the GPOS or RTOS is directly deployed on the hardware resource, that is, the GPOS or RTOS runs on the hardware resource. At this time, the GPOS or RTOS is similar to a virtual instance and has exclusive access to the hardware resource. Virtual instance deployment involves deploying a GPOS or RTOS on a virtual instance. This means the GPOS or RTOS runs on the virtual instance, which in turn runs on hardware resources. In addition to running the GPOS or RTOS, the virtual instance also runs other applications. Therefore, the GPOS or RTOS shares the hardware resources occupied by the virtual instance with other applications. Because bare metal deployment runs the GPOS or RTOS directly on hardware resources, there's no software layer (virtual instance) between the GPOS or RTOS and the hardware resources. This increases the efficiency of both the GPOS and RTOS. The GPOS executes non-real-time services, while each RTOS executes its corresponding real-time services, improving the real-time nature of both non-real-time and real-time services.
[0106] See also Figure 5 The embodiment of the present application provides a hybrid deployment method 500 of multiple operating systems, which can be applied to Figure 1 Alternatively, the method 500 may be applied to the hybrid deployment system 10 in the network architecture 100. Figure 2 、 Figure 3 or Figure 4 The hybrid deployment system 10 is shown. The method 500 includes the following process.
[0107] Step 501: Start GPOS on a first hardware resource in a hybrid deployment system. GPOS runs directly on the first hardware resource. The first hardware resource includes at least one first processor core, or the first hardware resource includes at least one first processor.
[0108] In some embodiments, the first hardware resource is part of the hardware resources in the hybrid deployment system. The first memory space is part of the storage space in the memory of the hybrid deployment system.
[0109] In some embodiments, the first hardware resource further includes one or more of the following: a first memory space, a first hard disk space, or at least one first network port. The at least one first network port is a portion of a network port on a network card of the hybrid deployment system, the first memory space is a portion of storage space in a memory of the hybrid deployment system, and the first hard disk space is a portion of storage space in a hard disk of the hybrid deployment system.
[0110] The first memory space stores a source program of the GPOS, and the memory space accessible to the at least one first processor core is set in advance as the first memory space.
[0111] In step 501, the administrator can start the at least one first processor core in the hybrid deployment system. When starting, the at least one first processor core reads the source program of the GPOS in the first memory space, creates the GPOS on the first hardware resource by running the source program, and then uses the first hardware resource to run the GPOS, thereby starting the GPOS on the first hardware resource. Or,
[0112] The administrator can start the at least one first processor in the hybrid deployment system. When starting, the at least one first processor reads the source program of the GPOS in the first memory space, creates the GPOS on the first hardware resource by running the source program, and then uses the first hardware resource to run the GPOS, thereby starting the GPOS on the first hardware resource.
[0113] In some embodiments, the first memory space stores a GPOS image file, the source program of the GPOS includes the GPOS image file, the at least one first processor core creates the GPOS by running the GPOS image file, or the at least one first processor creates the GPOS by running the GPOS image file.
[0114] In some embodiments, the GPOS image file includes a GPOS network card driver. After creating the GPOS, the GPOS can uninstall the network driver installed on the network card of the hybrid deployment system and install the GPOS network driver on the network card of the hybrid deployment system, enabling the network card to transmit information obtained when the GPOS executes non-real-time services. Optionally, the GPOS can use the at least one first network port on the network card of the hybrid deployment system to communicate with the industrial production line, including at least one device.
[0115] In some embodiments, the at least one first network port may include a virtual network port on a network card of the hybrid deployment system and / or a physical network port on a network card of the hybrid deployment system.
[0116] In some embodiments, after creating the GPOS, the GPOS further sets kernel startup parameters for the GPOS, which are used to indicate that the hardware resources available to the GPOS are the first hardware resources. In addition to the first hardware resources, the hybrid deployment system also includes other hardware resources. Thus, after creating the GPOS, the GPOS runs on the first hardware resources, while the other hardware resources of the hybrid deployment system are reserved for running the RTOS or multiple RTOSes to be created.
[0117] Optionally, the GPOS may power off processor cores other than the at least one first processor core in the hybrid deployment system to reserve processor cores other than the at least one first processor core in the hybrid deployment system. Alternatively, the GPOS may power off processors other than the at least one first processor in the hybrid deployment system to reserve processors other than the at least one first processor in the hybrid deployment system.
[0118] After the GPOS is started, the first hardware resource runs the GPOS, which can execute non-real-time services. While executing the non-real-time services, the GPOS can create at least one RTOS and use it to execute at least one real-time service. The at least one RTOS can include one or more RTOSs, and similarly, the at least one real-time service can include one or more real-time services. The detailed process is as follows.
[0119] Step 502: The GPOS obtains hardware resource configuration information, where the hardware resource configuration information is used to indicate a second hardware resource in the hybrid deployment system.
[0120] In some embodiments, the hardware resource configuration information is used to indicate at least one second hardware resource in the hybrid deployment system. The at least one second hardware resource includes one second hardware resource or multiple second hardware resources.
[0121] The hardware resource configuration information acquired by the GPOS includes sub-hardware resource configuration information for at least one RTOS to be created. The sub-hardware resource configuration information for the at least one RTOS is used to indicate at least one second hardware resource that corresponds one-to-one with the at least one RTOS. The at least one second hardware resource is a resource in the hybrid deployment system. In other words, for each RTOS, the sub-hardware resource configuration information for the RTOS is used to indicate a second hardware resource in the hybrid deployment system. The second hardware resource is a portion of the hardware resources in the hybrid deployment system and is a hardware resource that needs to be allocated to the RTOS.
[0122] The second hardware resource is a hardware resource that needs to be allocated to the RTOS. The RTOS runs directly on the second hardware resource. That is, the second hardware resource is used to run the RTOS. The second hardware resource is different from the first hardware resource.
[0123] In some embodiments, the second hardware resource includes at least one second processor core, and the sub-hardware resource configuration information of the RTOS includes identification information of the at least one second processor core. Alternatively, the second hardware resource includes at least one second processor, and the sub-hardware resource configuration information of the RTOS includes identification information of the at least one second processor.
[0124] In some embodiments, the second hardware resource further includes one or more of the following resources: a second memory space, a second hard disk space, or at least one second network port, etc. The at least one second network port is a portion of a network port on a network card of the hybrid deployment system, the second memory space is a portion of storage space in a memory of the hybrid deployment system, and the second hard disk space is a portion of storage space in a hard disk of the hybrid deployment system.
[0125] The RTOS sub-hardware resource configuration information further includes one or more of the following information: configuration information of the second memory space, configuration information of the second hard disk space, or identification information of the at least one second network port. Optionally, the configuration information of the second memory space includes a base address and size of the second memory space, and the configuration information of the second hard disk resource includes a base address and size of the second hard disk resource.
[0126] The at least one second network port includes a virtual network port on a network card of the hybrid deployment system and / or a physical network port on a network card of the hybrid deployment system.
[0127] For each RTOS in the at least one RTOS, different hardware resources need to be allocated to each RTOS, and the hardware resources need to be allocated to each RTOS are different from the first hardware resources.
[0128] In some embodiments, the GPOS may display a configuration interface on which the administrator may configure the sub-hardware resource configuration information of the at least one RTOS, and the GPOS may obtain the sub-hardware resource configuration information of the at least one RTOS from the configuration interface.
[0129] In some embodiments, the GPOS may also obtain identification information of the at least one RTOS from the configuration interface, and store the identification information of the at least one RTOS and the sub-hardware resource configuration information of the at least one RTOS in correspondence between the identification information of the RTOS and the sub-hardware resource configuration information of the RTOS.
[0130] In some embodiments, the correspondence between the RTOS identification information and the RTOS sub-hardware resource configuration information may be in the form of an ordered configuration information tree or a correspondence list. Of course, the correspondence between the RTOS identification information and the RTOS sub-hardware resource configuration information may be in other forms, which are not listed here.
[0131] For the ordered tree of configuration information, the identification information of the at least one RTOS is at least one child node of the root node of the ordered tree of configuration information. For each RTOS, there is a node including the identification information of the RTOS among the child nodes of the root node, and each sub-information included in the sub-hardware resource configuration information of the RTOS is a child node of the node. Each sub-information includes the identification information of the at least one second processor core or the identification information of the second processor. Optionally, each sub-information also includes one or more of the following: configuration information of the second memory space, configuration information of the second hard disk space, or identification information of at least one second network port.
[0132] For example, it is assumed that the administrator configures the sub-hardware resource configuration information of RTOS1, the sub-hardware resource configuration information of RTOS2, and the sub-hardware resource configuration information of RTOS3 in the configuration interface displayed by the GPOS.
[0133] The sub-hardware resource configuration information of RTOS1 includes the identification information of two processor cores, which are the identification information of processor core 1 ID-core1 and the identification information of processor core 2 ID-core2, or the sub-hardware resource configuration information of RTOS1 includes the identification information of two processors, which are the identification information of processor 1 ID-cpu1 and the identification information of processor 2 ID-cpu2. The sub-hardware resource configuration information of RTOS1 also includes the configuration information of memory space 1, the identification information of two network ports, and the configuration information of hard disk space 1. The configuration information of memory space 1 includes the base address MA1 and size MS1 of memory space 1, the identification information of the two network ports are the identification information port1 of network port 1 and the identification information port2 of network port 2, and the configuration information of hard disk space 1 includes the base address DA1 and size DS1 of hard disk space 1.
[0134] The sub-hardware resource configuration information of RTOS2 includes the identification information ID-core3 of processor core 3, or the identification information ID-cpu3 of processor 3. The sub-hardware resource configuration information of RTOS2 also includes the configuration information of memory space 2, the identification information port3 of network port 3, and the configuration information of hard disk space 2. The configuration information of memory space 2 includes the base address MA2 and size MS2 of memory space 2, and the configuration information of hard disk space 2 includes the base address DA2 and size DS2 of hard disk space 2.
[0135] The sub-hardware resource configuration information of RTOS3 includes the identification information of two processor cores, which are respectively the identification information of processor core 4, ID-core4, and the identification information of processor core 5, ID-core5. Alternatively, the sub-hardware resource configuration information of RTOS3 includes the identification information of two processors, which are respectively the identification information of processor 4, ID-cpu4, and the identification information of processor 5, ID-core5. The sub-hardware resource configuration information of RTOS3 also includes the configuration information of memory space 3, the identification information of two network ports, and the configuration information of hard disk space 3. The configuration information of memory space 3 includes the base address MA3 and size MS3 of memory space 3, the identification information of the two network ports includes the identification information port4 of network port 4 and the identification information port5 of network port 5, and the configuration information of hard disk space 3 includes the base address DA3 and size DS4 of hard disk space 3.
[0136] In some embodiments, the GPOS obtains the identification information ID-rtos1 and sub-hardware resource configuration information of RTOS1, the identification information ID-rtos2 and sub-hardware resource configuration information of RTOS2, and the identification information ID-rtos3 and sub-hardware resource configuration information of RTOS3 from the configuration interface. The identification information ID-rtos1 and sub-hardware resource configuration information of RTOS1, the identification information ID-rtos2 and sub-hardware resource configuration information of RTOS2, and the identification information ID-rtos1 and sub-hardware resource configuration information of RTOS3 are saved in a Figure 6 Alternatively, the identification information ID-rtos1 and sub-hardware resource configuration information of RTOS1, the identification information ID-rtos2 and sub-hardware resource configuration information of RTOS2, and the identification information ID-rtos1 and sub-hardware resource configuration information of RTOS3 are stored in the following order: Figure 7 The configuration information is shown in an ordered tree.
[0137] See also Figure 6 or Figure 7 ,The root node of the configuration information ordered tree has three child nodes, namely nodes 1, 2 and 3. Node 1 includes the identification information ID-rtos1 of RTOS1, node 2 includes the identification information ID-rtos2 of RTOS2, and node 3 includes the identification information ID-rtos3 of RTOS3.
[0138] Node 1 has four child nodes, namely nodes 11, 12, 13 and 14. Figure 6 , node 11 includes identification information ID-core1 of processor core 1 and identification information ID-core2 of processor core 2; or, see Figure 7 , node 11 includes the identification information ID-cpu1 of processor 1 and the identification information ID-cpu2 of processor 2. Figure 6 or Figure 7 Node 12 includes the base address MA1 and size MS1 of memory space 1, node 13 includes the identification information port1 of network port 1 and the identification information port2 of network port 2, and node 14 includes the base address DA1 and size DS1 of hard disk space 1.
[0139] Node 2 has four child nodes, namely nodes 21, 22, 23 and 24. Figure 6 , node 21 includes identification information ID-core3 of processor core 3; or, see Figure 7 , node 21 includes the identification information ID-cpu3 of processor 3. Figure 6 or Figure 7Node 22 includes the base address MA2 and size MS2 of memory space 2, node 23 includes identification information port3 of network port 3, and node 24 includes the base address DA2 and size DS2 of hard disk space 2.
[0140] Node 3 has four child nodes, namely nodes 31, 32, 33 and 34. Figure 6 , node 31 includes identification information ID-core4 of processor core 4 and identification information ID-core5 of processor core 5; or, see Figure 7 , node 31 includes the identification information ID-cpue4 of processor 4 and the identification information ID-cpu5 of processor 5. Figure 6 or Figure 7 Node 32 includes the base address MA3 and size MS3 of memory space 3, node 33 includes the identification information port4 of network port 4 and the identification information port5 of network port 5, and node 34 includes the base address DA3 and size DS4 of hard disk space 3.
[0141] In some embodiments, the GPOS obtains, from the configuration interface, the identification information ID-rtos1 and sub-hardware resource configuration information of RTOS1, the identification information ID-rtos2 and sub-hardware resource configuration information of RTOS2, and the identification information ID-rtos3 and sub-hardware resource configuration information of RTOS3. The corresponding relationship between the identification information ID-rtos1 of RTOS1 and the sub-hardware resource configuration information, the corresponding relationship between the identification information ID-rtos2 of RTOS2 and the sub-hardware resource configuration information, and the corresponding relationship between the identification information ID-rtos3 of RTOS3 and the sub-hardware resource configuration information are stored in the corresponding relationship list shown in Table 1 below. Alternatively, the corresponding relationship between the identification information ID-rtos1 of RTOS1 and the sub-hardware resource configuration information, the corresponding relationship between the identification information ID-rtos2 of RTOS2 and the sub-hardware resource configuration information, and the corresponding relationship between the identification information ID-rtos3 of RTOS3 and the sub-hardware resource configuration information are stored in the corresponding relationship list shown in Table 2 below.
[0142] Table 1
[0143]
[0144] Table 2
[0145]
[0146] In some embodiments, see Figure 8 ,GPOS includes RTOS agent module, image file library and RTOS management module.
[0147] The RTOS agent module may display a configuration interface, obtain identification information and sub-hardware resource configuration information of at least one RTOS configured by the administrator from the configuration interface, and store the identification information of the at least one RTOS and the sub-hardware resource configuration information of the at least one RTOS in a corresponding relationship between the identification information of the RTOS and the sub-hardware resource configuration information of the RTOS.
[0148] The image file library includes a first RTOS image file, the first RTOS image file includes multiple virtual memory addresses, and the multiple virtual memory addresses are multiple virtual memory addresses that the RTOS needs to access. Optionally, the first RTOS image file includes a first mapping relationship, and the first mapping relationship is used to store a mapping relationship between the multiple virtual memory addresses and the multiple physical memory addresses.
[0149] Optionally, the multiple virtual memory addresses correspond one-to-one to the multiple physical memory addresses. For each virtual memory address included in the multiple virtual memory addresses, the RTOS generated by the first RTOS image file can access the virtual memory address. When the RTOS accesses the virtual memory address, the RTOS obtains the physical memory address corresponding to the virtual memory address. Accessing the physical memory address means that the RTOS can read data stored in the memory space corresponding to the physical memory address or write data to the memory space corresponding to the physical memory address.
[0150] Optionally, the image file library also includes a loading file, the RTOS image file includes multiple image contents, and when the RTOS image file is saved in a certain memory space, the multiple image contents correspond to multiple memory areas in the memory space, and the loading file includes logic for moving each image content to the memory area corresponding to each image content.
[0151] The RTOS management module is used to create the at least one RTOS based on the sub-hardware resource configuration information of the at least one RTOS.
[0152] GPOS may also include other modules, which will not be listed here one by one.
[0153] In some embodiments, the RTOS agent module may call the RTOS management module and send the RTOS management module information such as the correspondence between the RTOS identification information and the RTOS's hard disk resource configuration information, as well as information such as the address of the image file library. After receiving the correspondence between the RTOS identification information and the RTOS's hard disk resource configuration information, as well as information such as the address of the image file library, the RTOS management module may create the at least one RTOS according to the following process.
[0154] Step 503: The GPOS installs the RTOS source program on the second hardware resource based on the hardware resource configuration information.
[0155] In step 503, the GPOS installs the RTOS source program on at least one second hardware resource based on the hardware resource configuration information.
[0156] The at least one RTOS includes a first RTOS, and the hardware resource configuration information includes sub-hardware resource configuration information of the first RTOS. In step 503, the GPOS determines a second hardware resource corresponding to the first RTOS based on the sub-hardware resource configuration information of the first RTOS, and installs the RTOS source program on the second hardware resource.
[0157] In step 503 , the GPOS may install the RTOS source program on the second hardware resource through the following process 5031 - 5034 .
[0158] 5031: The GPOS determines, based on the hardware resource configuration information, a second hardware resource corresponding to the first RTOS, where the second hardware resource includes at least one second processor core and a second memory space, or the second hardware resource includes at least one second processor and a second memory space.
[0159] In some embodiments, the GPOS determines a second hardware resource corresponding to the first RTOS based on sub-hardware resource configuration information of the first RTOS, where the second hardware resource is part of the hardware resources in the hybrid deployment system. The second memory space is part of the storage space in the memory of the hybrid deployment system, and the second memory space and the first memory space are different spaces in the memory of the hybrid deployment system.
[0160] The sub-hardware resource configuration information of the first RTOS includes the identification information of the at least one second processor core and the configuration information of the second memory space. The GPOS determines the at least one second processor core based on the identification information of the at least one second processor core, and determines the second memory space based on the configuration information of the second memory space (the base address and size of the second memory space). Alternatively, the sub-hardware resource configuration information of the first RTOS includes the identification information of the at least one second processor and the configuration information of the second memory space. The GPOS determines the at least one second processor based on the identification information of the at least one second processor, and determines the second memory space based on the configuration information of the second memory space.
[0161] In some embodiments, the second hardware resource further includes at least one second network port and / or a second hard disk space. The at least one second network port is a portion of a network port on a network card in the hybrid deployment system, and the second hard disk space is a portion of storage space on a hard disk in the hybrid deployment system. The at least one first network port and the at least one second network port are different, and the first hard disk space and the second hard disk space are different spaces on the hard disk in the hybrid deployment system.
[0162] The sub-hardware resource configuration information of the first RTOS also includes identification information of at least one second network port and / or configuration information of a second hard disk space. The GPOS determines the at least one second network port based on the identification information of the at least one second network port, and determines the second hard disk space based on the configuration information of the second hard disk space (base address and size of the second hard disk space).
[0163] In some embodiments, the GPOS can scan the identification information of a first RTOS included in the correspondence between the RTOS identification information and the RTOS sub-hardware resource configuration information, and use the scanned RTOS identification information as the identification information of the first RTOS. Based on the identification information of the first RTOS, the sub-hardware resource configuration information of the first RTOS is obtained from the correspondence between the RTOS identification information and the RTOS sub-hardware resource configuration information. The second hardware resource is determined based on the sub-hardware resource configuration information of the first RTOS. Optionally, the implementation includes the following two methods: Method 1 and Method 2.
[0164] In method 1, the correspondence between the RTOS identification information and the RTOS sub-hardware resource configuration information is formed into an ordered configuration information tree. The GPOS scans the first child node of the root node of the ordered configuration information tree and uses the RTOS identification information included in the scanned child node as the identification information of the first RTOS. For a node including the identification information of the first RTOS, the sub-hardware resource configuration information of the first RTOS is read from at least one child node of the node. Based on the sub-hardware resource configuration information of the first RTOS, the second hardware resource is determined.
[0165] For example, GPOS from Figure 6The first child node 1 of the root node of the configuration information ordered tree shown is scanned, and the identification information ID-rtos1 of RTOS1 included in the scanned child node 1 is used as the identification information of the first RTOS. For node 1 including the identification information ID-rtos1 of the first RTOS, the sub-hardware resource configuration information of the first RTOS is read from the child nodes 11, 12, 13 and 14 of the node ID-rtos1. The sub-hardware resource configuration information includes the identification information ID-core1 of processor core 1, the identification information ID-core2 of processor core 2, the base address MA1 and size MS1 of memory space 1, the identification information port1 of network port 1, the identification information port2 of network port 2, and the base address DA1 and size DS1 of hard disk space 1. Based on the sub-hardware resource configuration information of the first RTOS, the second hardware resources are determined. The second hardware resources include processor core 1, processor core 2, memory space 1, network port 1, network port 2 and hard disk space 1.
[0166] For example, GPOS Figure 7 The first child node 1 of the root node of the configuration information ordered tree shown is scanned, and the identification information ID-rtos1 of RTOS1 included in the scanned child node 1 is used as the identification information of the first RTOS. For node 1 including the identification information ID-rtos1 of the first RTOS, the sub-hardware resource configuration information of the first RTOS is read from the child nodes 11, 12, 13, and 14 of the node ID-rtos1. The sub-hardware resource configuration information includes the identification information ID-cpu1 of processor 1, the identification information ID-cpu2 of processor 2, the base address MA1 and size MS1 of memory space 1, the identification information port1 of network port 1, the identification information port2 of network port 2, and the base address DA1 and size DS1 of hard disk space 1. Based on the sub-hardware resource configuration information of the first RTOS, the second hardware resources are determined. The second hardware resources include processor 1, processor 2, memory space 1, network port 1, network port 2, and hard disk space 1.
[0167] In mode 2, the correspondence between the RTOS identification information and the RTOS sub-hardware resource configuration information is formed into a correspondence list. The GPOS scans the identification information of the first RTOS stored in the first column of the correspondence list and uses the scanned RTOS identification information as the identification information of the first RTOS. Based on the identification information of the first RTOS, the sub-hardware resource configuration information of the first RTOS is read from the correspondence list. Based on the sub-hardware resource configuration information of the first RTOS, the second hardware resource is determined.
[0168] For example, the GPOS scans the identification information ID-rtos1 of the first RTOS stored in the first column of the correspondence list shown in Table 1, and uses the scanned identification information ID-rtos1 of the RTOS as the identification information of the first RTOS. Based on the identification information ID-rtos1 of the first RTOS, the sub-hardware resource configuration information of the first RTOS is read from the correspondence list shown in Table 1. The sub-hardware resource configuration information includes the identification information ID-core1 of processor core 1, the identification information ID-core2 of processor core 2, the base address MA1 and size MS1 of memory space 1, the identification information port1 of network port 1, the identification information port2 of network port 2, and the base address DA1 and size DS1 of hard disk space 1. Based on the sub-hardware resource configuration information of the first RTOS, the second hardware resources are determined. The second hardware resources include processor core 1, processor core 2, memory space 1, network port 1, network port 2, and hard disk space 1.
[0169] For another example, the GPOS scans the identification information ID-rtos1 of the first RTOS stored in the first column of the correspondence list shown in Table 1, and uses the scanned identification information ID-rtos1 of the RTOS as the identification information of the first RTOS. Based on the identification information ID-rtos1 of the first RTOS, the sub-hardware resource configuration information of the first RTOS is read from the correspondence list shown in Table 1. The sub-hardware resource configuration information includes the identification information ID-cpu1 of processor 1, the identification information ID-cpu2 of processor 2, the base address MA1 and size MS1 of memory space 1, the identification information port1 of network port 1, the identification information port2 of network port 2, and the base address DA1 and size DS1 of hard disk space 1. Based on the sub-hardware resource configuration information of the first RTOS, the second hardware resources are determined. The second hardware resources include processor 1, processor 2, memory space 1, network port 1, network port 2, and hard disk space 1.
[0170] In some embodiments, the GPOS can also verify the validity of the second hardware resource based on the hardware resource configuration information; when verifying the validity of the second hardware resource, the GPOS performs the following operation of installing the RTOS source program on the second hardware resource. Optionally, the following three verification methods can be used during implementation.
[0171] Verification method 1: GPOS determines whether the second hardware resources corresponding to the first RTOS are idle based on the sub-hardware resource configuration information of the first RTOS. If every resource in the second hardware resources is idle, the second hardware resources are verified to be legal. If any resource in the second hardware resources is not idle, the second hardware resources are verified to be illegal.
[0172] The so-called idle second hardware resource means that at least one second processor core included in the second hardware resource is idle, or at least one second processor included in the second hardware resource is idle. The idle second hardware resource also means: when the second hardware resource includes a second memory space, the second memory space is idle; when the second hardware resource also includes at least one second network port, the at least one second network port is also idle; when the second hardware resource also includes a second hard disk space, the second hard disk space is also idle.
[0173] If all or part of the second hardware resource is occupied by a GPOS or other RTOS, the second hardware resource may be invalid. For example, if part of the second processor core in the second hardware resource is occupied by a GPOS or other RTOS, the second hardware resource may be invalid. Another example is if part of the second memory space in the second hardware resource is occupied by a GPOS or other RTOS, the second hardware resource may be invalid.
[0174] Verification method 2: GPOS determines whether the hybrid deployment system has all the resources in the second hardware resources corresponding to the first RTOS based on the sub-hardware resource configuration information of the first RTOS. If the hybrid deployment system has all the resources in the second hardware resources, it verifies that the second hardware resources are legal. If the hybrid deployment system does not have all the resources in the second hardware resources, it verifies that the second hardware resources are illegal.
[0175] In verification method 2, the GPOS determines whether the hybrid deployment system has the at least one second processor core based on the identification information of the at least one second processor core. If the hybrid deployment system has the at least one second processor core, the second hardware resource is verified to be legal; if the hybrid deployment system does not have the at least one second processor core or does not have some of the at least one second processor cores, the second hardware resource is verified to be illegal.
[0176] When the sub-hardware resource configuration information of the first RTOS also includes the configuration information of the second memory space, the GPOS also determines whether the memory of the hybrid deployment system has the second memory space. If the memory of the hybrid deployment system has the second memory space, the second hardware resource is verified to be legal; if the memory of the hybrid deployment system does not have the second memory space or does not have part of the memory space of the second memory space, the second hardware resource is verified to be illegal.
[0177] When the sub-hardware resource configuration information of the first RTOS also includes the configuration information of the second hard disk space, the GPOS also determines whether the hard disk of the hybrid deployment system has the second hard disk space. If the hard disk of the hybrid deployment system has the second hard disk space, the second hardware resource is verified to be legal; if the hard disk of the hybrid deployment system does not have the second hard disk space or does not have part of the hard disk space of the second hard disk space, the second hardware resource is verified to be illegal.
[0178] When the sub-hardware resource configuration information of the first RTOS also includes identification information of at least one second network port, the GPOS also determines whether the network card of the hybrid deployment system has the at least one second network port. If the network card of the hybrid deployment system has the at least one second network port, the second hardware resource is verified to be legal; if the network card of the hybrid deployment system does not have the at least one second network port or does not have part of the second network ports of the at least one second network port, the second hardware resource is verified to be illegal.
[0179] Verification method 3: GPOS determines whether the hybrid deployment system has all the resources in the second hardware resources corresponding to the first RTOS based on the sub-hardware resource configuration information of the first RTOS; if the hybrid deployment system has all the resources in the second hardware resources, it determines whether the second hardware resources are idle. If each resource in the second hardware resources is idle, it verifies that the second hardware resources are legal; if the hybrid deployment system does not have all the resources in the second hardware resources or some resources in the second hardware resources are not idle, it verifies that the second hardware resources are illegal.
[0180] In some embodiments, the GPOS includes an RTOS management module. Upon receiving the correspondence between RTOS identification information and the RTOS's hard disk resource configuration information from the RTOS agent module, the RTOS management module identifies any RTOS in the correspondence as a first RTOS and obtains the hardware resource configuration information of the first RTOS from the correspondence. The RTOS management module then determines a second hardware resource based on the hardware resource configuration information of the first RTOS. Optionally, the RTOS management module may also verify the validity of the second hardware resource; upon verifying the validity of the second hardware resource, the module performs the following operation to install the source program of the first RTOS on the second hardware resource.
[0181] 5032: The GPOS sets a memory space accessible to at least one second processor core as a second memory space, or sets a memory space accessible to at least one second processor as a second memory space.
[0182] In 5032, when the second hardware resource corresponding to the first RTOS includes at least one second processor core, the GPOS can set the startup address of the at least one first processor core to the base address of the second memory space, so that when the at least one first processor core is started, the at least one first processor core can automatically access the second memory space, that is, the memory space accessible to the at least one second processor core is set to the second memory space.
[0183] In the case where the second hardware resource corresponding to the first RTOS includes at least one second processor, the GPOS can set the startup address of the at least one first processor to the base address of the second memory space, so that when the at least one first processor is started, the at least one first processor can automatically access the second memory space, that is, the memory space accessible to the at least one second processor is set to the second memory space.
[0184] 5033: The GPOS writes the first RTOS image file into the second memory space.
[0185] The first RTOS image file includes a first mapping relationship, and the first mapping relationship is used to store a mapping relationship between a plurality of virtual memory addresses and a plurality of physical memory addresses, where the plurality of virtual memory addresses are addresses that the first RTOS needs to access.
[0186] In 5033 , the GPOS reads the first RTOS image file from the image file library and writes the first RTOS image file into the second memory space.
[0187] In some embodiments, the RTOS management module receives an address of an image file library, obtains a first RTOS image file from the image file library based on the address of the image file library, and writes the first RTOS image file into the second memory space.
[0188] 5034: GPOS configures a second mapping relationship in the first RTOS image file to obtain a second RTOS image file, the second mapping relationship is used to save the mapping relationship between the multiple virtual memory addresses and the multiple physical memory addresses included in the second memory space, the second mapping relationship is used to enable the first RTOS to access the second memory space, and the RTOS source program includes the second RTOS image file.
[0189] In 5034, the GPOS updates the first mapping relationship in the first RTOS image file to a second mapping relationship to obtain a second RTOS image file, where the second mapping relationship is used to store the mapping relationship between the multiple virtual memory addresses and the multiple physical memory addresses included in the second memory space. Optionally, during implementation:
[0190] For each virtual memory address included in the first mapping relationship in the first RTOS image file, the GPOS selects a physical memory address corresponding to each virtual memory address from the second memory space, and updates the physical memory address corresponding to each virtual memory address included in the first mapping relationship in the first RTOS image file to the selected physical memory address corresponding to each virtual memory address, to obtain a second RTOS image file.
[0191] In some embodiments, the first mapping relationship may be a memory management unit (MMU) original table, etc.
[0192] In some embodiments, the RTOS management module updates the first mapping relationship in the first RTOS image file to a second mapping relationship to obtain a second RTOS image file.
[0193] In some embodiments, the image file library may further include a loading file, the GPOS may further write the loading file into the second memory space, and the RTOS source program may also include the loading file.
[0194] Step 504: The GPOS triggers the second hardware resource to create a first RTOS based on the RTOS source program. The first RTOS runs directly on the second hardware resource. The first RTOS is used to execute a first real-time service corresponding to the first RTOS.
[0195] In step 504, if the second hardware resource corresponding to the first RTOS includes at least one second processor core, the GPOS may start the at least one second processor core. After starting, the at least one first processor core reads the second RTOS image file from the second memory space based on the set startup address, and creates the first RTOS by running the second RTOS image file. Alternatively,
[0196] In the case where the second hardware resources corresponding to the first RTOS include at least one second processor, the GPOS can start the at least one second processor. After starting, the at least one first processor reads the second RTOS image file from the second memory space based on the set startup address, and creates the first RTOS by running the second RTOS image file.
[0197] In some embodiments, the second memory space further stores a loading file, the second RTOS image file includes multiple image contents, and the second memory space includes multiple memory areas, and the multiple memory areas correspond one-to-one to the multiple image contents.
[0198] When the second hardware resources corresponding to the first RTOS include at least one second processor core, upon startup, the at least one second processor core reads a load file from the second memory space and, by executing the load file, moves each image content included in the second RTOS image file to the memory area corresponding to each image content. The at least one second processor core then reads the image content stored in the multiple memory areas and executes the image content in the multiple memory areas to create the first RTOS.
[0199] When the second hardware resource corresponding to the first RTOS includes at least one second processor, upon startup, the at least one second processor reads a load file from the second memory space and, by executing the load file, moves each image content included in the second RTOS image file to the memory area corresponding to each image content. The at least one second processor then reads the image content stored in the multiple memory areas and executes the image content in the multiple memory areas to create the first RTOS.
[0200] In some embodiments, the second RTOS image file includes multiple or all image contents including dynamic variables, function stack frames and local variables, global static variables and function codes. The second memory space includes multiple or all memory areas including a heap area, a stack area, a global static variable area and a function area. After startup, the at least one second processor core or the at least one second processor reads the load file from the second memory space, and by running the load file, moves the dynamic variables included in the second RTOS image file to the heap area included in the second memory space, moves the function stack frames and local variables included in the second RTOS image file to the stack area included in the second memory space, moves the global static variables included in the second RTOS image file to the global static variable area included in the second memory space, and moves the function code included in the second RTOS image file to the function area included in the second memory space.
[0201] In some embodiments, the load file further includes a value of at least one variable in the second RTOS image file.
[0202] In the case where the second hardware resource corresponding to the first RTOS includes at least one second processor core, the at least one second processor core sets the initial value of each variable in the at least one variable in the second RTOS image file to the value of each variable, and runs the image content in the multiple memory areas based on the value of each variable. Or,
[0203] In a case where the second hardware resource corresponding to the first RTOS includes at least one second processor, the at least one second processor sets the initial value of each variable in the at least one variable in the second RTOS image file to the value of each variable, and runs the image content in the multiple memory areas based on the value of each variable.
[0204] Optionally, during implementation: before moving each mirror content, the at least one second processor core or the at least one second processor sets the initial value of each variable in the at least one variable in the second RTOS image file to the value of each variable. Then, the at least one second processor core or the at least one second processor moves each mirror content included in the second RTOS image file to the memory area corresponding to each mirror content, and runs the mirror content in the multiple memory areas based on the value of each variable. Alternatively, after moving each mirror content, the at least one second processor core or the at least one second processor sets the initial value of each variable in the at least one variable in the multiple mirror contents to the value of each variable, and runs the mirror content in the multiple memory areas based on the value of each variable.
[0205] In some embodiments, after creating the first RTOS, the GPOS may create a first communication channel with the first RTOS. The first communication channel is used to transmit information between the GPOS and the first RTOS. The information includes one or more of the following: information obtained by the GPOS when executing non-real-time services or information obtained by the first RTOS when executing the first real-time service corresponding to the first RTOS, etc.
[0206] In some embodiments, the first communication channel is a shared memory space accessible to both the GPOS and the first RTOS, and the shared memory space is a space in the memory of the hybrid deployment system. Optionally, the shared memory space is a portion of the first memory space corresponding to the GPOS. In implementation,
[0207] The GPOS can allocate a portion of memory space in the first memory space as the shared memory space, and send the base address and size of the shared memory space to the first RTOS. The GPOS can read and write the shared memory space, and the first RTOS can read and write the shared memory space based on the base address and size of the shared memory space, so that the GPOS and the first RTOS can communicate using the shared memory space.
[0208] For example, the GPOS can write information to be sent to the shared memory space, and the first RTOS can read the information from the shared memory space, so that the GPOS can send the information to the first RTOS. Alternatively, the first RTOS can write information to be sent to the shared memory space, and the GPOS can read the information from the shared memory space, so that the first RTOS can send the information to the GPOS.
[0209] In some embodiments, the second hardware resources corresponding to the first RTOS further include at least one second network port, and the second RTOS image file includes a network driver. After the at least one second processor core or the at least one second processor creates the first RTOS, the network driver is installed on the at least one second network port, and network configuration is performed on the at least one second network port on which the network driver is installed, so that the at least one second network port is used to transmit information obtained when the first RTOS executes the first real-time service.
[0210] Optionally, the first RTOS performs VF configuration and / or VLAN configuration on the at least one second network port.
[0211] The first RTOS may use the at least one second network port to communicate with at least one device in the industrial production line to transmit information obtained during the first real-time service.
[0212] In some embodiments, the GPOS may send identification information of the at least one second network port to the created first RTOS. The first RTOS may determine the at least one second network port from a network card of the hybrid deployment system based on the identification information of the at least one second network port and install the network driver on the at least one second network port.
[0213] In some embodiments, after the first RTOS is created, the first RTOS is further used to start a network communication protocol stack, which includes at least one network communication protocol, and executes the first real-time service based on the at least one network communication protocol.
[0214] In some embodiments, the at least one network communication protocol includes an Internet Protocol (IP) or an industrial protocol. The industrial protocol may include one or more of the following: Ethernet Control Automation Technology (EtherCAT) protocol, Ethernet Internet Protocol (Ethernet / IP, EIP), or Modbus TCP / IP. Modbus is a serial communication protocol in industrial communication systems. TCP is the Transmission Control Protocol.
[0215] In some embodiments, the sub-hardware resource configuration information of the first RTOS also includes configuration information of the second hard disk space (the base address and size of the second hard disk space). The GPOS can send the configuration information of the second hard disk space to the created first RTOS. The first RTOS can access the second hard disk space based on the configuration information of the second hard disk space.
[0216] In some embodiments, the second hard disk space may be at least one file in a file system, and the first RTOS accessing the second hard disk space may be accessing a file in the at least one file. When the first RTOS accesses a file, it may request permission from the GPOS to access the file. If the file is a file in the second hard disk space, the GPOS grants permission to access the file, and the first RTOS can then access the file.
[0217] Optionally, during implementation, the first RTOS sends the root directory of the file to be accessed to GPOS. Based on the root directory of the file, GPOS determines whether the file is a file in the second hard disk space. If the file is a file in the second hard disk space, GPOS grants the first RTOS permission to access the file.
[0218] After the first RTOS is created, the first RTOS may feed back a creation success message to the GPOS. After receiving the creation success message, the GPOS may create RTOSs other than the first RTOS in the at least one RTOS in the above manner.
[0219] For example, if the at least one RTOS other than the first RTOS includes a second RTOS, the GPOS may obtain sub-hardware resource configuration information of the second RTOS. The sub-hardware resource configuration information of the second RTOS is used to indicate the second hardware resources corresponding to the second RTOS. The second hardware resources corresponding to the second RTOS include at least one second processor core or at least one second processor. Optionally, the second hardware resources corresponding to the second RTOS also include a second memory space, a second hard disk space, and / or at least one second network port. The second hardware resources corresponding to the second RTOS are resources included in a hybrid deployment system, and the first hardware resources, the second hardware resources corresponding to the first RTOS, and the second hardware resources corresponding to the second RTOS are different from each other. Based on the sub-hardware resource configuration information of the second RTOS, the GPOS installs the RTOS source program on the second hardware resources corresponding to the second RTOS. The GPOS triggers the second hardware resources corresponding to the second RTOS to create the second RTOS based on the RTOS source program. The second RTOS runs directly on the second hardware resources corresponding to the second RTOS, and the second RTOS is used to execute the second real-time service corresponding to the second RTOS.
[0220] In an embodiment of the present application, a GPOS is started on a first hardware resource in a hybrid deployment system, and the GPOS runs directly on the first hardware resource. The GPOS can configure hardware resource configuration information, and the hardware resource configuration information is used to indicate at least one second hardware resource that needs to be allocated to at least one RTOS to be created. For the first RTOS included in the at least one RTOS, the GPOS installs the RTOS source program on the second hardware resource corresponding to the first RTOS based on the hardware resource configuration information. The GPOS triggers the second hardware resource corresponding to the first RTOS to create the first RTOS based on the RTOS source program, and the first RTOS runs directly on the second hardware resource corresponding to the first RTOS. The GPOS can create at least one RTOS, and each RTOS runs directly on the second hardware resource corresponding to each RTOS, thereby realizing the bare metal deployment of the GPOS on the first hardware resource, and each RTOS is bare metal deployed on the second hardware resource corresponding to each RTOS. The GPOS executes non-real-time services, and each RTOS is used to execute the real-time services corresponding to each RTOS, thereby improving the real-time performance of executing non-real-time services and real-time services.
[0221] Figure 8 FIG1 shows a possible schematic block diagram of a hybrid deployment device of multiple operating systems involved in an embodiment of the present application. Figure 8 As shown, the hybrid deployment device 800 may include modules or units for implementing the above method embodiments. In one possible design, the hybrid deployment device 800 includes: a processing unit 801 and a communication unit 802. Optionally, the hybrid deployment device 800 may also include a storage unit 803 for storing device program code and / or data.
[0222] (1) The hybrid deployment device 800 may be a GPOS-side device in the hybrid deployment system in the above-mentioned embodiment.
[0223] For example, in one embodiment, the hybrid deployment system also includes a first hardware resource and a second hardware resource, and the first hardware resource and the second hardware resource respectively include at least one processor core in the same processor, or the first hardware resource and the second hardware resource respectively include at least one processor of the same type, and the hybrid deployment device 800 runs on the first hardware resource, and the hybrid deployment device 800 is used to execute non-real-time services.
[0224] The processing unit 801 is configured to: obtain hardware resource configuration information, where the hardware resource configuration information is used to indicate a second hardware resource;
[0225] The processing unit 801 is further configured to: install a real-time operating system RTOS source program on the second hardware resource based on the hardware resource configuration information;
[0226] The processing unit 801 is further configured to trigger the second hardware resource to create an RTOS based on the RTOS source program, wherein the RTOS runs on the second hardware resource and is configured to execute real-time services.
[0227] Optionally, the detailed implementation process of the processing unit 801 obtaining the hardware resource configuration information can refer to the relevant content in step 502 of the method 500 shown in Figure 5, and will not be described in detail here.
[0228] Optionally, the detailed implementation process of the processing unit 801 installing the real-time operating system RTOS source program on the second hardware resource can be found in the relevant content of step 503 of the method 500 shown in Figure 5, and will not be described in detail here.
[0229] Optionally, the detailed implementation process of the processing unit 801 triggering the second hardware resource to create an RTOS based on the RTOS source program can be found in the relevant content of step 504 of the method 500 shown in Figure 5, and will not be described in detail here.
[0230] In one possible design, the second hardware resource also includes memory space. The processing unit 801 is specifically configured to:
[0231] Determining a second hardware resource based on the hardware resource configuration information;
[0232] When the second hardware resource includes at least one processor core, configuring the at least one processor core to be able to access the memory space; or, when the second hardware resource includes at least one processor, configuring the at least one processor to be able to access the memory space;
[0233] Writing a first RTOS image file into the memory space, where the first RTOS image file includes a plurality of virtual addresses accessible to the first RTOS;
[0234] A mapping relationship is configured in the first RTOS image file to obtain a second RTOS image file. The mapping relationship is used to save the mapping relationship between the multiple virtual memory addresses and the multiple physical memory addresses included in the memory space. The mapping relationship is used to enable the RTOS to access the memory space. The RTOS source program includes the second RTOS image file.
[0235] Optionally, the detailed implementation process of the processing unit 801 determining the second hardware resource can refer to the relevant content in step 5031 of the method 500 shown in Figure 5, and will not be described in detail here.
[0236] Optionally, the processing unit 801 configures the at least one processor core to access the memory space, or the detailed implementation process of configuring the at least one processor to access the memory space can be found in the relevant content of step 5032 of method 500 shown in 5, which will not be described in detail here.
[0237] Optionally, the detailed implementation process of the processing unit 801 writing the first RTOS image file into the memory space can be found in the relevant content of step 5033 of the method 500 shown in Figure 5, and will not be described in detail here.
[0238] Optionally, the detailed implementation process of the processing unit 801 configuring the mapping relationship in the first RTOS image file to obtain the second RTOS image file can be found in the relevant content of step 5034 of the method 500 shown in Figure 5, which will not be described in detail here.
[0239] In one possible design, the processing unit 801 is specifically configured to:
[0240] In a case where the second hardware resource includes at least one processor core, starting the at least one processor core, wherein the at least one processor core is configured to read the second RTOS image file in the memory space after starting, and create the RTOS by running the second RTOS image file; or
[0241] In the case where the second hardware resource includes at least one processor, the at least one processor is started, and the at least one processor is used to read the second RTOS image file in the memory space after starting, and create the RTOS by running the second RTOS image file.
[0242] In one possible design, the second RTOS image file includes multiple image contents, the memory space includes multiple memory areas, the multiple memory areas correspond to the multiple image contents, and the RTOS source program also includes a load file, the load file is used to instruct each image content to be moved to the memory area corresponding to each image content. The processing unit 801 is specifically used to:
[0243] Writing the loaded file into the memory space;
[0244] Wherein, in the case where the second hardware resource includes at least one processor core, the at least one processor core is further configured to read a load file in the memory space, move each image content to a memory area corresponding to each image content by running the load file, and create the RTOS by running the image contents in the multiple memory areas; or
[0245] In the case where the second hardware resource includes at least one processor, the at least one processor is also used to read the loading file in the memory space, and by running the loading file, each image content is moved to the memory area corresponding to each image content, and the RTOS is created by running the image contents in the multiple memory areas.
[0246] In one possible design, the load file further includes a value of at least one variable in the second RTOS image file;
[0247] Wherein, in a case where the second hardware resource includes at least one processor core, the at least one processor core is further configured to set the initial value of each variable in the at least one variable in the second RTOS image file to the value of each variable, and run the image contents in the multiple memory areas based on the value of each variable; or
[0248] In the case where the second hardware resource includes at least one processor, the at least one processor is further used to set the initial value of each variable in at least one variable in the second RTOS image file to the value of each variable, and run the image content in the multiple memory areas based on the value of each variable.
[0249] In one possible design, the processing unit 801 is further used to: create a communication channel with the RTOS, where the communication channel is used to transmit information between the hybrid deployment device 800 and the RTOS.
[0250] In one possible design, the communication channel is a shared memory space accessible to both the hybrid deployment device 800 and the RTOS, and the shared memory space is a memory space in the hybrid deployment system.
[0251] In one possible design, the processing unit 801 is further used to: verify the legitimacy of the second hardware resource based on the hardware resource configuration information; and install the RTOS source program on the second hardware resource when the second hardware resource is verified to be legitimate.
[0252] In one possible design, the processing unit 801 is also used to: after the hybrid deployment device 800 is run on the first hardware resource, uninstall the network driver installed on the network card of the hybrid deployment system, and install the network driver of the hybrid deployment device 800 on the network card, so that the network card is used to transmit information obtained when the hybrid deployment device 800 performs non-real-time services.
[0253] In one possible design, the hybrid deployment system includes a plurality of second hardware resources, and the second hardware resource indicated by the hardware resource configuration information is a plurality of second hardware resources;
[0254] Processing unit 801 is used to trigger the multiple second hardware resources to create multiple RTOSs based on the RTOS source program. The multiple RTOSs correspond to the multiple second hardware resources. Each RTOS runs on the second hardware resources corresponding to each RTOS. The multiple RTOSs correspond to multiple instance services. Each RTOS is used to execute the real-time service corresponding to each RTOS.
[0255] (2) The hybrid deployment device 800 may be an RTOS-side device included in the hybrid deployment system in the above embodiment.
[0256] For example, in one embodiment, the second hardware resource corresponding to the hybrid deployment apparatus 800 further includes at least one network port, and the multiple real-time services include the first real-time service corresponding to the hybrid deployment apparatus 800 .
[0257] The processing unit 801 is configured to: install a network driver on the at least one network port after the RTOS is created;
[0258] The processing unit 801 is further configured to perform network configuration on the at least one network port so that the at least one network port is used to transmit information obtained when the hybrid deployment device 800 executes the first real-time service.
[0259] In one possible design, the processing unit 801 is further used to: start a network communication protocol stack, which includes at least one network communication protocol; and execute a first real-time service based on the at least one network communication protocol.
[0260] In one possible design, the RTOS side device is one of the multiple RTOSs included in the hybrid deployment system. The hybrid deployment system includes multiple second hardware resources. The multiple RTOSs correspond to the multiple second hardware resources. Each RTOS runs on the second hardware resources corresponding to each RTOS. The multiple RTOSs correspond to multiple instance services. Each RTOS is used to execute the real-time service corresponding to each RTOS.
[0261] It is understandable that the division of units in the above-mentioned device is merely a division of logical functions, and each function may correspond to a functional unit, or two or more functions may be integrated into one functional unit. In actual implementation, all or part of the units may be integrated into one physical entity, or distributed across different physical entities. In addition, the above-mentioned functional units may be implemented in the form of hardware, software, or a combination of hardware and software. Whether a function is executed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0262] In one example, the functional unit in any of the above devices can be one or more integrated circuits configured to implement the above method, such as: one or more application specific integrated circuits (ASICs), or, one or more central processing units (CPUs), one or more microprocessors (MCUs), one or more digital signal processors (DSPs), or, one or more field programmable gate arrays (FPGAs), or a combination of at least two of these integrated circuit forms.
[0263] In an example, the storage unit 803 may include a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory and / or a register.
[0264] In an embodiment of the present application, the processing unit determines multiple second hardware resources corresponding to multiple RTOSs, installs RTOS source programs on the multiple second hardware resources, and triggers the multiple second hardware resources to create multiple RTOSs. The multiple RTOSs run on the multiple second hardware resources, and the hybrid deployment device runs on the first hardware resource. The hybrid deployment system is bare metal deployed on the first hardware resource, and each RTOS is bare metal deployed on the second hardware resource corresponding to each RTOS. The hybrid deployment system executes non-real-time services, and each RTOS is used to execute the real-time services corresponding to each RTOS, thereby improving the real-time performance of executing non-real-time services and real-time services.
[0265] See also Figure 9, the embodiment of the present application provides a schematic diagram of a hybrid deployment device 900 for multiple operating systems. The device 900 may be the above Figure 1 The hybrid deployment system 10 in the illustrated network architecture 100, or Figure 2 、 Figure 3 or Figure 4 The deployment system 10 shown, or Figure 5 The hybrid deployment system in the illustrated method 500 . The apparatus 900 includes at least one processor 901 , an internal connection 902 , a memory 903 and at least one port 904 .
[0266] The device 900 is a hardware structure device that can be used to implement Figure 8 The functional modules in the device 800 are as follows. For example, those skilled in the art may think of Figure 8 The processing unit 801 in the device 800 shown can be implemented by the at least one processor 901 calling the code in the memory 903. Figure 8 The communication unit 802 in the illustrated apparatus 800 may be implemented through the at least one port 904 .
[0267] Optionally, the device 900 can also be used to implement the functions of the hybrid deployment system in any of the above embodiments.
[0268] Optionally, the processor 901 may be a general-purpose central processing unit (CPU), a network processor (NP), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the present application.
[0269] The internal connection 902 may include a path for transmitting information between the components. Optionally, the internal connection 902 is a single board or a bus.
[0270] The at least one port 904 is used to communicate with other devices or communication networks.
[0271] The above-mentioned memory 903 can be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to this. The memory can exist independently and be connected to the processor through a bus. The memory can also be integrated with the processor.
[0272] The memory 903 is used to store application code for executing the solution of the present application, and the execution is controlled by the processor 901. The processor 901 is used to execute the application code stored in the memory 903 and cooperate with at least one port 904, so that the device 900 can implement the functions of the method of the present invention.
[0273] In a specific implementation, as an embodiment, the processor 901 may include one or more CPUs, such as Figure 9 CPU0 and CPU1 in.
[0274] In a specific implementation, as an embodiment, the apparatus 900 may include multiple processors, such as Figure 9 901 and processor 907 in FIG. Each of these processors may be a single-CPU processor or a multi-CPU processor. A processor herein may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).
[0275] The terms "system" and "network" in the embodiments of the present application can be used interchangeably. "At least one" refers to one or more, and "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can represent: the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural. The character " / " generally indicates that the associated objects before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, "at least one of A, B or C" includes A, B, C, AB, AC, BC or ABC, and "at least one of A, B and C" can also be understood to include A, B, C, AB, AC, BC or ABC. And, unless otherwise specified, the ordinal numbers such as "first" and "second" mentioned in the embodiments of the present application are used to distinguish multiple objects and are not used to limit the order, timing, priority or importance of multiple objects.
[0276] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, optical storage, etc.) that contain computer-usable program code.
[0277] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0278] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0279] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0280] Obviously, those skilled in the art may make various changes and modifications to the present application without departing from the scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include these modifications and variations.
[0281] Those skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware, or by a program to instruct the relevant hardware, and the program may be stored in a computer-readable storage medium, which may be a read-only memory, a disk, or an optical disk, etc.
[0282] The above description is merely an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A hybrid deployment system for multiple operating systems, characterized in that: The hybrid deployment system includes a general-purpose operating system GPOS, a real-time operating system RTOS, a first hardware resource, and a second hardware resource, wherein the first hardware resource and the second hardware resource each include at least one processor core in the same processor, or the first hardware resource and the second hardware resource each include at least one processor of the same type; The GPOS runs on the first hardware resource, and the RTOS runs on the second hardware resource; The GPOS is used to execute non-real-time services; The RTOS is used to execute the real-time business corresponding to the RTOS.
2. The hybrid deployment system according to claim 1, wherein: A communication channel exists between the GPOS and the RTOS, and the communication channel is used to transmit information between the GPOS and the RTOS.
3. The hybrid deployment system according to claim 2, wherein: The communication channel is a shared memory space accessible to both the GPOS and the RTOS, and the shared memory space is a memory space in the hybrid deployment system.
4. The hybrid deployment system according to any one of claims 1 to 3, wherein: The hybrid deployment system includes multiple RTOSs, and the hybrid deployment system includes multiple second hardware resources. The multiple RTOSs correspond to the multiple second hardware resources, and each RTOS runs on the second hardware resources corresponding to each RTOS. The multiple RTOSs correspond to multiple instance services, and each RTOS is used to execute the real-time services corresponding to each RTOS.
5. The hybrid deployment system according to any one of claims 1 to 4, wherein: The first hardware resource and the second hardware resource further include one or more of the following: memory space, hardware space, or at least one network port.
6. A hybrid deployment method for multiple operating systems, characterized in that: The method is applied to a general-purpose operating system (GPOS) included in a hybrid deployment system. The hybrid deployment system also includes a first hardware resource and a second hardware resource. The first hardware resource and the second hardware resource each include at least one processor core in the same processor, or the first hardware resource and the second hardware resource each include at least one processor of the same type. The GPOS runs on the first hardware resource and is used to execute non-real-time services. The method includes: The GPOS obtains hardware resource configuration information, where the hardware resource configuration information is used to indicate the second hardware resource; The GPOS installs a real-time operating system RTOS source program on the second hardware resource based on the hardware resource configuration information; The GPOS triggers the second hardware resource to create an RTOS based on the RTOS source program. The RTOS runs on the second hardware resource and is used to execute real-time services.
7. The method according to claim 6, wherein The second hardware resource further includes memory space, and the GPOS installs a real-time operating system RTOS source program on the second hardware resource based on the hardware resource configuration information, including: The GPOS determines the second hardware resource based on the hardware resource configuration information; The GPOS configures the at least one processor core to access the memory space when the second hardware resource includes at least one processor core, or configures the at least one processor to access the memory space when the second hardware resource includes at least one processor; The GPOS writes a first RTOS image file into the memory space, where the first RTOS image file includes a plurality of virtual addresses accessible to the RTOS; The GPOS configures a mapping relationship in the first RTOS image file to obtain a second RTOS image file, wherein the mapping relationship is used to save a mapping relationship between the multiple virtual memory addresses and the multiple physical memory addresses included in the memory space, and the mapping relationship is used to enable the RTOS to access the memory space, and the RTOS source program includes the second RTOS image file.
8. The method according to claim 7, wherein The GPOS triggers the second hardware resource to create an RTOS based on the RTOS source program, including: The GPOS starts the at least one processor core when the second hardware resource includes the at least one processor core, wherein the at least one processor core is configured to read the second RTOS image file in the memory space after starting, and create the RTOS by running the second RTOS image file; or When the second hardware resource includes at least one processor, the GPOS starts the at least one processor, and the at least one processor is used to read the second RTOS image file in the memory space after startup, and create the RTOS by running the second RTOS image file.
9. The method according to claim 8, wherein The second RTOS image file includes a plurality of image contents, the memory space includes a plurality of memory areas, the plurality of memory areas correspond to the plurality of image contents, and the RTOS source program further includes a load file, the load file is used to instruct each image content to be moved to the memory area corresponding to each image content; The GPOS installs a real-time operating system RTOS source program on the second hardware resource based on the hardware resource configuration information, further comprising: The GPOS writes the loading file into the memory space; Wherein, in the case where the second hardware resource includes at least one processor core, the at least one processor core is further used to read the load file in the memory space, move each image content to the memory area corresponding to each image content by running the load file, and create the RTOS by running the image contents in the multiple memory areas; or In the case where the second hardware resource includes at least one processor, the at least one processor is also used to read the loading file in the memory space, and by running the loading file, each image content is moved to the memory area corresponding to each image content, and the RTOS is created by running the image contents in the multiple memory areas.
10. The method according to claim 9, wherein The load file further includes the value of at least one variable in the second RTOS image file; Wherein, in the case where the second hardware resource includes at least one processor core, the at least one processor core is further used to set the initial value of each variable in the at least one variable in the second RTOS image file to the value of each variable, and run the image content in the multiple memory areas based on the value of each variable; or, In the case where the second hardware resource includes at least one processor, the at least one processor is further used to set the initial value of each variable in the at least one variable in the second RTOS image file to the value of each variable, and run the image content in the multiple memory areas based on the value of each variable.
11. The method according to any one of claims 7 to 10, wherein: The method further comprises: The GPOS establishes a communication channel with the RTOS, where the communication channel is used to transmit information between the GPOS and the RTOS.
12. The method according to claim 11, wherein The communication channel is a shared memory space accessible to both the GPOS and the RTOS, and the shared memory space is a memory space in the hybrid deployment system.
13. The method according to any one of claims 6 to 12, characterized in that The GPOS installs a real-time operating system RTOS source program on the second hardware resource based on the hardware resource configuration information, including: The GPOS verifies the legitimacy of the second hardware resource based on the hardware resource configuration information; When verifying that the second hardware resource is legal, the GPOS installs the RTOS source program on the second hardware resource.
14. The method according to any one of claims 6 to 13, wherein: The method further comprises: After the first hardware resource runs the GPOS, the GPOS uninstalls the network driver installed on the network card of the hybrid deployment system and installs the network driver of the GPOS on the network card, so that the network card is used to transmit information obtained when the GPOS executes the non-real-time service.
15. The method according to any one of claims 6 to 14, wherein: The hybrid deployment system includes a plurality of second hardware resources, and the second hardware resource indicated by the hardware resource configuration information is the plurality of second hardware resources; The GPOS triggers the second hardware resource to create an RTOS based on the RTOS source program, including: The GPOS triggers the multiple second hardware resources to create multiple RTOSs based on the RTOS source program, the multiple RTOSs correspond to the multiple second hardware resources, and each RTOS runs on the second hardware resources corresponding to each RTOS. The multiple RTOSs correspond to multiple instance services, and each RTOS is used to execute the real-time service corresponding to each RTOS.
16. A hybrid deployment method for multiple operating systems, characterized in that: The method is applied to a first real-time operating system (RTOS) included in a hybrid deployment system. The hybrid deployment system also includes a general-purpose operating system (GPOS), a first hardware resource, and a second hardware resource. The first hardware resource and the second hardware resource each include at least one processor core in the same processor, or the first hardware resource and the second hardware resource each include at least one processor of the same type. The GPOS runs on the first hardware resource and is used to execute non-real-time services. An RTOS source program is installed on the second hardware resource and the second hardware resource is triggered to create the first RTOS based on the RTOS source program. The first RTOS runs on the second hardware resource and is used to execute a first real-time service. The second hardware resource also includes at least one network port, and the RTOS source program includes a network driver. The method includes: After being created, the first RTOS installs the network driver on the at least one network port. The first RTOS performs network configuration on the at least one network port, so that the at least one network port is used to transmit information obtained when the first RTOS executes the first real-time service.
17. The method according to claim 16, wherein The method further comprises: The first RTOS starts a network communication protocol stack, wherein the network communication protocol stack includes at least one network communication protocol; The first RTOS executes the first real-time service, including: The first RTOS executes the first real-time service based on the at least one network communication protocol.
18. The method according to claim 16 or 17, wherein: The first RTOS is one of the multiple RTOSs included in the hybrid deployment system. The hybrid deployment system includes multiple second hardware resources. The multiple RTOSs correspond to the multiple second hardware resources. Each RTOS runs on the second hardware resources corresponding to each RTOS. The multiple RTOSs correspond to multiple instance services. Each RTOS is used to execute the real-time service corresponding to each RTOS.
19. A hybrid deployment device for multiple operating systems, characterized in that: The method comprises a module or a unit for executing the method according to any one of claims 6 to 14.
20. A hybrid deployment device for multiple operating systems, characterized in that: The method comprises a module or a unit for executing the method according to any one of claims 16 to 18.
21. A hybrid deployment device for multiple operating systems, characterized in that: It includes a memory and one or more processors, the memory is used to store computer programs; the one or more processors are used to execute the computer programs in the memory, so that the hybrid deployment device executes the method as described in any one of claims 6 to 15.
22. A hybrid deployment device for multiple operating systems, characterized in that: It includes a memory and one or more processors, the memory is used to store computer programs; the one or more processors are used to execute the computer programs in the memory, so that the hybrid deployment device executes the method as described in any one of claims 16 to 18.
23. A computer-readable storage medium, characterized in that The storage medium stores a computer program or instruction. When the computer program or instruction is executed by a computer, the method according to any one of claims 6 to 19 is implemented.
24. A computer program product, characterized in that When a computer reads and executes the computer program product, the computer is caused to execute the method according to any one of claims 6 to 18.