Starting security detection method and device for embedded system, medium and program product
By obtaining the operation data of the startup stage of the embedded system and comparing the hash value, and generating abnormal startup prompt information, the problem of poor accuracy of startup security detection of embedded system is solved, and the accuracy and security of detection are improved.
Patent Information
- Application Number
- CN202411877948.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-04-22
AI Technical Summary
The startup safety detection accuracy of embedded systems is poor, and it is difficult to detect abnormalities or tampering in time during startup, resulting in grid scheduling errors and the security and reliability of the power system being threatened.
By obtaining the phase operation data of multiple startup stages of the embedded system during the startup process, including the first hash value of the expected execution operation and the second hash value of the actual execution operation, an exception startup prompt information is generated and displayed, ensuring the accuracy of startup security detection and the security of the data.
It improves the accuracy of security detection of embedded system startup, can promptly identify abnormal situations during startup, and reduces the losses caused by abnormal startup.
Smart Images

Figure CN119862564A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer application technology, and in particular to a startup security detection method, device, medium and program product for an embedded system. Background Art
[0002] With the rapid development of smart grids and digital power systems, embedded systems have become a core component for the power industry to achieve efficient, stable and safe operation. Since power grid embedded systems are generally deployed in highly decentralized environments, especially in important locations such as substations, distribution networks, and power plants, the security of the system during startup and operation is particularly important.
[0003] At present, the startup safety of embedded systems is usually judged by whether the system successfully starts within a preset time or whether it can run normally, which makes the accuracy of safety detection during the system startup process poor. Once an abnormality occurs or tampering occurs during the startup of the power grid embedded system without being detected, it will lead to grid dispatch errors and even pose a serious threat to the safety and reliability of the power system. Summary of the invention
[0004] The present invention provides a startup safety detection method, equipment, medium and program product for an embedded system, so as to solve the problem of poor accuracy in safety detection of the startup process of the embedded system.
[0005] According to one aspect of the present invention, a startup security detection method for an embedded system is provided, the method comprising:
[0006] Acquire phase operation data of multiple startup phases in the startup process of the embedded system; wherein the multiple startup phases include at least two of a hardware initialization phase, a boot loader execution phase, an operating system loading phase, and an application startup phase; the phase operation data includes a first hash value of an expected execution operation in the startup phase and a second hash value of an actual execution operation;
[0007] In the case that the first hash value and the second hash value corresponding to at least one startup phase are inconsistent, abnormal startup prompt information corresponding to the embedded system is generated and displayed.
[0008] According to another aspect of the present invention, there is provided an electronic device, the electronic device comprising:
[0009] at least one processor; and
[0010] a memory communicatively connected to at least one processor; wherein,
[0011] The memory stores a computer program that can be executed by at least one processor. The computer program is executed by at least one processor so that the at least one processor can execute the startup security detection method for an embedded system according to any embodiment of the present invention.
[0012] According to another aspect of the present invention, a computer-readable storage medium is provided, which stores computer instructions, and the computer instructions are used to enable a processor to implement the startup security detection method for an embedded system of any embodiment of the present invention when executed.
[0013] According to another aspect of the present invention, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements a startup security detection method for an embedded system according to any embodiment of the present invention.
[0014] The technical solution of the embodiment of the present invention obtains the stage operation data of multiple startup stages in the startup process of the embedded system; wherein the multiple startup stages include at least two of the hardware initialization stage, the boot loader execution stage, the operating system loading stage and the application startup stage; the stage operation data includes a first hash value of the expected execution operation in the startup stage and a second hash value of the actual execution operation, so that the startup security of the embedded system can be subsequently detected according to the hash value, while ensuring the security and accuracy of the stage operation data and preventing the stage operation data from being tampered with; when there is inconsistency between the first hash value and the second hash value corresponding to at least one startup stage, abnormal startup prompt information corresponding to the embedded system is generated, and the abnormal startup prompt information is displayed, so that it is determined whether the actual execution operation has an abnormal situation based on the expected execution operation of each startup stage in the startup process of the embedded system, thereby improving the accuracy of the startup security detection, and generating prompt information when there is an abnormality in the startup process, thereby reducing the related losses caused by the abnormal startup of the embedded system.
[0015] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0017] Figure 1A flowchart of a startup security detection method for an embedded system provided in Embodiment 1 of the present invention;
[0018] Figure 2 A flowchart of a startup security detection method for an embedded system provided in Embodiment 2 of the present invention;
[0019] Figure 3 A structural diagram of a startup safety detection device for an embedded system provided in Embodiment 3 of the present invention;
[0020] Figure 4 A schematic diagram of the structure of an electronic device for implementing a startup security detection method for an embedded system provided in a fourth embodiment of the present invention. DETAILED DESCRIPTION
[0021] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings 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 should fall within the scope of protection of the present invention.
[0022] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0023] It should be noted that the modifications of "one" and "plurality" mentioned in the present invention are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0024] The names of the messages or information exchanged between multiple devices in the embodiments of the present invention are only used for illustrative purposes, and are not used to limit the scope of these messages or information.
[0025] It is understandable that before using the technical solutions disclosed in the embodiments of the present invention, the type, scope of use, usage scenarios, etc. of the personal information involved in the present invention should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0026] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present invention according to the prompt message.
[0027] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0028] It is understandable that the above notification and user authorization process is only illustrative and does not constitute a limitation on the implementation of the present invention. Other methods that meet relevant laws and regulations may also be applied to the implementation of the present invention.
[0029] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.
[0030] Embodiment 1
[0031] Figure 1 A flowchart of a startup safety detection method for an embedded system provided in Embodiment 1 of the present invention. This embodiment can be applied to check whether there is an abnormality in the startup process of the embedded system, and optionally, it is implemented by an electronic device implementing the startup safety detection method for the embedded system, which can be a mobile terminal, a PC or a server, etc.
[0032] like Figure 1 As shown, the method may specifically include:
[0033] S101. Acquire stage operation data of multiple startup stages in a startup process of an embedded system; wherein the multiple startup stages include at least two of a hardware initialization stage, a boot loader execution stage, an operating system loading stage, and an application startup stage; and the stage operation data include a first hash value of an expected execution operation in the startup stage and a second hash value of an actual execution operation.
[0034] In the embodiments of the present invention, an embedded system may refer to a dedicated computer system embedded in a device for controlling the device, which usually has specific functions and performance requirements. Exemplarily, an embedded system may be a system in a device in an important location such as a substation, a distribution network or a power plant of a power grid. An embedded system may be composed of a hardware part and a software part, wherein the hardware part may include a processor, a memory, etc., and the software part may include an operating system, a driver, and an application program, etc.
[0035] In the startup process of the embedded system, the process of ensuring that the hardware part of the embedded system is correctly configured can be regarded as the hardware initialization stage; the execution of the program that loads the operating system or application into the embedded system memory can be regarded as the boot loader execution stage; the process of loading the operating system into the embedded system memory can be regarded as the operating system loading stage; the process of starting the application can be regarded as the application startup stage. Accordingly, each startup stage of the embedded system in the startup process will have corresponding specific execution operations to ensure the normal operation of each startup stage, thereby ensuring that the embedded system can be safely started and run.
[0036] Specifically, the embedded system will go through multiple startup stages during the startup process, and the hash value corresponding to the stage execution operation can be obtained by encrypting the stage execution operation of each startup stage. For example, the data corresponding to the stage execution operation can be input into the hash function to obtain the hash value of the execution operation. Accordingly, the operations expected to be performed in each startup stage (theoretically required to be performed) are encrypted to obtain the first hash value of each startup stage, and the operations actually performed in each startup stage are encrypted to obtain the second hash value of each startup stage. Furthermore, the first hash value and the second hash value of each startup stage during the startup process of the embedded system can be used as the stage operation data of multiple startup stages.
[0037] As an optional implementation of an embodiment of the present invention, before obtaining the stage startup data of multiple startup stages in the startup process of the embedded system, it also includes: in each startup stage in the startup process of the embedded system, obtaining the expected execution operation corresponding to the startup stage, determining a first hash value of the expected execution operation, and storing the first hash value; and obtaining the actual execution operation corresponding to the startup stage, determining a second hash value of the actual execution operation, and storing the second hash value.
[0038] As an optional implementation of an embodiment of the present invention, before obtaining the stage startup data of multiple startup stages in the startup process of the embedded system, it also includes: in each startup stage in the startup process of the embedded system, obtaining the stage start time corresponding to the startup stage, digitally signing the stage start time to obtain the first signature data, and storing the stage start time and the first signature data; and obtaining the stage end time corresponding to the startup stage, digitally signing the stage end time to obtain the second signature data, and storing the stage end time and the second signature data. The integrity of the data can be verified by digital signature, which can avoid data tampering, thereby improving the accuracy of security detection of the startup process of the embedded system.
[0039] Specifically, during the startup process of the embedded system, the start time and end time of each startup stage can be recorded, and the start time of each startup stage can be digitally signed to obtain the first signature data of each startup stage, and the end time of each startup stage can be digitally signed to obtain the second signature data of each startup stage.
[0040] Exemplarily, the secure time source interface can be called at each startup stage during the startup process of the embedded system to obtain the stage start time and stage end time of each startup stage, and record and generate corresponding timestamps, wherein the secure time source interface can be understood as a data interface that has passed security verification and can provide system time that meets the preset time accuracy.
[0041] In order to improve the detection accuracy of startup security, in each startup phase of the embedded system's startup process, the phase start time and expected execution operation corresponding to the startup phase can be obtained, the phase start time can be digitally signed to obtain the first signature data, the first hash value of the expected execution operation can be determined, and the phase start time, the first signature data and the first hash value can be stored; and the phase end time and the actual execution operation corresponding to the startup phase can be obtained, the phase end time can be digitally signed to obtain the second signature data, the second hash value of the actual execution operation can be determined, and the phase end time, the second hash value and the second signature data can be stored. This technical solution supports the detection of startup security in combination with the phase startup duration and the phase operation data, and improves the accuracy of the startup security detection results.
[0042] Optionally, the start time of each startup phase is encrypted together with the first hash value of the expected execution operation to obtain the first time hash value of each startup phase, and the end time of each startup phase is encrypted together with the second hash value of the actual execution operation to obtain the second time hash value of each startup phase. Furthermore, the first time hash value and the second time hash value of each startup phase are stored to further improve the security and tamper resistance of the data.
[0043] S102: When there is inconsistency between the first hash value and the second hash value corresponding to at least one startup phase, generate abnormal startup prompt information corresponding to the embedded system, and display the abnormal startup prompt information.
[0044] Specifically, the first hash value and the second hash value of each startup stage in the startup process of the embedded system can be compared in turn, and the startup stage when the first hash value and the second hash value are inconsistent can be recorded. The inconsistency between the first hash value and the second hash value indicates that the actual execution operation in the startup stage is inconsistent with the expected execution operation, and the startup stage is abnormal or tampered. Furthermore, if there is at least one startup stage in which the first hash value and the second hash value are inconsistent in the comparison results of the first hash value and the second hash value of multiple startup stages, it is considered that there is an abnormality in the startup process of the embedded system, and abnormal startup prompt information of the embedded system is generated.
[0045] Exemplarily, the abnormal startup prompt information may be information for prompting abnormal startup of the embedded system. The abnormal startup prompt information may be prompt information in at least one form such as text, graphics, and audio. Optionally, the abnormal startup prompt information may be displayed by playing it through a prompt display device, and / or the abnormal startup prompt information may be sent to a target prompt device, etc. By displaying the abnormal startup prompt information, relevant personnel are reminded to perform a safety check on the startup process of the embedded system again, so as to avoid related losses caused by abnormal startup of the embedded system.
[0046] The technical solution of the embodiment of the present invention obtains the stage operation data of multiple startup stages in the startup process of the embedded system; wherein the multiple startup stages include at least two of the hardware initialization stage, the boot loader execution stage, the operating system loading stage and the application startup stage; the stage operation data includes a first hash value of the expected execution operation in the startup stage and a second hash value of the actual execution operation, so that the startup security of the embedded system can be subsequently detected according to the hash value, while ensuring the security and accuracy of the stage operation data and preventing the stage operation data from being tampered with; when there is inconsistency between the first hash value and the second hash value corresponding to at least one startup stage, abnormal startup prompt information corresponding to the embedded system is generated, and the abnormal startup prompt information is displayed, so that it is determined whether the actual execution operation has an abnormal situation based on the expected execution operation of each startup stage in the startup process of the embedded system, thereby improving the accuracy of the startup security detection, and generating prompt information when there is an abnormality in the startup process, thereby reducing the related losses caused by the abnormal startup of the embedded system.
[0047] Embodiment 2
[0048] Figure 2 A flowchart of a startup security detection method for an embedded system provided in Embodiment 2 of the present invention. The technical solution of this embodiment further expands the process after obtaining the stage operation data of multiple startup stages of the embedded system during the startup process in the above embodiment on the basis of the technical solution of the above embodiment. For specific implementation methods, please refer to the description of this embodiment. Among them, the technical features that are the same or similar to the above embodiments are not repeated here.
[0049] like Figure 2 As shown, the method may specifically include:
[0050] S201. Acquire stage operation data of multiple startup stages in a startup process of an embedded system; wherein the multiple startup stages include at least two of a hardware initialization stage, a boot loader execution stage, an operating system loading stage, and an application startup stage; and the stage operation data include a first hash value of an expected execution operation in the startup stage and a second hash value of an actual execution operation.
[0051] S202. When the first hash value and the second hash value corresponding to each startup stage are consistent, obtain the stage time data of multiple startup stages; wherein the stage time data includes the stage start time, the first signature data of the stage start time, the stage end time and the second signature data of the stage end time.
[0052] Specifically, if it is detected that the first hash value and the second hash value of each startup stage in the startup process of the embedded system are consistent, the stage start time, the first signature data of the stage start time, the stage end time and the second signature data of the stage end time of each startup stage recorded in real time by the embedded system during the startup process are obtained as the stage time data of each startup stage. Exemplarily, the corresponding data can also be obtained from a secure storage device storing the stage start time, the first signature data, the stage end time and the second signature data of each startup stage to form the stage time data of each startup stage.
[0053] S203. For each startup phase, the phase start time is securely verified using the first signature data, and the phase end time is securely verified using the second signature data. When both the phase start time and the phase end time corresponding to the startup phase pass the security verification, the phase startup duration of the startup phase is determined based on the phase start time and the phase end time.
[0054] Specifically, the first signature data of the startup phase is used to perform security verification on the phase start time of the startup phase, and the second signature data of the startup phase is used to perform security verification on the phase end time of the startup phase, so as to ensure the accuracy of the phase start time and phase end time of the startup phase, and avoid time tampering that affects the detection results. Furthermore, when both the phase start time and the phase end time of the startup phase pass the security verification, the time difference between the phase end time and the phase start time of the startup phase can be used as the phase startup duration of the startup phase. By analogy, the phase startup duration of each startup phase can be obtained by executing the above process for each startup phase.
[0055] Exemplarily, the stage startup duration of each startup stage can be calculated by the following formula:
[0056] ΔT stage =T end -T start ,
[0057] Among them, T end The actual timestamp representing the end time of the startup phase, T start The actual timestamp representing the phase start time for the launch phase.
[0058] S204, determining a startup safety detection result of the embedded system according to the startup duration of the startup phase and the startup time window of the startup phase, and when the startup safety detection result is determined to be an abnormal startup state, generating abnormal startup prompt information corresponding to the embedded system, and displaying the abnormal startup prompt information.
[0059] In an embodiment of the present invention, the startup time window may refer to the normal startup time expected in the startup phase, and is used to determine whether a startup abnormality occurs in the startup phase. Exemplarily, when the difference between the startup duration of the startup phase and the startup time window meets the preset time difference, it can be considered that no startup abnormality occurs in the startup phase, otherwise, it is considered that a startup abnormality occurs in the startup phase. The startup safety detection result may refer to the result indicating whether a startup abnormality occurs during the startup process of the embedded system.
[0060] Specifically, for each startup stage during the startup process of the embedded system, the startup duration of each startup stage is compared with the corresponding startup time window. Then, according to the comparison result of the startup duration of each startup stage and the startup time window, it is determined whether the embedded system has a startup abnormality during the startup process, and a startup safety detection result of the embedded system is generated. When the startup safety detection result of the embedded system indicates that the embedded system has a startup abnormality during the startup process, abnormal startup prompt information of the embedded system is generated.
[0061] Optionally, when the comparison result of the stage startup duration of each startup stage and the startup time window shows that the number of startup stages whose stage startup duration exceeds the startup time window is greater than a preset startup stage number threshold, it can be considered that there is a startup abnormality in the startup process of the embedded system.
[0062] As an optional implementation of an embodiment of the present invention, before determining the startup safety detection result of the embedded system based on the stage startup duration of the startup phase and the startup time window of the startup phase, it also includes: obtaining multiple historical startup records of the embedded system in a normal startup state, and obtaining multiple normal startup times of each startup phase from the multiple historical startup records; for each startup phase, determining the mean and standard deviation of the multiple normal startup times of the startup phase, and determining the startup time window of the startup phase based on the mean and standard deviation.
[0063] Specifically, when the embedded system is considered to be started normally, the startup duration in the normal state can be recorded, and after multiple records, it can be used as multiple historical startup records of the embedded system in the normal startup state. Furthermore, by analyzing the event characteristics of each startup stage during the startup process of the embedded system, multiple normal startup times of each startup stage can be determined from multiple historical startup records. According to the multiple normal startup times of each startup stage, the mean and variance of the normal startup time of each startup stage can be calculated, and the startup time window of each startup stage can be obtained by dynamically adjusting according to the mean and variance of the normal startup time of each startup stage.
[0064] As an optional implementation of the embodiment of the present invention, the startup time window of the startup phase is determined according to the mean and the standard deviation by the following formula:
[0065] ΔT window =μ stage +k·σ stage ,
[0066] Where, ΔT window represents the startup time window of the startup phase, μ stage Represents the mean of multiple normal startup times during the startup phase; σ stage represents the standard deviation of multiple normal startup times during the startup phase; k represents the window adjustment coefficient.
[0067] Specifically, the window adjustment coefficient k and the standard deviation σ of multiple normal startup times can be used. stage The average μ of multiple normal startup times stage Make dynamic adjustments to determine the startup time window ΔT during the startup phase window .
[0068] As an optional implementation of an embodiment of the present invention, a startup safety detection result of an embedded system is determined based on the stage startup duration of the startup phase and the startup time window of the startup phase, including: when the stage startup duration of at least one startup phase exceeds the startup time window of the startup phase, the startup safety detection result of the embedded system is determined as an abnormal startup state.
[0069] Specifically, if the comparison result of the stage startup duration of each startup stage and the startup time window shows that at least one startup stage has a stage startup duration that exceeds the startup time window of the startup stage, that is, ΔT stage >ΔT window , it can be considered that there is a startup anomaly in the embedded system during the startup process, and the startup safety detection result of the embedded system is determined as an abnormal startup state.
[0070] As an optional implementation manner of an embodiment of the present invention, a startup safety detection result of an embedded system is determined based on the stage startup duration of the startup phase and the startup time window of the startup phase, including: respectively determining the stage time deviation of the stage startup duration of each startup phase and the startup time window of the startup phase; weighting the stage time deviation corresponding to the startup phase according to the stage weight corresponding to each startup phase, and summing the weighted multiple stage time deviations to obtain a total time deviation; when the total time deviation is greater than or equal to a preset deviation threshold, determining the startup safety detection result of the embedded system as an abnormal startup state.
[0071] Specifically, according to the stage startup duration and the startup time window of each startup stage, the stage time deviation ΔT of the stage startup duration and the startup time window of each startup stage can be calculated. dev ,Right now
[0072] ΔT dev =ΔT stage -ΔT window ,
[0073] Furthermore, the stage weight w of each startup stage is introduced stage Phase time deviation ΔT for each startup phase dev Perform weighted calculation to obtain the weighted time deviation ΔT of each startup phase weighted =w stage *ΔT dev The total time deviation can be obtained by summing up the weighted time deviations of each startup phase. Among them, N represents the actual total number of startup stages during the startup process of the embedded system. represents the weighted time deviation of the i-th startup phase. If the total time deviation is greater than or equal to the preset deviation threshold T threshold , that is, ΔT total ≥T threshold , it can be considered that there is a startup anomaly in the embedded system during the startup process, and the startup safety detection result of the embedded system is determined as an abnormal startup state.
[0074] As an optional implementation of an embodiment of the present invention, determining the stage weight corresponding to each startup stage includes: determining an initial weighting factor for each startup stage based on the impact of each startup stage on the security of the embedded system; obtaining multiple historical stage time deviation data for each startup stage, and calculating the standard deviation of the multiple historical stage time deviation data; adjusting the initial weighting factor based on the standard deviation of the multiple historical stage time deviation data for each startup stage and the startup time window to determine the stage weight for each startup stage.
[0075] Specifically, the initial weighting factor w in each startup phase is init Different, for example, the hardware initialization phase is The bootloader execution phase is The operating system loading phase is and the application startup phase is In order to improve the accuracy of the weighting factor, the influence of the phase time deviation of each startup phase on the stability of the embedded system is determined according to the historical phase time deviation data of each startup phase, and the standard deviation σ of multiple historical phase time deviation data of each startup phase is calculated. dev Then, the initial weighting factor is adjusted by the standard deviation of multiple historical stage time deviation data of each startup stage and the startup time window to obtain the stage weight of each startup stage, that is, In order to better meet the actual needs of each startup stage.
[0076] S205: When the first hash value and the second hash value corresponding to at least one startup phase are inconsistent, generate abnormal startup prompt information corresponding to the embedded system, and display the abnormal startup prompt information.
[0077] The technical solution of the embodiment of the present invention is to obtain the stage operation data of multiple startup stages in the startup process of the embedded system; wherein the multiple startup stages include at least two of the hardware initialization stage, the boot loader execution stage, the operating system loading stage and the application startup stage; the stage operation data includes a first hash value of the expected execution operation in the startup stage and a second hash value of the actual execution operation, so that the startup security of the embedded system can be subsequently detected according to the hash value, while ensuring the security and accuracy of the stage operation data and preventing the stage operation data from being tampered with; when the first hash value and the second hash value corresponding to each startup stage are consistent, the stage time data of multiple startup stages are obtained; wherein the stage time data includes the stage start time, the first signature data of the stage start time, the stage end time and the second signature data of the stage end time, so that the integrity of the time data is guaranteed by using a digital signature; for each startup stage, the stage start time is securely verified by the first signature data, and the stage end time is securely verified by the second signature data, and when the stage start time and the stage end time corresponding to the startup stage pass the security verification, according to The stage start time and the stage end time determine the stage start time of the startup stage; the startup safety detection result of the embedded system is determined according to the stage start time of the startup stage and the startup time window of the startup stage, and when the startup safety detection result is determined to be an abnormal startup state, abnormal startup prompt information corresponding to the embedded system is generated, and the abnormal startup prompt information is displayed, so that when the actual execution operation of each startup stage is consistent with the expected execution operation, the startup safety of each startup stage is further detected according to the stage start time of each startup stage and the startup time window, so as to identify abnormal behaviors in each startup stage, avoid misjudgment of startup safety, and further improve the accuracy and reliability of startup safety detection; when there is a first hash value and a second hash value corresponding to at least one startup stage being inconsistent, abnormal startup prompt information corresponding to the embedded system is generated, and the abnormal startup prompt information is displayed, so that it is determined whether the actual execution operation is abnormal based on the expected execution operation of each startup stage in the startup process of the embedded system, the accuracy of startup safety detection is improved, and prompt information is generated when there is an abnormality in the startup process, so as to reduce the related losses caused by the abnormal startup of the embedded system.
[0078] Embodiment 3
[0079] Figure 3This is a schematic diagram of the structure of a startup safety detection device for an embedded system provided by Embodiment 3 of the present invention. This embodiment can be used to detect whether there is an abnormality in the startup process of the embedded system, and the device can be implemented in the form of hardware and / or software. Figure 3 As shown, the startup safety detection device for embedded systems may specifically include: a stage operation data acquisition module 301 and an abnormal startup prompt information generation module 302. The stage operation data acquisition module 301 is used to acquire the stage operation data of multiple startup stages in the startup process of the embedded system; wherein the multiple startup stages include at least two of the hardware initialization stage, the boot loader execution stage, the operating system loading stage and the application startup stage; the stage operation data includes the first hash value of the expected execution operation and the second hash value of the actual execution operation in the startup stage; the abnormal startup prompt information generation module 302 is used to generate abnormal startup prompt information corresponding to the embedded system when there is an inconsistency between the first hash value and the second hash value corresponding to at least one startup stage, and display the abnormal startup prompt information.
[0080] The technical solution of the embodiment of the present invention is to obtain the stage operation data of multiple startup stages of the embedded system in the startup process through the stage operation data acquisition module 301; wherein the multiple startup stages include at least two of the hardware initialization stage, the boot loader execution stage, the operating system loading stage and the application startup stage; the stage operation data includes a first hash value of the expected execution operation in the startup stage and a second hash value of the actual execution operation, so that the startup security of the embedded system can be subsequently detected according to the hash value, while ensuring the security and accuracy of the stage operation data, and preventing the stage operation data from being tampered with; through the abnormal startup prompt information generation module 302, when there is inconsistency between the first hash value and the second hash value corresponding to at least one startup stage, abnormal startup prompt information corresponding to the embedded system is generated, and the abnormal startup prompt information is displayed, so that it is determined whether the actual execution operation is abnormal based on the expected execution operation of each startup stage in the startup process of the embedded system, thereby improving the accuracy of the startup security detection, and generating prompt information when there is an abnormality in the startup process, thereby reducing the related losses caused by the abnormal startup of the embedded system.
[0081] On the basis of any of the above optional technical solutions, the startup safety detection device for the embedded system optionally further includes: a phase time data acquisition module and a phase startup duration determination module. Wherein, the phase time data acquisition module is used to obtain the phase time data of multiple startup phases in the startup process of the embedded system after the phase operation data of multiple startup phases are obtained, when the first hash value and the second hash value corresponding to each startup phase are consistent; wherein the phase time data includes the phase start time, the first signature data of the phase start time, the phase end time and the second signature data of the phase end time; the phase startup duration determination module is used to perform security verification on the phase start time through the first signature data for each startup phase, and to perform security verification on the phase end time through the second signature data, and when the phase start time and the phase end time corresponding to the startup phase pass the security verification, determine the phase startup duration of the startup phase according to the phase start time and the phase end time; the abnormal startup prompt information generation module 302 is also used to determine the startup safety detection result of the embedded system according to the phase startup duration of the startup phase and the startup time window of the startup phase, and when the startup safety detection result is determined to be an abnormal startup state, generate abnormal startup prompt information corresponding to the embedded system, and display the abnormal startup prompt information.
[0082] On the basis of any of the above optional technical solutions, the startup safety detection device for embedded systems optionally further includes: a normal startup time acquisition module and a startup time window determination module. The normal startup time acquisition module is used to obtain multiple historical startup records of the embedded system in a normal startup state before determining the startup safety detection result of the embedded system according to the startup duration of the startup phase and the startup time window of the startup phase, and obtain multiple normal startup times of each startup phase from the multiple historical startup records; the startup time window determination module is used to determine the mean and standard deviation of multiple normal startup times of the startup phase for each startup phase, and determine the startup time window of the startup phase according to the mean and standard deviation.
[0083] Based on any of the above optional technical solutions, optionally, the startup time window of the startup phase is determined according to the mean and standard deviation by the following formula:
[0084] ΔT window =μ stage +k·σ stage ,
[0085] Where, ΔT window represents the startup time window of the startup phase, μ stage Represents the mean of multiple normal startup times during the startup phase; σ stagerepresents the standard deviation of multiple normal startup times during the startup phase; k represents the window adjustment coefficient.
[0086] Based on any of the above optional technical solutions, optionally, the abnormal startup prompt information generation module 302 is used to determine the startup safety detection result of the embedded system as an abnormal startup state when the startup duration of at least one startup phase exceeds the startup time window of the startup phase.
[0087] On the basis of any of the above optional technical solutions, the abnormal startup prompt information generation module 302 optionally includes a stage time deviation determination unit, a total time deviation determination unit and an abnormal startup state determination unit. Among them, the stage time deviation determination unit is used to respectively determine the stage time deviation of the stage startup duration of each startup stage and the startup time window of the startup stage; the total time deviation determination unit is used to weight the stage time deviation corresponding to the startup stage according to the stage weight corresponding to each startup stage, and sum up the weighted multiple stage time deviations to obtain the total time deviation; the abnormal startup state determination unit is used to determine the startup safety detection result of the embedded system as an abnormal startup state when the total time deviation is greater than or equal to the preset deviation threshold.
[0088] On the basis of any of the above optional technical solutions, the startup safety detection device for the embedded system optionally further includes: a stage startup start data recording module and a stage startup end data recording module. Among them, the stage startup start data recording module is used to obtain the stage start time and the expected execution operation corresponding to the startup stage in each startup stage of the startup process of the embedded system before obtaining the stage startup data of multiple startup stages in the startup process, digitally sign the stage start time to obtain the first signature data, determine the first hash value of the expected execution operation, and store the stage start time, the first signature data and the first hash value; and the stage startup end data recording module is used to obtain the stage end time and the actual execution operation corresponding to the startup stage, digitally sign the stage end time to obtain the second signature data, determine the second hash value of the actual execution operation, and store the stage end time, the second hash value and the second signature data.
[0089] The startup safety detection device for an embedded system provided by an embodiment of the present invention can execute the startup safety detection method for an embedded system provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0090] Embodiment 4
[0091] Figure 4A schematic diagram of the structure of an electronic device for implementing a startup security detection method for an embedded system provided in Embodiment 4 of the present invention. The electronic device 10 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0092] like Figure 4 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0093] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0094] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a startup security detection method for an embedded system.
[0095] In some embodiments, the startup security detection method for an embedded system may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the startup security detection method for an embedded system described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the startup security detection method for an embedded system in any other appropriate manner (e.g., by means of firmware).
[0096] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0097] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0098] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0099] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0100] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0101] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0102] An embodiment of the present invention also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium. When at least one processor executes the computer program, it can implement the technical solution of the startup security detection method for an embedded system in the above embodiment.
[0103] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0104] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A startup security detection method for an embedded system, characterized in that: include: Acquire stage operation data of multiple startup stages in the startup process of the embedded system; wherein the multiple startup stages include at least two of a hardware initialization stage, a boot loader execution stage, an operating system loading stage, and an application startup stage; the stage operation data includes a first hash value of an expected execution operation and a second hash value of an actual execution operation in the startup stage; In the case that the first hash value and the second hash value corresponding to at least one of the startup phases are inconsistent, abnormal startup prompt information corresponding to the embedded system is generated and displayed.
2. The method according to claim 1, characterized in that After acquiring the stage operation data of multiple startup stages in the startup process of the embedded system, the method further includes: When the first hash value and the second hash value corresponding to each of the startup stages are consistent, obtaining stage time data of multiple startup stages; wherein the stage time data includes the stage start time, the first signature data of the stage start time, the stage end time, and the second signature data of the stage end time; For each of the startup phases, the phase start time is securely verified by using the first signature data, and the phase end time is securely verified by using the second signature data. When both the phase start time and the phase end time corresponding to the startup phase pass the security verification, the phase startup duration of the startup phase is determined according to the phase start time and the phase end time; The startup safety detection result of the embedded system is determined according to the startup duration of the startup phase and the startup time window of the startup phase, and when the startup safety detection result is determined to be an abnormal startup state, abnormal startup prompt information corresponding to the embedded system is generated and displayed.
3. The method according to claim 2, characterized in that Before determining the startup safety detection result of the embedded system according to the startup duration of the startup phase and the startup time window of the startup phase, the method further includes: Acquire multiple historical startup records of the embedded system in a normal startup state, and acquire multiple normal startup times of each startup stage from the multiple historical startup records; For each of the startup phases, a mean value and a standard deviation of a plurality of the normal startup times in the startup phase are determined, and a startup time window of the startup phase is determined according to the mean value and the standard deviation.
4. The method according to claim 3, characterized in that The start-up time window of the start-up phase is determined according to the mean and the standard deviation by the following formula: ΔT window =μ stage +k·s stage , Where, ΔT window represents the startup time window of the startup phase, μ stage represents the mean of multiple normal startup times in the startup phase; σ stage represents the standard deviation of multiple normal startup times in the startup phase; k represents the window adjustment coefficient.
5. The method according to claim 2, characterized in that: The step of determining the startup safety detection result of the embedded system according to the startup duration of the startup phase and the startup time window of the startup phase includes: In a case where the stage startup duration of at least one of the startup stages exceeds the startup time window of the startup stage, the startup safety detection result of the embedded system is determined as an abnormal startup state.
6. The method according to claim 2, characterized in that The step of determining the startup safety detection result of the embedded system according to the startup duration of the startup phase and the startup time window of the startup phase includes: Respectively determining the phase time deviation between the phase startup duration of each startup phase and the startup time window of the startup phase; Weighting the stage time deviation corresponding to the startup stage according to the stage weight corresponding to each startup stage, and summing the weighted multiple stage time deviations to obtain a total time deviation; When the total time deviation is greater than or equal to a preset deviation threshold, the startup safety detection result of the embedded system is determined to be an abnormal startup state.
7. The method according to claim 1, characterized in that Before acquiring the stage startup data of multiple startup stages in the startup process of the embedded system, the method further includes: In each startup phase of the startup process of the embedded system, obtaining a phase start time and an expected execution operation corresponding to the startup phase, digitally signing the phase start time to obtain a first signature data, determining a first hash value of the expected execution operation, and storing the phase start time, the first signature data, and the first hash value; and Obtain the stage end time and the actual execution operation corresponding to the startup stage, digitally sign the stage end time to obtain second signature data, determine the second hash value of the actual execution operation, and store the stage end time, the second hash value and the second signature data.
8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the startup security detection method for an embedded system according to any one of claims 1 to 7.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the startup security detection method for an embedded system according to any one of claims 1 to 7 when executed.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the computer program implements the startup security detection method for an embedded system according to any one of claims 1 to 7.
Citation Information
Patent Citations
starting method of an industrial control trusted embedded platform based on TPM
CN109522721A
Detection method and device and computer equipment
CN109726058A
Forensics Module and Integrated System
US20240187231A1