CN117420881A - Method for recording and converting audit time of embedded equipment - Google Patents

Method for recording and converting audit time of embedded equipment Download PDF

Info

Publication number
CN117420881A
CN117420881A CN202311736581.0A CN202311736581A CN117420881A CN 117420881 A CN117420881 A CN 117420881A CN 202311736581 A CN202311736581 A CN 202311736581A CN 117420881 A CN117420881 A CN 117420881A
Authority
CN
China
Prior art keywords
time
audit
record
sequence number
audit record
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
CN202311736581.0A
Other languages
Chinese (zh)
Inventor
郭井龙
李颖钧
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tianjin Photoelectric Gathered Energy Communication Co ltd
Original Assignee
Tianjin Photoelectric Gathered Energy Communication Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tianjin Photoelectric Gathered Energy Communication Co ltd filed Critical Tianjin Photoelectric Gathered Energy Communication Co ltd
Priority to CN202311736581.0A priority Critical patent/CN117420881A/en
Publication of CN117420881A publication Critical patent/CN117420881A/en
Withdrawn legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/04Generating or distributing clock signals or signals derived directly therefrom
    • G06F1/12Synchronisation of different clock signals provided by a plurality of clock generators
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/10Office automation; Time management
    • G06Q10/109Time management, e.g. calendars, reminders, meetings or time accounting
    • G06Q10/1091Recording time for administrative or management purposes
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Human Resources & Organizations (AREA)
  • Software Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Strategic Management (AREA)
  • Entrepreneurship & Innovation (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Educational Administration (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Operations Research (AREA)
  • Quality & Reliability (AREA)
  • Tourism & Hospitality (AREA)
  • General Business, Economics & Management (AREA)
  • Computer Security & Cryptography (AREA)
  • Recording Measured Values (AREA)

Abstract

The invention discloses a method for recording and converting audit time of embedded equipment, which comprises the following steps: updating the starting sequence number, and recording an event of updating the starting sequence number by using monotone time; recording audit records using monotonic time; synchronizing the wall time; recording audit records using monotonic time or wall time; and obtaining an audit record. According to the invention, when the embedded equipment does not synchronize the wall clock, the audit event is recorded by the monotone clock, and after the embedded equipment and host equipment synchronize time, the monotone time in the audit event is revised by the synchronized wall time, so that the utilization value of the audit record is improved.

Description

Method for recording and converting audit time of embedded equipment
Technical Field
The invention belongs to the field of information technology application, and particularly relates to a method for recording and converting audit time of embedded equipment.
Background
To reduce embedded hardware costs, a large number of embedded devices provide only a monotonic clock, no wall clock, and the devices must synchronize wall time from the host device after each start-up, which typically results in the embedded device starting faster and the host device starting slower, which results in no wall time available after the embedded device starts up, and audit events recorded during that time that are difficult to effectively utilize due to the lack of wall time. For some embedded equipment with high safety and high reliability, a great amount of self-checking and testing work can be carried out in the power-on starting process of the equipment, and the audit event in the stage has higher utilization value for troubleshooting and optimizing the functional performance of products, so that a method is necessary to design a method for recording the audit event time before wall time synchronization and determining the wall time when each audit record occurs through time conversion after the wall time synchronization, thereby improving the utilization value of the audit record.
In the above, wall clocks, also known as clock times, are used to represent specific dates and times, consistent with the daily understood clock concept. Monotonic clocks, always guaranteed time is forward, can record the duration that the device experiences since it was booted.
Disclosure of Invention
In order to achieve the above purpose, the present invention proposes a method for audit time recording and conversion of an embedded device. According to the method, when the embedded equipment does not synchronize the wall clock, the audit event is recorded by the monotone clock, after the embedded equipment and the host equipment synchronize time, the monotone time in the audit event is revised by the synchronized wall time, and the utilization value of the audit record is improved.
The aim of the invention is achieved by the following technical scheme.
The invention relates to a method for recording and converting audit time of embedded equipment, which comprises the following steps:
(1) Updating the starting sequence number and recording the event of updating the starting sequence number by using monotone time
The embedded equipment acquires the last starting sequence number from the last historical audit record after being powered on, the last starting sequence number is taken as the current starting sequence number after being powered on by 1, and an event of updating the starting sequence number is recorded in the audit record by using monotone time, wherein the elements of the audit record are recorded as follows: the starting sequence number of this time, "updating the starting sequence number", writing monotonic time of audit record moment, and the state information of the current embedded device;
(2) Audit recording using monotonic time recording
Under the condition that the embedded equipment does not synchronize the time of the host equipment, the embedded equipment uses monotone time to record audit records, and the elements of the audit records are recorded as follows in sequence: the specific audit event in the process of starting sequence number, monotone time audit record, monotone time and monotone time record;
(3) Time on synchronous wall
After the host device initiates a time synchronization instruction, the embedded device acquires the wall time from the host device, and records a time synchronization event in an audit record, wherein the elements in the audit record are recorded as follows in sequence: the starting sequence number, time synchronization, monotonic time and wall time;
(4) Audit recording using monotonic time or wall time recordings
When the embedded equipment uses the wall time to record audit records, the elements of the audit records are recorded as follows in sequence: the starting sequence number, the wall time audit record, the wall time and the specific event in the wall time record process; when the embedded equipment uses the monotone time to record the audit record, the elements of the audit record are recorded as follows in sequence: the specific audit event in the process of starting sequence number, monotone time audit record, monotone time and monotone time record;
(5) Audit record acquisition
(1) When the host device initiates an audit record acquisition instruction, if the time conversion is designated by the embedded device, outputting audit record contents after converting the monotonic time into the wall time according to the starting sequence number, the type mark and the audit time in the embedded device and for the audit record with the type mark of monotonic time audit record; for audit records with the type mark of wall time audit record, directly outputting audit record content;
(2) when the host machine equipment initiates an audit record acquisition instruction, if the host machine equipment is appointed to perform time conversion, the embedded equipment directly outputs an original audit record, and for the audit record with a type mark of 'monotonic time audit record', the host machine equipment converts monotonic time into wall time according to a starting sequence number, a type mark and audit time; for audit records with type flags "wall time audit record", no conversion is required.
Further, the elements of the audit record comprise a starting sequence number, a type mark, audit time and audit content;
the starting sequence number is used for determining the current audit record which is recorded after the embedded equipment is started, the starting sequence number starts from a specified initial value, and the sequence number is increased by 1 after each power-on;
the type mark is used for marking audit record types, including updating a starting sequence number, time synchronization, monotonic time audit record and wall time audit record;
the audit time is used for recording the time information of the audit record, is monotone time or wall time, and is distinguished by a type mark;
the audit content is used for recording specific audit events.
Further, the specific conversion method for converting the monotonic time into the wall time is as follows:
assuming that the starting sequence number of the current audit record is N, traversing all audit records with the starting sequence number of N, finding an audit record with a type mark of time synchronization, extracting wall time wallTime and monotonic time monotonime from the audit record, and calculating to obtain a difference value diffTime=wallTime-monotonime;
for all audit records with the starting sequence number N, analyzing from the ith audit record to obtain a type mark and audit time T i If the type flag is "monotonic time audit record", the wall time W of the audit record i The calculation mode of (a) is as follows: w (W) i =diffTime+T i
Compared with the prior art, the technical scheme of the invention has the following beneficial effects:
the method for recording and converting the audit time of the embedded equipment can provide the function of converting the monotonic time into the wall time for a large number of embedded equipment which has a monotonic clock but does not have a wall clock, thereby improving the utilization value of the audit record of the embedded equipment. The method is simple in principle and easy to implement, can be implemented through software or firmware logic, can be packaged into standard public components, and is provided for various embedded systems.
Drawings
FIG. 1 is a flow chart of a method for audit time recording and conversion of an embedded device of the present invention.
Detailed Description
The invention is further described below with reference to the accompanying drawings.
The invention discloses an audit time recording and converting method of embedded equipment, which is used for recording and converting audit time based on designed audit records. The elements of the audit record comprise a starting sequence number, a type mark, audit time and audit content, and the monotonic time in the audit record can be converted into the wall time through the elements. The method for representing the audit record elements (such as the sequence, the field length, the storage mode and the like of each element) can be flexibly adjusted according to actual conditions, for example, a table 1 structure can be used for representing an audit record, but the method is not limited to the table 1 representation mode.
TABLE 1
The elements of the audit record in the invention are described as follows:
(1) starting up sequence number: for determining which embedded device is to be powered on and then record the current audit record. The boot sequence number starts from a specified initial value and increases by 1 after each power-up.
(2) Type flag: for marking audit record types. The type mark in the invention comprises an update starting sequence number, time synchronization, monotone time audit record and a wall time audit record.
(3) Audit time: the time information used for recording the audit record can be monotonous time or wall time, and is distinguished by a type mark.
(4) Audit content: other elements, such as security related elements, may also be added according to embedded device requirements for recording specific audit events.
As shown in fig. 1, the method for recording and converting the audit time of the embedded device comprises the following specific implementation processes:
(1) Updating the starting sequence number and recording the event of updating the starting sequence number by using monotone time
The boot sequence number starts from a specified initial value and increases by 1 after each power-up. After the embedded equipment is powered on, the last starting sequence number is firstly obtained from the last historical audit record, the last starting sequence number is taken as the current starting sequence number after 1 is added, an event of updating the starting sequence number is recorded in the audit record by using monotone time, and four elements of the audit record are recorded as follows in sequence: other information such as the state information of the current embedded device can be written in the current starting sequence number, the updated starting sequence number, the monotone time when the audit record is written in and the audit content. If no history audit record exists, the starting sequence number is set to an initial value, and 1 can be selected as the initial value in general, and other initial values can be set.
(2) Audit recording using monotonic time recording
Under the condition that the embedded equipment does not synchronize the time of the host equipment, the embedded equipment uses monotone time to record audit records, and four elements of the audit records are recorded as follows in sequence: the specific audit event in the process of starting sequence number, monotone time audit record, monotone time and monotone time record.
(3) Time on synchronous wall
After the host device initiates a time synchronization instruction (i.e., a wall time synchronization instruction), the embedded device acquires wall time from the host device, and records a time synchronization event in an audit record, wherein four elements in the audit record are recorded as follows in sequence: this time of starting up sequence number, "time synchronization", monotonic time, wall time. The accuracy of the monotonic time and the wall time should be consistent, such as both to milliseconds, or both to microseconds.
(4) Audit recording using monotonic time or wall time recordings
After synchronizing the on-wall time, the embedded device may use the on-wall time to record subsequent audit records, or may still use monotonic time to record audit records. When the embedded equipment uses the wall time to record the audit record, four elements of the audit record are recorded as follows in sequence: the method comprises the steps of starting up serial numbers, wall time audit records, wall time and specific events in the wall time recording process. When the embedded equipment uses the monotone time to record the audit record, the four elements of the audit record are recorded as follows in sequence: the specific audit event in the process of starting sequence number, monotone time audit record, monotone time and monotone time record.
(5) Audit record acquisition
(1) When the host device initiates an audit record acquisition instruction, if the time conversion is designated by the embedded device, outputting audit record contents after converting the monotonic time into the wall time according to the starting sequence number, the type mark, the audit time and other factors in the embedded device and for the audit record with the type mark of monotonic time audit record; and directly outputting audit record contents for audit records with the type mark of 'wall time audit record'.
(2) When the host machine equipment initiates an audit record acquisition instruction, if the host machine equipment is appointed to perform time conversion, the embedded equipment directly outputs an original audit record, and for the audit record with a type mark of 'monotonic time audit record', the host machine equipment converts monotonic time into wall time according to a starting sequence number, a type mark and audit time; for audit records with type flags "wall time audit record", no conversion is required.
In the above, the monotonic time in the audit record can be converted into the wall time by using the elements of the start-up sequence number, the type mark, the audit time, the audit content and the like in the audit record, and the specific conversion method is as follows:
(a) Assuming that the starting sequence number of the current audit record is N, traversing all audit records with the starting sequence number of N, finding an audit record with a type mark of time synchronization, extracting wall time wallTime and monotonic time monotonime from the audit record, and calculating a difference value diffTime=wallTime-monotonime of the wall time wallTime and the monotonic time because the accuracy of the wall time wallTime and the monotonic time is the same.
(b) For all audit records with the starting sequence number N, analyzing from the ith audit record to obtain a type mark and audit time T i If the type flag is "monotonic time audit record", the wall time W of the audit record i The calculation mode of (a) is as follows: w (W) i =diffTime+T i
It should be noted that:
in some extreme cases (e.g., when the host device fails), there may be a situation where the host device is out of sync after a certain power-on (assuming the power-on number is M), and then a "time-sync" event will not be obtained through step (a), resulting in a time-shift failure. At this time, all audit records with the starting sequence number M cannot finish the conversion from monotone time to wall time. However, by using the wall time of the audit records in the adjacent startup orders (startup orders M-1 and M+1), the wall time range of all audit records with startup sequence number M can be obtained.
The invention does not limit the traversing mode, but after each time of starting up and completing time synchronization, the time conversion times can be effectively reduced by using the wall time audit record, and in this case, if the last audit record is traversed to the oldest audit record, the conversion efficiency can be obviously improved.
Although the function and operation of the present invention has been described above with reference to the accompanying drawings, the present invention is not limited to the above-described specific functions and operations, but the above-described specific embodiments are merely illustrative, not restrictive, and many forms can be made by those having ordinary skill in the art without departing from the spirit of the present invention and the scope of the appended claims, which are included in the protection of the present invention.

Claims (3)

1. The method for recording and converting the audit time of the embedded equipment is characterized by comprising the following steps:
(1) Updating the starting sequence number and recording the event of updating the starting sequence number by using monotone time
The embedded equipment acquires the last starting sequence number from the last historical audit record after being powered on, the last starting sequence number is taken as the current starting sequence number after being powered on by 1, and an event of updating the starting sequence number is recorded in the audit record by using monotone time, wherein the elements of the audit record are recorded as follows: the starting sequence number of this time, "updating the starting sequence number", writing monotonic time of audit record moment, and the state information of the current embedded device;
(2) Audit recording using monotonic time recording
Under the condition that the embedded equipment does not synchronize the time of the host equipment, the embedded equipment uses monotone time to record audit records, and the elements of the audit records are recorded as follows in sequence: the specific audit event in the process of starting sequence number, monotone time audit record, monotone time and monotone time record;
(3) Time on synchronous wall
After the host device initiates a time synchronization instruction, the embedded device acquires the wall time from the host device, and records a time synchronization event in an audit record, wherein the elements in the audit record are recorded as follows in sequence: the starting sequence number, time synchronization, monotonic time and wall time;
(4) Audit recording using monotonic time or wall time recordings
When the embedded equipment uses the wall time to record audit records, the elements of the audit records are recorded as follows in sequence: the starting sequence number, the wall time audit record, the wall time and the specific event in the wall time record process; when the embedded equipment uses the monotone time to record the audit record, the elements of the audit record are recorded as follows in sequence: the specific audit event in the process of starting sequence number, monotone time audit record, monotone time and monotone time record;
(5) Audit record acquisition
(1) When the host device initiates an audit record acquisition instruction, if the time conversion is designated by the embedded device, outputting audit record contents after converting the monotonic time into the wall time according to the starting sequence number, the type mark and the audit time in the embedded device and for the audit record with the type mark of monotonic time audit record; for audit records with the type mark of wall time audit record, directly outputting audit record content;
(2) when the host machine equipment initiates an audit record acquisition instruction, if the host machine equipment is appointed to perform time conversion, the embedded equipment directly outputs an original audit record, and for the audit record with a type mark of 'monotonic time audit record', the host machine equipment converts monotonic time into wall time according to a starting sequence number, a type mark and audit time; for audit records with type flags "wall time audit record", no conversion is required.
2. The method for recording and converting audit time of embedded equipment according to claim 1, wherein the elements of the audit record include a boot sequence number, a type flag, an audit time, and audit content;
the starting sequence number is used for determining the current audit record which is recorded after the embedded equipment is started, the starting sequence number starts from a specified initial value, and the sequence number is increased by 1 after each power-on;
the type mark is used for marking audit record types, including updating a starting sequence number, time synchronization, monotonic time audit record and wall time audit record;
the audit time is used for recording the time information of the audit record, is monotone time or wall time, and is distinguished by a type mark;
the audit content is used for recording specific audit events.
3. The method for recording and converting audit time of embedded equipment according to claim 1, characterized in that the specific conversion method for converting monotonic time into wall time is as follows:
assuming that the starting sequence number of the current audit record is N, traversing all audit records with the starting sequence number of N, finding an audit record with a type mark of time synchronization, extracting wall time wallTime and monotonic time monotonime from the audit record, and calculating to obtain a difference value diffTime=wallTime-monotonime;
for all audit records with the starting sequence number N, analyzing from the ith audit record to obtain a type mark and audit time T i If the type flag is "monotonic time audit record", the wall time W of the audit record i The calculation mode of (a) is as follows: w (W) i =diffTime+T i
CN202311736581.0A 2023-12-18 2023-12-18 Method for recording and converting audit time of embedded equipment Withdrawn CN117420881A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311736581.0A CN117420881A (en) 2023-12-18 2023-12-18 Method for recording and converting audit time of embedded equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311736581.0A CN117420881A (en) 2023-12-18 2023-12-18 Method for recording and converting audit time of embedded equipment

Publications (1)

Publication Number Publication Date
CN117420881A true CN117420881A (en) 2024-01-19

Family

ID=89528754

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311736581.0A Withdrawn CN117420881A (en) 2023-12-18 2023-12-18 Method for recording and converting audit time of embedded equipment

Country Status (1)

Country Link
CN (1) CN117420881A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5327553A (en) * 1989-12-22 1994-07-05 Tandem Computers Incorporated Fault-tolerant computer system with /CONFIG filesystem
CN101731011A (en) * 2007-05-11 2010-06-09 奥迪耐特有限公司 Systems, methods and computer-readable media for configuring receiver latency
CN105337680A (en) * 2015-08-07 2016-02-17 中国人民解放军63892部队 High-precision network time unifying device and method
CN112584087A (en) * 2021-02-25 2021-03-30 浙江华创视讯科技有限公司 Video conference recording method, electronic device and storage medium
CN113821076A (en) * 2021-10-11 2021-12-21 上海航天计算机技术研究所 Virtual simulation system and synchronization method based on virtual clock

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5327553A (en) * 1989-12-22 1994-07-05 Tandem Computers Incorporated Fault-tolerant computer system with /CONFIG filesystem
CN101731011A (en) * 2007-05-11 2010-06-09 奥迪耐特有限公司 Systems, methods and computer-readable media for configuring receiver latency
CN105337680A (en) * 2015-08-07 2016-02-17 中国人民解放军63892部队 High-precision network time unifying device and method
CN112584087A (en) * 2021-02-25 2021-03-30 浙江华创视讯科技有限公司 Video conference recording method, electronic device and storage medium
CN113821076A (en) * 2021-10-11 2021-12-21 上海航天计算机技术研究所 Virtual simulation system and synchronization method based on virtual clock

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
王旭: "计算机指令集仿真器的时间仿真技术研究", 计算机应用与软件, no. 08, 12 August 2005 (2005-08-12), pages 3 - 4 *

Similar Documents

Publication Publication Date Title
CN106407356B (en) Data backup method and device
CN113111129B (en) Data synchronization method, device, equipment and storage medium
CN107239273B (en) Disk drive binding method of server
CN102968486B (en) A kind of highly reliable file synchronisation method based on change journal
CN101719165A (en) Method for realizing high-efficiency rapid backup of database
CN110795287B (en) Data recovery method, system, electronic equipment and computer storage medium
CN112286905A (en) Data migration method and device, storage medium and electronic equipment
CN106844102B (en) Data recovery method and device
CN108614876B (en) Redis database-based system and data processing method
CN108564463B (en) Bank abnormal transaction correction method and system
CN103970834A (en) Recovery method for incremental data synchronization fault in isomerous database synchronizing system
US20090164840A1 (en) System and Method For Managing Root File System
CN101196839A (en) Data renovation and synchronization process of double-flash read-only memory
CN111767346A (en) Database data synchronization method, device, equipment and storage medium
CN109960602B (en) Information management method, device, equipment and medium
CN117420881A (en) Method for recording and converting audit time of embedded equipment
CN109445991A (en) A kind of date storage method, system, intelligent wearable device and storage medium
CN111459720A (en) Mysql data recovery method based on transaction log
CN114756410B (en) Data recovery method, device and medium for dual-computer hot standby system
CN114880167A (en) Data backup and recovery method, server, distributed system and storage medium
CN114490570A (en) Production data synchronization method and device, data synchronization system and server
CN104182301A (en) Backup method and restore method for Kylin operating system
CN100511234C (en) Data supervision system and method thereof
CN111506668A (en) Robot cluster intelligent data synchronization method and system
CN111258814B (en) Database backup fault tolerance method, system, terminal and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WW01 Invention patent application withdrawn after publication

Application publication date: 20240119

WW01 Invention patent application withdrawn after publication