Average time consumption method for testing startup trusted measurement and related device
By automatically restarting and average time-consuming calculation of trusted DCS host computers, the problems of large errors and low efficiency caused by manual operations in the prior art are solved, and a more efficient and accurate test process is achieved.
Patent Information
- Application Number
- CN202510138937.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-08
- Publication Date
- 2025-03-07
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the prior art, manual operations are used to conduct the startup time test of trusted DCS host computers, which has problems of large errors and low efficiency.
By creating shell script files and test services, the automatic restart of trusted DCS host computer is realized, and the average time to start trusted metrics is automatically calculated by calculating the count file and the system time difference.
It improves the test speed and quality, reduces artificial errors, improves test efficiency and accuracy, and reduces test costs.
Smart Images

Figure CN119576675A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of a trusted DCS host computer, and in particular to an average time consumption method for testing startup trusted metrics and a related device. Background Art
[0002] As the cornerstone of modern industrial automation, DCS (Distributed Control System) deeply integrates advanced microprocessor technology to build a new generation of efficient and intelligent instrumentation and control systems. The system adheres to the advanced concept of "decentralized control, centralized operation, divide and conquer, coordinated and unified". Through a clear, collaborative and efficient architecture design, it not only ensures the centralization and efficiency of system management, but also gives unprecedented flexibility and decentralization to the control function. Each field control station performs its duties and completes the control task independently, while the powerful communication network is like a high-speed channel for information, seamlessly connecting the control station and the operation station, realizing the instant aggregation, precise processing and all-round monitoring of data, and providing solid technical support for the intelligent transformation of the production process.
[0003] With its excellent reliability, flexibility and wide adaptability, DCS has shined in many industries such as electricity, metallurgy, petrochemicals, chemicals, and pharmaceuticals. It has not only greatly improved production efficiency and product quality, but also significantly reduced energy consumption and environmental load, helping enterprises move towards a green and sustainable development path. With the continuous integration of cutting-edge technologies such as the Internet of Things and big data, DCS is leading a new wave of intelligent manufacturing and digital factories, injecting unprecedented innovation vitality and competitive advantages into enterprises.
[0004] The trusted DCS host computer is usually called a monitoring computer or monitoring system, and is the human-computer interaction interface in the DCS. The trusted DCS host computer is responsible for receiving control instructions from the operator and sending these instructions to the DCS controller. At the same time, the trusted DCS host computer is also responsible for monitoring the operating status of the entire DCS, including equipment status, data changes, etc., and presenting this information to the operator in the form of graphics, tables, etc.
[0005] Specifically, the trusted DCS host computer implements various complex control strategies by writing programs and converts these control strategies into specific control instructions. These control instructions are transmitted to the DCS controller through the communication network, and the DCS controller performs specific control operations. The DCS controller collects data from field devices in real time and feeds these data back to the trusted DCS host computer through the communication network. The trusted DCS host computer processes, analyzes and displays these data to provide operators with an intuitive monitoring interface and decision support. Through efficient collaboration between the trusted DCS host computer and the DCS controller, precise control and real-time monitoring of field equipment are achieved. This collaborative work not only improves production efficiency and management level, but also ensures the stability and security of the DCS.
[0006] In DCS, the importance of the trusted DCS host computer as the core management and monitoring hub is self-evident. The domestic trusted DCS controller integrates cutting-edge trusted startup technology. At the beginning of the startup of the trusted DCS host computer, the BIOS (Basic Input Output System) firmware, hardware platform, boot code and configuration, kernel files and other key components are strictly verified layer by layer to ensure the trustworthiness and security of the trusted DCS host computer from the root. When the measurement verification is untrustworthy, the system startup is prevented or an alarm message is prompted according to the trusted policy configured by the user.
[0007] However, since trusted startup is a series of trusted measurement verifications performed during the startup phase, it requires multiple tedious manual startups of devices and timekeeping to calculate the average time. This is not only time-consuming and laborious, but also prone to human errors, affecting project progress and cost control.
[0008] Therefore, how to achieve automatic startup and calculate the average time consumption of trust metrics when starting up a trusted DCS host device, and improve the test speed and test quality, has become a technical problem that technicians in this field need to solve urgently. Summary of the invention
[0009] The purpose of the present invention is to provide an average time consumption method and related devices for testing startup trustworthiness metrics, so as to overcome the problems of large errors and low efficiency caused by relying on manual operation to perform startup time testing in the prior art.
[0010] The present invention solves the above technical problems through the following technical solutions: A method for testing an average time consumption of startup trust measurement includes the following steps: Step 1: Create a shell script file to control the restart of the trusted DCS host computer; create a test service to execute the shell script file. When the trusted DCS host computer restarts, the test service automatically starts; create a count file to set the system-specified restart number value and the initialized restart number value; Step 2: The trusted DCS host computer receives the restart instruction, the test service is automatically started, the shell script file is executed, and the system time and the current restart count value of the current trusted DCS host computer are read, wherein the current restart count value is the initialized restart count value plus one; Step 3: Compare the current restart count value with the system-specified restart count value. When the two are not equal, modify the restart count value initialized in the counting file to the current restart count value, and continue to restart the trusted DCS host computer until the current restart count value is equal to the system-specified restart count value. The test ends. Based on the system time read in step 2, calculate the average time U for starting the trusted metric of the trusted DCS host computer.
[0011] A further improvement of the present invention is that the average time U consumed by the trusted DCS host computer to start the trusted metric is calculated using the following method: U=
[0012] Among them, T E is the system time last read; T S is the system time read for the first time; S is the number of times the system is restarted.
[0013] A further improvement of the present invention is that the average time U consumed by the trusted DCS host computer to start the trusted metric is calculated using the following method: According to the system time read at the time of restart, the system time difference between two adjacent restarts is calculated, and after removing the maximum and minimum values of the calculation results respectively, the sum H of the remaining system time differences is calculated; The average time U consumed by the trusted DCS host computer to start the trusted measurement is: U=
[0014] Where S is the number of restarts specified by the system.
[0015] A further improvement of the present invention is that it also includes step 4, recording the average time U consumed by the trusted DCS host computer to start the trusted metric, and generating a test report according to the test process of steps 1 to 3.
[0016] A further improvement of the present invention is that the trusted DCS host computer includes an engineer station and an operator station.
[0017] A further improvement of the present invention is that the counting file is stored in a disk.
[0018] A further improvement of the present invention is that the system time is stored in a log file.
[0019] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.
[0020] A computer-readable storage medium stores a computer program, which implements the steps of the above method when executed by a processor.
[0021] A computer program product comprises a computer program, which implements the steps of the above method when executed by a processor.
[0022] Compared with the prior art, the positive and progressive effects of the present invention are: The present invention provides an average time-consuming method for testing the startup of a trusted metric, which optimizes the deficiencies in the traditional test process. Through the created counting file, the system-specified restart times and the initialized restart times are set; through the created test service, after the trusted DCS host computer is restarted, the shell script file is automatically executed: on the one hand, by comparing the current restart times with the system-specified restart times, the automatic restart times of the trusted DCS host computer are controlled; on the other hand, according to the read system time, the average time-consuming for the trusted DCS host computer to start the trusted metric is calculated. Compared with the traditional test method, this method not only completely solves the problem of relying on manual recording of the startup time, cumbersome operation and error-prone in traditional testing, but also improves the test efficiency and accuracy, shortens the test cycle, and reduces the test cost caused by repeated labor and human factors. By realizing the automation and intelligence of the test process, strong technical support is provided to enterprises, helping them to achieve more outstanding results in the field of DCS credibility verification.
[0023] Furthermore, the method provides a method for calculating the average time consumption of the trusted DCS host computer to start the trusted metric, by directly calculating the difference between the last read system time and the first read system time, and then dividing it by the number of restarts minus one, the average time consumption can be quickly obtained. When the startup process of the trusted DCS host computer is relatively stable and the startup time difference is not large, this method can more accurately reflect the average startup time consumption.
[0024] Furthermore, the method also provides a method for calculating the average time consumption of the trusted DCS host computer to start the trusted measurement. By calculating the system time difference between two adjacent restarts and eliminating the maximum and minimum values, the method can eliminate the extreme time consumption caused by accidental factors (such as system abnormalities, external interference, etc.), improve the reliability and representativeness of the average time consumption data, and thus obtain an average time consumption that is closer to the actual situation. This method is not only suitable for situations where the system performance is relatively consistent, but also can reduce the impact on the average time consumption by eliminating extreme values when the system performance fluctuates greatly, so it has stronger adaptability and flexibility. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The drawings in the specification are used to provide further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0026] Figure 1 It is a schematic diagram of the process of the present invention. DETAILED DESCRIPTION
[0027] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions 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 part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0028] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. 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.
[0029] The following is a description of exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0030] Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making any creative work shall fall within the scope of protection of this application.
[0031] In addition, the term "and / or" in this article is only a description of the association relationship between the associated objects, indicating that there can be three relationships. For example, Q and / or W can represent: Q exists alone, Q and W exist at the same time, and W exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0032] Shell script: It is a program written using the functions of shell. This program uses a plain text file, writes some shell syntax and instructions in it, and then uses regular expressions, pipeline commands, data flow redirection and other functions to achieve the target function.
[0033] The present invention is further described in detail below in conjunction with the accompanying drawings: See also Figure 1 , a method for testing the average time consumption of startup trust measurement, comprising the following steps: Step 1: Create a shell script file for controlling the restart of the trusted DCS host computer; create a test service for executing the shell script file. When the trusted DCS host computer restarts, the test service starts automatically; create a count file to set the system-specified restart number value and the initialized restart number value; in this embodiment, the system-specified restart number value is set to 5, and the initialized restart number value is set to 0; specifically, the count file is stored in the disk.
[0034] Step 2: The trusted DCS host computer receives the restart instruction and restarts the trusted DCS host computer. After the trusted DCS host computer is turned on, the test service is automatically started, and the shell script file is executed to read the current system time of the trusted DCS host computer and the current restart count value, wherein the current restart count value is the initialized restart count value plus one. In this embodiment, the current system time of the trusted DCS host computer is time1 and the current restart count value is 0+1=1; Step 3: Compare the current restart count value with the system-specified restart count value. When the two are not equal, modify the restart count value initialized in the counting file to the current restart count value, and continue to restart the trusted DCS host computer until the current restart count value is equal to the system-specified restart count value. The test ends. Based on the system time read in step 2, calculate the average time U for starting the trusted metric of the trusted DCS host computer.
[0035] Compare the current restart count value 1 with the system specified restart count value 5. If the two are not equal, modify the restart count value 0 initialized in the count file to the current restart count value 1, continue to restart the trusted DCS host computer, and read the system time and current restart count value of the current trusted DCS host computer; At this time, the current restart count value is 1+1=2, and the system time is recorded as time2; compare the current restart count value 2 with the system specified restart count value 5, and if they are not equal, modify the restart count value 1 initialized in the count file to the current restart count value 2, continue to restart the trusted DCS host computer, and read the system time and current restart count value of the current trusted DCS host computer; At this time, the current restart count value is 2+1=3, and the system time is recorded as time3; compare the current restart count value 3 with the system specified restart count value 5 to see if they are equal. If they are not equal, modify the restart count value 2 initialized in the count file to the current restart count value 3, continue to restart the trusted DCS host computer, and read the system time and current restart count value of the current trusted DCS host computer; At this time, the current restart count value is 3+1=4, and the system time is recorded as time4; compare the current restart count value 4 with the system specified restart count value 5 to see if they are equal. If they are not equal, modify the restart count value 3 initialized in the count file to the current restart count value 4, continue to restart the trusted DCS host computer, and read the system time and current restart count value of the current trusted DCS host computer; At this time, the current restart count value is 4+1=5, and the system time is recorded as time5; compare whether the current restart count value 5 is equal to the system specified restart count value 5. If the two are equal, the test ends and the average time consumed by the trusted DCS host computer to start the trusted measurement is calculated.
[0036] In a specific embodiment of the present invention, the average time U consumed by the trusted DCS host computer to start the trust metric is calculated using the following method: U=
[0037] Among them, T E is the system time last read; T S is the system time read for the first time; S is the number of times the system is restarted.
[0038] The last system time read is time5, the first system time read is time1, and the system-specified restart count value is 5.
[0039] The average time taken by the trusted DCS host computer to start the trusted measurement = (time5 - time1) ÷ (5-1).
[0040] In this embodiment, the above method is used to directly calculate the difference between the last system time read and the first system time read, and then divide it by the number of restarts minus one, so that the average time consumption can be quickly obtained. When the startup process of the trusted DCS host computer is relatively stable and the startup time difference between each startup is not large, this method can more accurately reflect the average startup time consumption.
[0041] In another specific embodiment of the present invention, the average time consumption of starting the trust metric of the trusted DCS host computer is calculated in the following manner: According to the system time read at the time of restart, the system time difference between two adjacent restarts is calculated, and after removing the maximum and minimum values of the calculation results respectively, the sum H of the remaining system time differences is calculated; The average time U consumed by the trusted DCS host computer to start the trusted measurement is: U=
[0042] Where S is the number of restarts specified by the system.
[0043] The system time difference when adjacent systems restart is: A=time5 - time4; B=time4 - time3; C=time3- time2; D=time2 - time1. Assuming that B is the maximum value and D is the minimum value, then: The average time taken by the trusted DCS host computer to start the trusted measurement = (A+C) ÷ (5-3).
[0044] In this embodiment, the above method is used to calculate the system time difference between two adjacent restarts and remove the maximum and minimum values. This method can eliminate the extreme time consumption caused by accidental factors (such as system abnormalities, external interference, etc.), improve the reliability and representativeness of the average time consumption data, and thus obtain an average time consumption that is closer to the actual situation. This method is not only suitable for situations where system performance is relatively consistent, but also can reduce the impact on the average time consumption by removing extreme values when the system performance fluctuates greatly, so it has stronger adaptability and flexibility.
[0045] Of course, in some specific embodiments of the present invention, the present invention should also include step 4, recording the average time U taken by the trusted DCS host computer to start the trust metric, and generating a test report according to the test process.
[0046] In some specific embodiments of the present invention, the trusted DCS host computer includes an engineer station and an operator station.
[0047] Based on the same inventive concept, an embodiment of the present application provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the average time-consuming method for testing the startup trust metric are implemented, wherein the memory may include a memory, such as a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk memory, etc.; the processor, the network interface, and the memory are interconnected through an internal bus, and the internal bus may be an industrial standard architecture bus, a peripheral component interconnection standard bus, an extended industrial standard structure bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. The memory is used to store programs. Specifically, the program may include a program code, and the program code includes computer operation instructions. The memory may include a memory and a non-volatile memory, and provide instructions and data to the processor.
[0048] Based on the same inventive concept, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the average time-consuming method for testing the startup trust metric are implemented. Specifically, the computer-readable storage medium includes, but is not limited to, for example, volatile memory and / or non-volatile memory. The volatile memory may include RAM (Random Access Memory) and / or cache memory, etc. The non-volatile memory may include ROM (Read-Only Memory), hard disk, flash memory, optical disk, magnetic disk, etc.
[0049] Based on the same inventive concept, an embodiment of the present application provides a computer program product, which includes a computer program stored on a computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer device, the computer device executes the steps of the above-mentioned method for testing the average time consumption of starting a trusted measurement.
[0050] It should be understood by those skilled in the art that the embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM (Compact Disc Read-Only Memory), optical storage, etc.) containing computer-usable program codes.
[0051] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0052] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0053] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0054] Finally, it should be noted that the above-listed embodiments exist only as one or more specific forms of expression of the technical solution of the present invention. Their purpose is to clearly explain the concept, principle and application of the present invention through specific examples, and it is by no means intended to limit the protection scope of the present invention to these specific embodiments. In fact, the real value of the present invention lies in the technical ideas and innovations it proposes, rather than its form of expression or means of implementation.
[0055] For ordinary technicians in the relevant technical field, after in-depth reading and understanding of the technical solution of the present invention, they are fully capable of making various forms of changes, modifications or equivalent substitutions to the specific implementation methods of the invention based on their own professional knowledge and skills. These changes may include but are not limited to: adjusting the value range of technical parameters, optimizing algorithm processes to improve efficiency, replacing some technical components to achieve better compatibility or reduce costs, etc. As long as these changed technical solutions still substantially maintain the technical features claimed for protection by the original invention, that is, they can still achieve the core functions and effects of the present invention, then these changes should be deemed to fall within the scope of protection of the pending claims of the present invention.
[0056] In addition, with the continuous progress and development of technology, new technical means and methods continue to emerge, which also provides broad space for further improvement and perfection of the present invention. Therefore, the protection scope of the present invention should also include those reasonably foreseeable improvements and extensions based on the existing technology. As long as these improvements and extensions do not deviate from the basic principles and core concepts of the present invention, they should be regarded as equivalents of the present invention and are also protected by patent rights.
Claims
1. A method for testing the average time consumption of startup trustworthiness measurement, characterized in that: The following steps are involved: Step 1: Create a shell script file to control the restart of the trusted DCS host computer; Create a test service for executing the shell script file. When the trusted DCS host computer restarts, the test service automatically starts; create a count file to set the system-specified restart times and the initialized restart times; Step 2: The trusted DCS host computer receives the restart instruction, the test service is automatically started, the shell script file is executed, and the system time and the current restart count value of the current trusted DCS host computer are read, wherein the current restart count value is the initialized restart count value plus one; Step 3: Compare the current restart count value with the system-specified restart count value. When the two are not equal, modify the restart count value initialized in the counting file to the current restart count value, and continue to restart the trusted DCS host computer until the current restart count value is equal to the system-specified restart count value. The test ends. Based on the system time read in step 2, calculate the average time U for starting the trusted metric of the trusted DCS host computer.
2. The average time consumption method for testing startup trustworthiness measurement according to claim 1, characterized in that: The average time U consumed by the trusted DCS host computer to start the trusted measurement is calculated using the following method: U= Among them, T E is the system time last read; T S is the system time read for the first time; S is the number of times the system is restarted.
3. The average time consumption method for testing startup trustworthiness measurement according to claim 1, characterized in that: The average time U consumed by the trusted DCS host computer to start the trusted measurement is calculated using the following method: According to the system time read at the time of restart, the system time difference between two adjacent restarts is calculated, and after removing the maximum and minimum values of the calculation results respectively, the sum H of the remaining system time differences is calculated; The average time U consumed by the trusted DCS host computer to start the trusted measurement is: U= Where S is the number of restarts specified by the system.
4. The average time consumption method for testing startup trustworthiness measurement according to claim 1, characterized in that: The method also includes step 4, recording the average time U of the trusted DCS host computer to start the trusted measurement, and generating a test report according to the test process of steps 1 to 3.
5. The average time consumption method for testing startup trustworthiness measurement according to claim 1, characterized in that: The trusted DCS host computer includes an engineer station and an operator station.
6. The average time consumption method for testing startup trustworthiness measurement according to claim 1, characterized in that: The count file is stored on disk.
7. The average time consumption method for testing startup trustworthiness measurement according to claim 1, characterized in that: The system time is saved in the log file.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Real-time performance test method of embedded system
CN106776272A
System restart detection method and device, terminal and storage medium
CN109491822A
Self-adaptive road network semantic position privacy protection method based on multi-objective optimization problem
CN112995987A
System and method for recording startup time of restart experiment under BIOS (Basic Input / Output System)
CN114510403A
Time record management method and related component
CN115586997A