A system updating method and device based on multi-system isolation
By isolating the system domain to be updated and the system domain to be updated on the multi-core chip, stable system operation and data security during the operating system update are achieved, the problems of system suspension and security threats during the update process in the existing technology are solved, and the update is ensured. Stability and security.
Patent Information
- Application Number
- CN202410906295.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-08
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-07-08
AI Technical Summary
The existing operating system update mechanism may cause the system to suspend operation during the update process, and there is a risk of update failure. Effective isolation measures are not implemented, resulting in data and resource security threats.
Using a method based on multi-system isolation, the hardware resources of the multi-core chip are isolated into the system domain to be updated and the slave update system domain. The main maintenance operation function is maintained during the update through shared memory communication to ensure system stability and data security during the update process. .
It enables the system to continue running during the operating system update, ensuring the security of hardware and data resources, ensuring the normal operation of the main maintenance operation function after the update is completed, and being able to resume the update action after the system is powered off, improving the stability and security of the update. sex.
Smart Images

Figure CN118445818B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of operating system update, and in particular to a system update method and device based on multi-system isolation. Background Art
[0002] With the rapid development of information technology, the application of operating systems in various industries has become more and more in-depth and extensive, and the demand for functional iteration and optimization and upgrading has also increased, and the corresponding system update frequency has continued to increase. At present, the operating system is mainly updated through online updates on the network, USB or hard disk and other offline media, especially the network update method is widely used due to its convenience and efficiency. At the same time, modern microprocessor technology has realized the integration of multiple processor cores on a single chip, which greatly improves hardware performance and provides more possibilities for the design and implementation of operating systems.
[0003] The existing operating system update mechanism has obvious limitations and potential risks. First, during the operating system update process, it is usually necessary to suspend the operation of the system and its related functions, resulting in the inability to provide normal services during this period. Secondly, once the operating system update process encounters an unexpected interruption, it may cause the update to fail. In extreme cases, it may cause the operating system to be unable to resume startup, resulting in the so-called "catastrophic consequences." In addition, the current operating system update does not implement effective isolation measures, which makes sensitive data and key resources face potential security threats during the update process, and it is possible that data leaks or other security incidents may occur due to the update operation. Summary of the invention
[0004] The technical problem to be solved by the present invention is: in response to the technical problems existing in the prior art, the present invention provides a system update method and device based on multi-system isolation with strong stability and high flexibility, so as to realize the continued operation of related functions of the operating system during the update and ensure the security of related hardware and data resources.
[0005] In order to solve the above technical problems, the technical solution proposed by the present invention is:
[0006] A system update method based on multi-system isolation is applied to a multi-core chip, wherein the hardware resources of the multi-core chip are isolated into a system domain to be updated and a secondary update system domain, the system to be updated is run in the system domain to be updated, and the secondary update system is run in the secondary update system domain, and the method comprises the following steps:
[0007] S01. Issue an update command to the system to be updated, the system to be updated obtains the update command and verifies it, and after verification, the update system is evaluated, and the system to be updated maintains and manages the update system;
[0008] S02. The system to be updated sends the main maintenance operation function data to the satisfying conditions from the update system, the update system from the corresponding maintenance operation function data from the main maintenance operation function, and set the system update exception parameters;
[0009] S03. The updated system performs an update operation. If the update is successful, the update system returns the current maintenance operation function data to the updated system, stops the update system from running and recovers the hardware resources related to the update system domain to the updated system, and the updated system restores the corresponding main maintenance operation function according to the current maintenance operation function data.
[0010] Furthermore, in step S01, when evaluating the slave update system, it includes:
[0011] S201. Determine whether there is a slave update system. If there is a slave update system, execute step S202. Otherwise, isolate the related hardware resources of the multi-core chip to create a new slave update system domain and run the new slave update system.
[0012] S202. Determine whether the slave update system in the slave update system domain is capable of running the main maintenance operation function of the system to be updated; if so, use the slave update system as a slave update system that meets the conditions; otherwise, create a new slave update system domain, run the slave update system that is capable of running the main maintenance operation function of the system to be updated and use it as a slave update system that meets the conditions to run the slave maintenance operation function corresponding to the main maintenance operation function.
[0013] Furthermore, step S03 also includes: if the update fails and the system update abnormal parameters are parameters for restoring the system mode, the slave update system continues to run the slave maintenance operation function and restarts the system to be updated to restore the operation of the system to be updated, the slave update system returns the current slave maintenance operation function data to the system to be updated, and the system to be updated restores the corresponding main maintenance operation function according to the current slave maintenance operation function data; after the system to be updated resumes normal operation, the slave update system is stopped and the hardware resources related to the slave update system domain are recovered to the system to be updated.
[0014] Further, step S03 also includes: if the update fails and the system update abnormality parameter is a parameter of the assisted update mode, the slave update system continues to try to update the system to be updated according to the settings, including: the slave update system obtains the update image of the system to be updated and updates the system to be updated, and continues to run the slave maintenance operation function. After the update of the system to be updated is completed, the slave update system returns the current slave maintenance operation function data to the system to be updated, and the system to be updated restores the corresponding main maintenance operation function according to the current maintenance operation function data, stops the slave update system operation and reclaims the slave update system domain-related hardware resources to the system to be updated.
[0015] Furthermore, in step S02, when setting the system update abnormal parameters, it specifically includes:
[0016] The system to be updated reads the content of the corresponding system update exception setting structure and composes a setting data packet to send to the slave update system;
[0017] The data packet is obtained and parsed from the update system, and the data of the data packet is filled into the system update exception setting structure corresponding to the update system.
[0018] Furthermore, step S03 also includes: when the update of the system to be updated is abnormal, the slave update system notifies the system to be updated to handle the update exception, if a response from the system to be updated is received, the exception is ignored and the update exception response time is reset, if the response of the system to be updated times out, the update exception is handled according to the system update exception setting structure content corresponding to the slave update system.
[0019] Furthermore, the systems running in each system domain communicate with each other through shared memory. In the step S02, when the system to be updated sends the main maintenance operation function data to the slave update system, it includes: after the system to be updated writes the main maintenance operation function data packet into the shared memory, it triggers an interrupt of the corresponding slave update system; in the step S03, when the slave update system returns the current slave maintenance operation function data to the system to be updated, it includes: after the slave update system writes the slave maintenance operation function data packet into the shared memory, it triggers an interrupt of the corresponding system to be updated.
[0020] Furthermore, the system to be updated corresponds to one or more slave update systems, and the slave update system corresponds to one or more systems to be updated. When the system to be updated corresponds to multiple slave update systems, the non-real-time tasks and real-time tasks of the system to be updated correspond to different slave update systems respectively.
[0021] Furthermore, the main maintenance operation function and the slave maintenance operation function both maintain and manage corresponding tasks through a maintenance task linked list, and the stop and hardware resource recovery of the slave update system are maintained by the maintenance task linked list of the corresponding slave update system.
[0022] A system updating device based on multi-system isolation, comprising:
[0023] A multi-system isolation module is used to isolate the hardware resources of the multi-core chip into a system domain to be updated and a secondary update system domain, and to run the system to be updated in the system domain to be updated and the secondary update system in the secondary update system domain;
[0024] The system to be updated is used to obtain the update instruction and verify it. After the verification is passed, the slave update system is evaluated and maintained and managed. Then, the main maintenance operation function data is sent to the slave update system that meets the conditions. Finally, the update operation is performed. If the update is successful, the slave maintenance operation function data of the slave update system is obtained and the corresponding main maintenance operation function is restored according to the current slave maintenance operation function data.
[0025] The slave update system is used to run the corresponding slave maintenance operation function according to the main maintenance operation function data of the system to be updated. It is used to return the current slave maintenance operation function data to the system to be updated after the system to be updated is successfully updated. It is also used to restore the system to be updated according to the settings or continue the update operation of the system to be updated after the update of the system to be updated fails.
[0026] Compared with the prior art, the advantages of the present invention are:
[0027] The present invention isolates the system domain to be updated and the slave update system domain by hardware isolation, queries or creates a "slave update system" before the system is updated and obtains the system resources and data related to the "system to be updated", and after the system update starts, the "slave update system" maintains the main maintenance operation functions that need to be run by the "system to be updated" in real time to ensure the normal use of the main maintenance operation functions during the system update and restart phase. At the same time, after the update of the "system to be updated" is completed, the "slave update system" hands over the relevant system resources and data to the "system to be updated", so that the corresponding main maintenance operation functions can still operate normally after the update of the "system to be updated" is completed. The present invention can achieve the normal use of the main maintenance operation function and the safety of related data when the system is updated. And because of the independence of the "slave update system", after the system is powered off, the relevant data is still safe when it is powered on again, and the update action can be restored and continued, realizing the power-off update safety. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 The present invention is a simplified flowchart of a system update method based on multi-system isolation according to an embodiment of the present invention.
[0029] Figure 2 The figure is a detailed flow chart of a system updating method based on multi-system isolation according to an embodiment of the present invention.
[0030] Figure 3 It is a schematic diagram of the overall framework of an embodiment of the present invention.
[0031] Figure 4 The present invention is a flowchart of the communication between the system to be updated and the updating system. DETAILED DESCRIPTION
[0032] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0033] Integrating multiple processor cores in chip design has become the norm. This technology significantly enhances the processing power of chips and system flexibility. By integrating multiple CPU cores on the same chip, not only the parallel processing efficiency is improved, but also the design options are enriched to cope with the growing computing needs and complex application scenarios. Hypervisor technology (virtualization management program in computer systems) provides more functions for the system. Through hardware isolation methods such as jailhouse and kvisor, different processor cores, memory, peripherals and other hardware are isolated. The isolated different system domains are used to run different operating systems. Specifically, they can be divided into master system domains and slave system domains. The operating systems running in each system domain do not affect each other and communicate through shared memory. The present invention isolates relevant hardware resources including processor cores, memory, peripherals and other hardware resources through jailhouses, kvisors and the like, obtains or starts a new slave update system to prepare for updating the operating system; obtains relevant data packets of the system to be updated after the slave update system operates normally, and smoothly and in real time receives the main maintenance operation function of the system to be updated to ensure the normal operation of the main maintenance operation function during the operating system update; after the update of the system to be updated is completed, the slave update system sends a data packet to the system to be updated, and the system to be updated receives the data and smoothly and in real time restores the corresponding relevant main maintenance operation function. And when the update of the system to be updated is abnormal, the slave update system can restart the system to be updated and assist in completing the update action of the system to be updated. It not only ensures the stability and flexibility of the operating system update, but also ensures the safety of relevant hardware and data resources. At the same time, the system can resume normal operation after the update is interrupted due to system power failure, abnormal restart, etc.
[0034] like Figure 1 , Figure 2 and Figure 3 As shown, the system update method based on multi-system isolation in this embodiment is applied to a multi-core chip, the multi-core chip includes a system domain to be updated and a slave update system domain, the system to be updated is run in the system domain to be updated, the system to be updated includes a main maintenance operation function and an update processing unit; the slave update system is run in the slave update system domain, the slave update system includes a slave maintenance operation function and an assisting update unit, and the method includes the following steps:
[0035] S01. Issue an update command to the system to be updated, the system to be updated obtains the update command and verifies it, and after verification, evaluates the update system, and the system to be updated maintains and manages the update system;
[0036] S02. The system to be updated sends the main maintenance operation function data to the satisfying conditions from the update system, the update system runs the corresponding slave maintenance operation function data according to the main maintenance operation function, and sets the system update exception parameters;
[0037] S03. The system to be updated performs an update operation. If the update is successful, the update system returns the current maintenance operation function data to the system to be updated, stops the update system from running and reclaims the hardware resources related to the update system to the system to be updated. The system to be updated restores the corresponding main maintenance operation function according to the current maintenance operation function data.
[0038] like Figure 3 As shown, in this embodiment, the system to be updated includes an update processing unit and a main maintenance operation function, etc., wherein:
[0039] The update processing unit is used to update the operating system of the system to be updated, process the main maintenance operation function, communicate with the slave update system, manage the slave update system, create a slave update system domain and run the slave update system, etc. The specific functions are as follows:
[0040] 1. After receiving the operating system update command, the update processing unit obtains the operating system update image and verifies whether the operating system update image is legal. If the operating system update image is verified to be legal, the update processing unit asks whether there is a slave update system and determines whether the slave system domain can run the main maintenance operation function of the system to be updated.
[0041] 2. When there is a slave update system and it meets the main maintenance operation function of the system to be updated, the update processing unit of the system to be updated sends the main maintenance operation function data to the auxiliary update unit of the slave update system, and the auxiliary update unit of the slave update system prepares the corresponding slave maintenance operation function according to the received main maintenance operation function data.
[0042] 3. When there is a slave update system but it cannot meet the main maintenance operation function of the system to be updated or there is no slave update system, the update processing unit of the system to be updated creates a corresponding slave update system domain and starts the slave update system. After the slave update system starts normally, the update processing unit of the system to be updated sends the main maintenance operation function data to the assisting update unit of the slave update system. The assisting update unit of the slave update system prepares the corresponding slave maintenance operation function according to the received main maintenance operation function data. At the same time, the update processing unit of the system to be updated sets the system update exception setting of the assisting update unit of the slave update system. After the update exception of the system to be updated occurs, the assisting update unit handles the update exception according to the setting.
[0043] 4. After the update processing unit of the system to be updated confirms the system image to be updated, it first transfers the main maintenance operation function of the system to be updated to the auxiliary update unit of the slave update system. After the auxiliary update unit runs the corresponding slave maintenance operation function, the system to be updated starts the operating system update. After the corresponding data packets of the system to be updated and the slave update system are written into the shared memory, an interrupt will be triggered to ensure the real-time performance of the corresponding main maintenance operation function to the slave maintenance operation function.
[0044] 5. When the system to be updated is updated successfully, the update processing unit sends an update completion data packet to the assisting update unit of the slave update system. After confirmation, the assisting update unit sends the slave maintenance operation function data to the update processing unit. The update processing unit receives and restores the corresponding master maintenance operation function.
[0045] 6. The corresponding assisting update unit of the updating system monitors whether the update of the system to be updated is successful. When the update of the system to be updated fails, the assisting update unit of the updating system selects to continue to run the maintenance operation function and restore the operation of the system to be updated according to the system update abnormality setting; it can also assist in continuing to update the system to be updated.
[0046] 7. When the update of the system to be updated is completed and the secondary update system is not used by other systems to be updated, you can choose to close the secondary update system and reclaim related hardware resources.
[0047] 8. You can flexibly select the system to be updated or the secondary update system to lead the operating system update function of the system to be updated. However, after the system to be updated fails to update, the secondary update system will lead the update action or restore the corresponding system to be updated. When there are multiple secondary update systems, the update priority of each secondary update system maintenance task chain list will be used to determine which secondary update system will lead the update action or restore the corresponding system to be updated.
[0048] 9. The system to be updated can choose to send relevant system data (relevant system data includes system settings, application data, confidential data, backup data, etc.) packages to the secondary update system for maintenance and management through shared memory. After the system update is completed, the secondary update system returns the relevant system data to the corresponding system to be updated through the update memory.
[0049] The main maintenance operation function is the task that needs to be run during the process of updating the operating system of the system to be updated, such as the current interface display, the current running program, the network, the keyboard input, the mouse control, the motor, the sensor and other task functions. The main maintenance operation function maintains and manages the corresponding tasks through the main maintenance task list. The main maintenance task list is as follows:
[0050] typedef struct k_host_task_s
[0051] {
[0052] uint8 type; / / Task type
[0053] uint8 time; / / Task real-time
[0054] uint8 status; / / Task status
[0055] uint8 priority; / / Update priority
[0056] uint8 os_num; / / Corresponding to update system
[0057] struct ; / / Point to the task
[0058] struct k_host_task_t ; / / Point to the previous task
[0059] struct k_host_task_t ; / / Point to the next task
[0060] } k_host_task_t;
[0061] The system to be updated sets different exception behaviors of the update system through the system update exception setting structure. The system update exception setting structure of the system to be updated is as follows:
[0062] typedef struct k_host_abnormal_s
[0063] {
[0064] uint64 time; / / Update abnormal response time
[0065] uint8 set; / / Update exception handling settings
[0066] uint8 os_num; / / Corresponding to update system
[0067] struct k_host_abnormal_t ; / / Point to the next setting
[0068] } k_host_abnormal_t;
[0069] The secondary update system includes the auxiliary update unit and the secondary maintenance operation function. The specific functions of the auxiliary update unit are as follows:
[0070] 1. After receiving the query data from the update processing unit, the auxiliary update unit of the slave update system checks whether the slave update system can run the corresponding slave maintenance operation function based on the acquired data. If the corresponding slave maintenance operation function cannot be run, the corresponding data packet is replied and the connection is rejected. If the corresponding slave maintenance operation function can be run, the corresponding data packet is replied and the connection is established.
[0071] 2. After receiving the main maintenance operation function data packet of the update processing unit, the assisting update unit of the slave update system parses the data and prepares the corresponding slave maintenance operation function based on the data. It can run the corresponding slave maintenance operation function immediately after the preparation is completed, or run the corresponding slave maintenance operation function after waiting for the maintenance operation function start command of the update processing unit. At the same time, the assisting update unit of the slave update system receives the system update exception setting of the update processing unit to set the relevant processing behavior after the system update exception of the system to be updated.
[0072] 3. After receiving the data packet of successful update of the system to be updated, the assisting update unit of the slave update system starts to hand over the slave maintenance operation function of the slave update system. The assisting update unit composes a data packet with the data related to the slave maintenance operation function and sends it to the update processing unit; the update processing unit restores the main maintenance operation function according to the received data packet and assists the update unit in shutting down the corresponding slave maintenance operation function; after the corresponding data packet is written to the shared memory, an interrupt will be triggered to ensure the real-time performance of the corresponding slave maintenance operation function to the main maintenance operation function.
[0073] 4. The updating system can receive the relevant system data of the system to be updated, maintain the received relevant system data during the updating of the system to be updated, and send the relevant system data to the corresponding system to be updated after the updating of the system to be updated is completed.
[0074] 5. The slave update systems can communicate through shared memory. When a system to be updated corresponds to multiple slave update systems, after the update of the system to be updated is abnormal, the update priority of each slave update system maintenance task chain list determines which slave update system will take the lead in updating or restoring the corresponding system to be updated. When a slave update system corresponds to multiple systems to be updated, and the slave update system maintenance task chain list has other slave maintenance operation functions, the slave update system cannot be stopped and related hardware resources cannot be recovered, that is, when other systems to be updated use this slave update system, this slave update system cannot be stopped and related hardware resources cannot be recovered.
[0075] The secondary maintenance operation function is a task that corresponds one-to-one to the primary maintenance operation function of the system to be updated. The secondary maintenance operation function maintains and manages the corresponding tasks through the secondary maintenance task chain list. The secondary maintenance task chain list is as follows:
[0076] typedef struct k_slave_task_s
[0077] {
[0078] uint8 type; / / Task type
[0079] uint8 time; / / Task real-time
[0080] uint8 status; / / Task status
[0081] uint8 priority; / / Update priority
[0082] uint8 os_num; / / Corresponding to the system to be updated
[0083] struct ; / / Point to the task
[0084] struct k_slave_task_t ; / / Point to the previous task
[0085] struct k_slave_task_t ; / / Point to the next task
[0086] } k_slave_task_t;
[0087] The system update exception setting structure of the slave update system is set by the corresponding system to be updated, and the assisting update unit reads the content of the system update exception setting structure to handle the system abnormal update. The system update exception setting structure of the slave update system is as follows:
[0088] typedef struct k_slave_abnormal_s
[0089] {
[0090] uint64 time; / / Update abnormal response time
[0091] uint8 set; / / Update exception handling settings
[0092] uint8 os_num; / / Corresponding to the system to be updated
[0093] struct k_slave_abnormal_t ; / / Point to the next setting
[0094] } k_slave_abnormal_t;
[0095] The system to be updated and the slave update system can be operating systems such as Linux or RTOS (Real-time operating system), and can run in the isolated master system domain or slave system domain. At the same time, there is no limit to the number of systems to be updated, and they can correspond to one or more slave update systems, and the specific number is determined based on demand and hardware resources. The slave update system can be used by one or more systems to be updated, which is determined based on demand and hardware resources.
[0096] For example, when the system to be updated is a Linux system and the main maintenance operation function has non-real-time tasks (such as audio and video playback, recording, interface display, etc.) and real-time tasks (such as motor control, sensors, motion control, etc.), you can choose to start two slave update systems, providing a Linux slave update system to run non-real-time tasks and an RTOS slave update system to run real-time tasks. When the operating system is updated, the system to be updated smoothly transfers the non-real-time tasks of the main maintenance operation function to the Linux slave update system, and transfers the real-time tasks of the main maintenance operation function to the RTOS in real time. When the operating system update time is too long or abnormal, the slave update system ensures the normal use of the corresponding slave maintenance operation function during the operating system update. After the operating system update of the system to be updated is completed, the non-real-time tasks of the maintenance operation function of the corresponding Linux slave update system are smoothly transferred to the system to be updated; the real-time tasks of the maintenance operation function of the corresponding RTOS slave update system are transferred to the system to be updated in real time. At the same time, the maintenance operation functions with high real-time requirements and related to hardware resources can be directly run when the slave update system is started, and the relevant data is transmitted before the system is started. For those that require hardware isolation startup, the main maintenance operation function is handed over to the slave update system before hardware isolation, and the slave update system is started in real time to receive the corresponding main maintenance operation function.
[0097] In step S01 of this embodiment, when evaluating the slave update system, it includes:
[0098] S201. Determine whether there is a slave update system. If there is a slave update system, execute step S202. Otherwise, isolate the related hardware resources of the multi-core chip to create a new slave update system domain and run the new slave update system.
[0099] S202. Determine whether the slave update system in the slave update system domain is capable of running the main maintenance operation function of the system to be updated. If so, the slave update system is a qualified slave update system, and the system to be updated sends a main maintenance operation function data packet to the slave update system. The slave update system runs the corresponding slave maintenance operation function according to the received main maintenance operation function data packet. Otherwise, a new slave update system domain is created, and the slave update system capable of running the main maintenance operation function of the system to be updated is run as a qualified slave update system to run the slave maintenance operation function corresponding to the main maintenance operation function.
[0100] like Figure 4 As shown, in a specific application embodiment, after receiving the operating system update instruction, the update processing unit of the system to be updated obtains the operating system update image and verifies whether the operating system update image is legal. If the operating system update image is verified to be legal, the update processing unit inquires whether there is a slave update system and determines whether the slave system domain can run the main maintenance operation function of the system to be updated.
[0101] The step of judging whether the slave system domain can run the main maintenance operation function of the system to be updated includes: after receiving the query data from the update processing unit, the auxiliary update unit of the slave update system checks whether the slave update system can run the corresponding slave maintenance operation function according to the acquired data. When the corresponding slave maintenance operation function cannot be run, the corresponding data packet is replied and the connection is rejected. When the corresponding slave maintenance operation function can be run, the corresponding data packet is replied and the connection is established.
[0102] Furthermore, when there is a slave update system and the main maintenance operation function of the system to be updated is met, the update processing unit of the system to be updated sends the main maintenance operation function data packet and the related system data packet to the assisting update unit of the slave update system. After receiving the main maintenance operation function data packet and the related system data packet from the update processing unit, the assisting update unit of the slave update system parses the data, and prepares the corresponding slave maintenance operation function and processes the related system data according to the parsed data. It can run the corresponding slave maintenance operation function immediately after the preparation is completed, or it can wait for the maintenance operation function start command from the update processing unit before running the corresponding slave maintenance operation function.
[0103] When there is a slave update system but the slave update system cannot meet the main maintenance operation function of the system to be updated or there is no slave update system, the update processing unit of the system to be updated creates a slave update system domain and starts the slave update system of the system domain. After the slave update system is started normally, the update processing unit of the system to be updated sends the main maintenance operation function data packet and related system data packet to the assisting update unit of the slave update system. The assisting update unit of the slave update system prepares the corresponding slave maintenance operation function and processes the related system data according to the received data packet. At the same time, the update processing unit of the system to be updated sets the system update exception setting of the assisting update unit of the slave update system. After the update exception of the system to be updated occurs, the assisting update unit handles the update exception according to the setting.
[0104] Therefore, in step S02, setting the system update exception parameter specifically refers to setting the system update exception from the update system, including the following steps:
[0105] 1. The update processing unit of the system to be updated reads the content of the corresponding system update exception setting structure and composes a setting data packet to send to the auxiliary update unit of the slave update system.
[0106] 2. The assisting update unit obtains and parses the data packet sent by the update processing unit, and fills the data into the system update exception setting structure corresponding to the slave update system. The update exception processing setting includes the assisting update mode and the recovery system mode. The assisting update mode is that the system update exception of the system to be updated is led by the slave update system to update the system to be updated, and the recovery system mode is that when the system update exception of the system to be updated is restored by the slave update system to the state before the system update, other modes can be defined at the same time.
[0107] In step S03 of the present embodiment, when the system to be updated is updated successfully, the update processing unit of the system to be updated sends an update completion data packet to the assisting update unit of the slave update system, the assisting update unit packages the current slave maintenance operation function data and related system data packets and sends them to the update processing unit, the update processing unit receives the slave maintenance operation function data and restores the corresponding master maintenance operation function, and at the same time receives new related system data packets to update the related system data.
[0108] Specifically, after receiving the data packet indicating the successful update of the system to be updated, the assisting update unit of the slave update system starts to hand over the slave maintenance operation function of the slave update system, and the assisting update unit composes a data packet with data related to the slave maintenance operation function and sends it to the update processing unit; the update processing unit restores the main maintenance operation function based on the received data packet and assists the update unit in shutting down the corresponding slave maintenance operation function.
[0109] After the update of the "system to be updated" fails, the "slave update system" ensures that the functions that need to be operated from the maintenance are normal, and collects the update failure log. At the same time, according to the settings, it continues to try to update the "system to be updated" or restore the "system to be updated" and after restoration, it transfers the relevant slave maintenance operation functions, system resources and data to the "system to be updated". Therefore, in this embodiment, when the update of the system to be updated fails, the auxiliary update unit of the slave update system can continue to operate the slave maintenance operation function and restore the operation of the system to be updated; it can also assist in continuing to update the system to be updated.
[0110] Specifically, in step S03, the updating assisting unit of the updating system monitors whether the updating is normal according to the updating abnormality response time of the system updating abnormality setting, and determines that the updating of the system to be updated is abnormal when the updating abnormality response time is exceeded; the updating assisting unit determines whether to continue to try to update the system to be updated or restart the system to be updated and resume operation according to the abnormality setting of the system updating abnormality setting, and step S03 also includes the following steps:
[0111] 1. If the assisting update unit of the update system does not receive the update completion data packet sent by the update processing unit of the system to be updated within the specified time, it is considered that the update of the system to be updated is abnormal. When the update of the system to be updated is abnormal, the assisting update unit of the update system attempts to notify the update processing unit of the system to be updated of the update abnormality. If the update processing unit responds, the abnormality is ignored and the update abnormality response time is reset.
[0112] 2. When the assisting update unit of the update system fails to obtain a response from the update processing unit of the system to be updated, it is considered that the update of the system to be updated has failed. If the system update exception parameter is a parameter of the assisting update mode, that is, when the update exception processing in the system update exception setting structure corresponding to the update system is set to the assisting update mode, the assisting update unit leads the update of the system to be updated, starts to obtain the update image of the system to be updated and updates the system to be updated. After the update is completed, the current slave maintenance operation function data and related system data are returned to the update processing unit of the system to be updated, thereby handing over the slave maintenance operation tasks and related system data, and when no other system to be updated uses this slave update system, the slave update system is stopped from running and the related hardware resources of the slave update system domain are recovered to the system to be updated, thereby handing over the related hardware resources.
[0113] 3. When the assisting update unit of the update system fails to obtain a response from the update processing unit of the system to be updated, it is considered that the update of the system to be updated has failed. If the system update exception parameter is a parameter for restoring the system mode, that is, when the update exception processing setting in the system update exception setting structure corresponding to the update system is set to restore the system mode, the assisting update unit restarts the system to be updated to restore the operation of the system to be updated, and after the restart of the system to be updated is completed, the current maintenance operation function data and related system data are returned to the update processing unit of the system to be updated, thereby handing over the maintenance operation tasks and related system data, and when no other system to be updated uses this slave update system, the slave update system is stopped from running and the related hardware resources of the slave update system domain are recovered to the system to be updated, thereby handing over the related hardware resources.
[0114] This embodiment can flexibly select the system to be updated or the secondary update system to lead the operating system update function of the system to be updated, but after the operating system update is abnormal, the secondary update system will lead the update action. The secondary update system monitors the update status of the system to be updated, and collects update failure information when the update of the system to be updated fails; through settings, the previous operating status of the system to be updated can be restored, and it can also assist in continuing to update the update system.
[0115] In this embodiment, the systems running in each system domain communicate with each other through shared memory. In step S02, when the system to be updated sends the main maintenance operation function data to the slave update system, it includes: after the system to be updated writes the main maintenance operation function data packet into the shared memory, it triggers the interruption of the corresponding slave update system; in step S03, when the slave update system returns the current slave maintenance operation function data to the system to be updated, it includes: after the slave update system writes the slave maintenance operation function data packet into the shared memory, it triggers the interruption of the corresponding system to be updated.
[0116] Specifically, after writing the corresponding data packet consisting of the data related to the main maintenance operation function of the system to be updated into the shared memory, triggering the interruption of the slave update system to ensure the real-time performance of the corresponding main maintenance operation function to the slave maintenance operation function;
[0117] After the corresponding data packet consisting of the relevant data of the slave maintenance operation function of the update system is written into the shared memory, an interruption of the system to be updated will be triggered to ensure the real-time performance of the corresponding slave maintenance operation function to the main maintenance operation function.
[0118] This embodiment also provides a system update device based on multi-system isolation, including:
[0119] A multi-system isolation module is used to isolate the hardware resources of the multi-core chip into different system domains. The different system domains include a system domain to be updated and a secondary update system domain. The system to be updated runs in the system domain to be updated, and the secondary update system runs in the secondary update system domain.
[0120] The system to be updated is used to obtain the update instruction and verify it. After the verification is passed, the slave update system is evaluated and maintained and managed. Then, the main maintenance operation function data is sent to the slave update system that meets the conditions. Finally, the update operation is performed. If the update is successful, the slave maintenance operation function data of the slave update system is obtained and the corresponding main maintenance operation function is restored according to the current slave maintenance operation function data.
[0121] The slave update system is used to run the corresponding slave maintenance operation function according to the main maintenance operation function data of the system to be updated. It is also used to return the current slave maintenance operation function data to the system to be updated after the system to be updated is successfully updated. It is also used to restore the system to be updated according to the settings or continue the update operation of the system to be updated after the update of the system to be updated fails.
[0122] In summary, the present invention proposes a system update method and device based on multi-system isolation, which has the following advantages:
[0123] 1. Provide a new system update method, which isolates two system domains through hardware isolation (not software isolation), and the resources of the two system domains are invisible. Before the system update, query or create a "slave update system" and obtain the relevant system resources and data of the "system to be updated". After the system update starts, the "slave update system" maintains the main maintenance and operation functions (such as desktop display, database operation, motor control, sensors, etc.) that need to be run by the "system to be updated" in real time. Ensure the normal use of the main maintenance and operation functions that need to be run during the system update and restart phase. At the same time, after the update of the "system to be updated" is completed, the "slave update system" hands over the relevant system resources and data to the "system to be updated", ensuring that the main maintenance and operation functions that need to be run after the update of the "system to be updated" are still running normally. That is, the system update will not affect the use of the main maintenance and operation functions, and the relevant data will not be lost. Due to the independence of the "slave update system", after the system is powered off, the relevant data is still safe when it is powered on again, and the update action can still be restored and continued, ensuring the safety of power-off updates. At the same time, peripherals (mouse, keyboard, USB flash drive, etc.) will not affect the system update.
[0124] 2. You can choose to use the "slave update system" to lead the update of the "system to be updated", that is, the isolated "slave update system" updates the "system to be updated". The "slave update system" has relevant system resources and data and ensures the normal operation of the slave maintenance and operation functions. The "slave update system" reads the system image data and updates the "system to be updated" such as the network, USB disk and other system image storage devices isolated to the "slave update system". After the update is completed, the relevant slave maintenance and operation functions, system resources and data are handed over to the "system to be updated". Increased update flexibility and security.
[0125] 3. After the update of the "system to be updated" fails, the "updated system" ensures the normal operation of the slave maintenance functions that need to be activated, and collects the update failure log. At the same time, according to the settings, continue to try to update the "system to be updated" or restore the "system to be updated" and hand over the relevant slave maintenance operation functions, system resources and data to the "system to be updated" after recovery. That is, the update failure does not affect the operation of the system, ensuring the security of relevant data.
[0126] 4. During the update process, the relevant data is handed over from the "system to be updated" to the "updated secondary system" to ensure data security. At the same time, the "updated secondary system" verifies the security of the "system to be updated" to ensure that the updated system is not tampered with. After the update of the "system to be updated" is completed, the relevant settings can be restored to the state before the update through the "updated secondary system" to ensure the uniqueness, privacy, and confidentiality of the settings (thousands of nodes have different settings).
[0127] 5. At the same time, since the "slave update system" of the isolation system can be flexibly an operating system such as Linux, RTOS, etc., it can be multiple "slave update systems". Through shared memory and interrupt real-time communication, the stability, feasibility and reliability of the functions that need to be maintained are guaranteed.
[0128] The above is only a preferred embodiment of the present invention, and does not limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment, it is not intended to limit the present invention. Therefore, any simple modification, equivalent change and modification made to the above embodiment according to the technical essence of the present invention without departing from the content of the technical solution of the present invention shall fall within the scope of protection of the technical solution of the present invention.
Claims
1. A system update method based on multi-system isolation, It is characterized in that Applied to a multi-core chip, the hardware resources of the multi-core chip are isolated into a system domain to be updated and a secondary update system domain by hardware isolation, the systems running in each system domain communicate with each other through shared memory, the system to be updated is run in the system domain to be updated, and the secondary update system is run in the secondary update system domain, the system to be updated corresponds to one or more secondary update systems, and the secondary update system corresponds to one or more systems to be updated, and the method comprises the following steps: S01. Issue an update command to the system to be updated, the system to be updated obtains the update command and verifies it, and after verification, the update system is evaluated, and the system to be updated maintains and manages the update system; S02. The system to be updated sends the main maintenance operation function data to the update system that meets the conditions. Specifically, the system to be updated writes the main maintenance operation function data packet to the shared memory, triggering the corresponding interrupt from the update system, the update system from the update system according to the main maintenance operation function data to run the corresponding slave maintenance operation function, and set the system update exception parameters, the main maintenance operation function is to be updated in the system to be updated to update the operating system during the process of running the task to be run; S03. The system to be updated performs an update operation. If the update is successful, the slave update system returns the current slave maintenance operation function data to the system to be updated. Specifically, after the slave update system writes the slave maintenance operation function data packet into the shared memory, it triggers an interruption of the corresponding system to be updated. The system to be updated restores the corresponding main maintenance operation function according to the current slave maintenance operation function data. The slave maintenance operation function is a task that corresponds one-to-one to the main maintenance operation function of the system to be updated. If the slave update system has no other slave maintenance operation functions, the slave update system is stopped and the hardware resources related to the slave update system domain are recovered to the system to be updated.
2. The system update method based on multi-system isolation according to claim 1, It is characterized in that In step S01, when evaluating the slave update system, it includes: S201. Determine whether there is a slave update system. If there is a slave update system, execute step S202. Otherwise, isolate the related hardware resources of the multi-core chip to create a new slave update system domain and run the new slave update system. S202. Determine whether the slave update system in the slave update system domain is capable of running the main maintenance operation function of the system to be updated; if so, use the slave update system as a slave update system that meets the conditions; otherwise, create a new slave update system domain, run the slave update system that is capable of running the main maintenance operation function of the system to be updated and use it as a slave update system that meets the conditions to run the slave maintenance operation function corresponding to the main maintenance operation function.
3. The system updating method based on multi-system isolation according to claim 1, It is characterized in that Step S03 also includes: if the update fails and the system update abnormal parameters are parameters for restoring the system mode, the slave update system continues to run the slave maintenance operation function and restarts the system to be updated to restore the operation of the system to be updated, the slave update system returns the current slave maintenance operation function data to the system to be updated, and the system to be updated restores the corresponding main maintenance operation function according to the current slave maintenance operation function data; after the system to be updated resumes normal operation, the slave update system is stopped and the hardware resources related to the slave update system domain are recovered to the system to be updated.
4. The system updating method based on multi-system isolation according to claim 1, It is characterized in that Step S03 also includes: if the update fails and the system update abnormality parameter is a parameter of the assisted update mode, the slave update system continues to try to update the system to be updated according to the settings, including: the slave update system obtains the update image of the system to be updated and updates the system to be updated, and continues to run the slave maintenance operation function. After the update of the system to be updated is completed, the slave update system returns the current slave maintenance operation function data to the system to be updated, and the system to be updated restores the corresponding main maintenance operation function according to the current maintenance operation function data, stops the operation of the slave update system and reclaims the slave update system domain-related hardware resources to the system to be updated.
5. The system updating method based on multi-system isolation according to claim 1, It is characterized in that In step S02, when setting the system update abnormal parameters, it specifically includes: The system to be updated reads the content of the corresponding system update exception setting structure and composes a setting data packet to send to the slave update system; The data packet is obtained and parsed from the update system, and the data of the data packet is filled into the system update exception setting structure corresponding to the update system.
6. The system updating method based on multi-system isolation according to claim 1, It is characterized in that Step S03 also includes: when the update of the system to be updated is abnormal, the slave update system notifies the system to be updated to handle the update exception. If a response from the system to be updated is received, the exception is ignored and the update exception response time is reset. If the response of the system to be updated times out, the update exception is handled according to the system update exception setting structure content corresponding to the slave update system.
7. The system updating method based on multi-system isolation according to claim 1, It is characterized in that When the system to be updated corresponds to multiple slave update systems, the non-real-time tasks and real-time tasks of the system to be updated correspond to different slave update systems respectively.
8. The system updating method based on multi-system isolation according to claim 1, It is characterized in that The master maintenance operation function and the slave maintenance operation function both maintain and manage corresponding tasks through a maintenance task linked list, and the stop and hardware resource recovery of the slave update system are maintained by the maintenance task linked list of the corresponding slave update system.
9. A system update device based on multi-system isolation, It is characterized in that include: A multi-system isolation module is used to isolate the hardware resources of the multi-core chip into a system domain to be updated and a secondary update system domain by hardware isolation, and to run the system to be updated in the system domain to be updated and the secondary update system in the secondary update system domain, wherein the system to be updated corresponds to one or more secondary update systems, and the secondary update system corresponds to one or more systems to be updated; The system to be updated is used to obtain and verify the update instruction. After the verification is passed, the slave update system is evaluated and maintained and managed. Then, the main maintenance operation function data is sent to the slave update system that meets the conditions. Specifically, after the main maintenance operation function data packet is written into the shared memory, the interruption of the corresponding slave update system is triggered. The main maintenance operation function is a task that needs to be run during the process of updating the operating system of the system to be updated. Finally, the update operation is performed. If the update is successful, the slave maintenance operation function data of the slave update system is obtained and the corresponding main maintenance operation function is restored according to the current slave maintenance operation function data. The slave maintenance operation function is a task that corresponds one-to-one to the main maintenance operation function of the system to be updated. If the slave update system has no other slave maintenance operation functions, the slave update system is stopped and the hardware resources related to the slave update system domain are recovered to the system to be updated; The slave update system is used to run the corresponding slave maintenance operation function according to the main maintenance operation function data of the system to be updated, and set the system update exception parameters. After the system to be updated is successfully updated, the current slave maintenance operation function data is returned to the system to be updated. Specifically, the slave update system writes the slave maintenance operation function data packet to the shared memory, triggering the interruption of the corresponding system to be updated. It is also used to restore the system to be updated or continue the update operation of the system to be updated according to the set system update exception parameters after the update of the system to be updated fails.
