Event time recording method and device, electronic equipment and power supply equipment
By obtaining and synchronizing the running time and time zone time in the device, the problem of frequent communication occupancy of resources in the prior art is solved, and the accuracy of event time recording and resource conservation are achieved.
Patent Information
- Application Number
- CN202510024043.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-07
- Publication Date
- 2025-05-30
AI Technical Summary
When existing devices display time zone time in real time, they need to frequently communicate with external devices, occupying a large amount of processing resources, resulting in wasted computing resources.
By obtaining the device running time when the target event occurs, and synchronizing the time zone time provided by the external device in time, performing time synchronization processing, the time zone time when the event occurs is associated.
While not affecting event time recording, the computing resources of the device are saved, frequent communication with external devices are reduced, and resource utilization efficiency is improved.
Smart Images

Figure CN120066888A_ABST
Abstract
Description
Technical Field
[0001] This application relates to computer technology, and in particular, to an event time recording method, apparatus, electronic device, and power supply device. Background Art
[0002] Currently, devices usually display the time of the time zone in real time. To ensure the accuracy of the time zone time, it is necessary to communicate with the outside world at all times to obtain the time zone time, so as to accurately record the occurrence time of each event.
[0003] However, this method requires the device to maintain high-frequency information interaction with external devices, which will occupy too much processing resources of the device. Summary of the Invention
[0004] Embodiments of this application provide an event time recording method, apparatus, electronic device, and power supply device, which can save the computing resources of the device without affecting the recording of event time.
[0005] The technical solution of the embodiments of this application is implemented as follows:
[0006] Embodiments of this application provide an event time recording method, including:
[0007] In response to a target event, obtain the first running time of the device when the target event occurs;
[0008] Obtain a second running time and a second time zone time that are synchronized in time, where the second time zone time is obtained from an external device;
[0009] Based on the second running time and the second time zone time, perform time synchronization processing on the first running time to obtain a first time zone time synchronized with the first running time;
[0010] Associate and store the first running time and the first time zone time to record the occurrence time of the target event;
[0011] Wherein, the first running time and the second running time represent the running duration of the device, the first time zone time and the second time zone time are the reference times of the time zone where the device is located, and the external device has the same time zone as the location corresponding to the device.
[0012] In the above solution, the obtaining of the second running time and the second time zone time that are synchronized in time includes:
[0013] Obtain the second running time of the device and the second time zone time from an external device at the same moment; or,
[0014] Obtain the second running time and the second time zone time stored in association from the device.
[0015] In the above solution, the method further includes:
[0016] In response to the arrival of a time period, obtain the running time of the device and obtain the time zone time from an external device;
[0017] Store the running time and the time zone time in association.
[0018] In the above solution, the obtaining the second running time and the second time zone time stored in association from the device includes:
[0019] From multiple groups of running times and time zone times stored in association in the device, determine the running time with the smallest time difference from the first running time, and the time zone time associated with the determined running time;
[0020] Determine the determined running time and time zone time as the second running time and the second time zone time respectively.
[0021] In the above solution, after storing the running time and the time zone time in association, it includes:
[0022] Obtain the third running time and the third time zone time stored in association;
[0023] Based on the difference between the time zone time and the third time zone time, calculate the target running time that is different from the third running time by the difference;
[0024] If the target running time is inconsistent with the running time, update the running time associated with the time zone time to the target running time.
[0025] In the above solution, the method further includes:
[0026] Adjust the current running time of the device based on the target running time, so that the device performs running time timing based on the adjusted current running time.
[0027] In the above solution, the target event is that the device runs abnormally, the device is powered on, or a time synchronization instruction is received.
[0028] An embodiment of the present application provides an event time recording device, including:
[0029] A response module, configured to obtain the first running time of the device when a target event occurs in response to the target event;
[0030] An acquisition module, configured to acquire a second running time and a second time zone time that are synchronized in time, where the second time zone time is acquired from an external device;
[0031] A processing module, configured to perform time synchronization processing on the first running time based on the second running time and the second time zone time to obtain a first time zone time synchronized with the first running time;
[0032] A storage module, configured to store the first running time and the first time zone time in an associated manner to record the occurrence time of the target event;
[0033] Wherein, the first running time and the second running time represent the running duration of the device, the first time zone time and the second time zone time are the reference times of the time zone to which the geographical location of the device belongs, and the external device has the same time zone as the geographical location corresponding to the device.
[0034] An embodiment of the present application provides a power supply device, including:
[0035] A power converter, configured to convert the input first - format electric energy into second - format electric energy; and an event time recording device as provided in the embodiment of the present application.
[0036] An embodiment of the present application provides an electronic device, including:
[0037] A memory, configured to store executable instructions;
[0038] A processor, configured to implement the event time recording method provided in the embodiment of the present application when executing the executable instructions stored in the memory.
[0039] An embodiment of the present application provides a computer - readable storage medium, storing executable instructions, and when the executable instructions are executed by a processor, the event time recording method provided in the embodiment of the present application is implemented.
[0040] An embodiment of the present application provides a computer program product, storing a computer program, and when the computer program is executed by a processor, the event time recording method provided in the embodiment of the present application is implemented.
[0041] In the embodiment of the present application, in response to a target event, the first running time of the device when the target event occurs is obtained, then the second running time and the second time zone time that are synchronized in time are obtained, and based on the second running time and the second time zone time, time synchronization processing is performed on the first running time to obtain the first time zone time synchronized with the first running time, and the first running time and the first time zone time are stored in an associated manner, which can synchronize the time zone time only when the target event occurs and store the time zone time when the target event occurs in an associated manner, which is beneficial to saving computing resources and does not affect recording the time zone time when the event occurs. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 FIG. is an optional structural schematic diagram of an event time recording system provided by an embodiment of the present application;
[0043] Figure 2 FIG. is an optional structural schematic diagram of a power supply device provided by an embodiment of the present application;
[0044] Figure 3 FIG. is an optional flowchart of an event time recording method provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0045] In order to make the objectives, technical solutions, and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be construed as limiting the present application. All other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the scope of protection of the present application.
[0046] In the following description, reference is made to "some embodiments", which describe a subset of all possible embodiments. However, it can be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments and can be combined with each other without conflict.
[0047] In the following description, the terms "first / second / third" are merely used to distinguish similar objects and do not represent a specific order for the objects. It can be understood that "first / second / third" can be interchanged with a specific order or sequence when allowed, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0048] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0049] Before further elaborating on the embodiments of the present application, the nouns and terms involved in the embodiments of the present application are described. The nouns and terms involved in the embodiments of the present application are applicable to the following explanations.
[0050] The embodiments of the present application provide an event time recording method, device, electronic device, and computer-readable storage medium, which can save device computing resources without affecting the recording of event time.
[0051] First, the event time recording system provided by the embodiments of the present application is described. Refer to Figure 1 , Figure 1 FIG. is an optional structural schematic diagram of the event time recording system 100 provided by the embodiments of the present application. To support an event time recording application, device 101 is connected to external device 103 through network 102. In the embodiments of the present application, device 101 can be applied to military scenarios. Specifically, device 101 can be a power device, such as an uninterruptible power supply (UPS), a DC power inverter, a photovoltaic device, or an industrial machine. In some embodiments, device 101 can be a terminal or a server. External device 103 can also be a terminal or a server. External device 103 can obtain the time zone time in real time, and device 101 can obtain the time zone time through the communication of external device 103. Among them, the terminal can be a laptop computer, a tablet computer, a desktop computer, a smart phone, a dedicated messaging device, a portable gaming device, a smart speaker, a smart watch, etc., but is not limited thereto. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery network (CDN) services, and big data and artificial intelligence platforms. Network 102 can be a wide area network or a local area network, or a combination of the two. In one embodiment, network 102 can be a CAN network. Device 101 and external device 103 can be directly or indirectly connected through wired or wireless communication methods, which are not limited in the embodiments of the present application.
[0052] Next, the power device for implementing the above event time recording method provided by the embodiments of the present application is described. Refer to Figure 2 , Figure 2 FIG. is an optional structural schematic diagram of the power device 200 provided by the embodiments of the present application. In practical applications, the power device 200 can be implemented as Figure 1 the device 101 in, and the power device for implementing the event time recording method of the embodiments of the present application is described below.
[0053] Figure 2 The power supply device 200 shown includes: a power converter 204, at least one processor 201, and a memory 202. Each component in the power supply device 200 is coupled together through a bus system 203. It can be understood that the bus system 203 is used to achieve connection communication between these components. In addition to including a data bus, the bus system 203 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clear illustration, in Figure 2 all kinds of buses are labeled as the bus system 203.
[0054] The power converter 204 is used to convert the input electrical energy of the first format into the output electrical energy of the second format. Specifically, it can be an AC-DC converter that inputs alternating current and outputs direct current; a DC-DC converter that inputs direct current and outputs direct current, an AC-AC converter that inputs alternating current and outputs alternating current, a DC-AC converter that inputs direct current and outputs alternating current, etc. The power converter 204 can be a conversion circuit, or can be composed of multiple conversion circuits connected in series or in parallel, which is not limited here. According to different power converters, different power supply devices are formed, such as UPS, photovoltaic inverters, DC power supplies, etc. It can be understood that the event time recording method or device proposed by the present invention can be used in any of the above power supply devices or other electronic devices, and will not change due to different power converters.
[0055] The processor 201 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP, Digital Signal Processor), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0056] The memory 202 can be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memories, hard disk drives, optical disc drives, etc. The memory 202 optionally includes one or more storage devices that are physically located far from the processor 201.
[0057] The memory 202 includes volatile memory or non-volatile memory, and can also include both volatile and non-volatile memory. The non-volatile memory can be a read-only memory (ROM, Read Only Memory), and the volatile memory can be a random access memory (RAM, Random Access Memory). The memory 202 described in the embodiments of the present application is intended to include any suitable type of memory.
[0058] In some embodiments, the memory 202 is capable of storing data to support various operations. Examples of such data include programs, modules, and data structures, or subsets or supersets thereof. In the embodiments of the present application, the operating system 2021 and the event time recording device 2022 are stored in the memory 202. Specifically,
[0059] The operating system 2021 includes system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks.
[0060] In some embodiments, the event time recording device provided in the embodiments of the present application can be implemented in software. Figure 2 Shown is the event time recording device 2022 stored in the memory 202, which can be software in the form of a program and a plugin, etc. It includes the following software modules: a response module 20221, an acquisition module 20222, a processing module 20223, and a storage module 20224. These modules are logical, so they can be combined arbitrarily or further split according to the functions to be implemented. The functions of each module will be described below.
[0061] In other embodiments, the event time recording device provided in the embodiments of the present application can be implemented in hardware. As an example, the event time recording device provided in the embodiments of the present application can be a processor in the form of a hardware decoding processor, which is programmed to execute the event time recording method provided in the embodiments of the present application. For example, a processor in the form of a hardware decoding processor can employ one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.
[0062] Next, the event time recording method provided in the embodiments of the present application will be described in conjunction with the exemplary applications and implementations of the power supply device provided in the embodiments of the present application.
[0063] See Figure 3 , Figure 3 which is an optional flowchart of the event time recording method provided in the embodiments of the present application, and will be described in conjunction with the steps shown in Figure 3 .
[0064] Step 301: In response to a target event, obtain the first running time of the device when the target event occurs;
[0065] Step 302: Obtain a second running time and a second time zone time that are synchronized in time, where the second time zone time is obtained from an external device;
[0066] Step 303: Based on the second running time and the second time zone time, perform time synchronization processing on the first running time to obtain a first time zone time synchronized with the first running time;
[0067] Step 304: Associatively store the first running time and the first time zone time to record the occurrence time of the target event;
[0068] Wherein, the first running time and the second running time represent the running duration of the device, the first time zone time and the second time zone time are the reference times of the time zone to which the geographical location of the device belongs, and the external device has the same time zone as the geographical location corresponding to the device.
[0069] In the embodiments of the present application, the running time of the device represents the running duration of the device, which is recorded inside the device in a counting manner. After the device stops midway, the time record can be the running duration before the cumulative stop or the running duration after re - counting. The data type of the time record is a numerical value, for example, represented in binary form in the device. The byte length of the running time record can be set according to the device's needs. Exemplarily, it is set to N bytes. For example, the running time is set to 4 bytes. The maximum running time that 4 bytes can record is (2 32 - 1) unit times of running time. If one unit is 1 us, 4 bytes can ensure that the device runs continuously for about 50 days, and 5 bytes can record about 35 years. If a longer period needs to be recorded, more bytes can be used. The time zone time is a data type that is convenient for users to read, such as the date - time type. Exemplarily, the time zone time can be, for example, "2024 / 12 / 03,14:00", indicating 14:00 on December 3, 2024. Here, the time zone time requires at least 12 bytes to represent.
[0070] During the operation of the device, most of the time, users do not need to pay attention to the time recorded by the device. Only in very few cases do they need to obtain the time. For example, when the device fails, they need to use the fault recording function to find the waveforms recorded before and after a certain moment to analyze the cause of the fault and solve the fault. In this embodiment, the running duration is recorded in a way that occupies less resources, i.e., by counting numerical values, and when the user needs to obtain the device time, the counting numerical value is converted into a readable time zone time, avoiding resource occupation caused by the device directly recording in the complete time zone time while meeting the user's readability requirements.
[0071] In actual implementation, the device, in response to a target event, obtains the first running time of the device when the target event occurs. Here, the first running time represents the running duration of the device when the target event occurs. In the embodiments of the present application, the running time of the device starts counting from when the device is first powered on and runs, and the starting time of counting is 0. The running time of the device can be stored when a certain condition is triggered, such as when the device fails, when the device is powered on, or when the device is powered off. The running time of the device can also be stored once every running time storage period. Here, the running time storage period can be, for example, 10 hours. In some embodiments, the target event can be abnormal operation of the device, power-on of the device, or receipt of a time synchronization instruction. Here, the time synchronization instruction can be issued by a user. Specifically, it can be issued by the user to the device through an input device, or can be issued to the device by another device communicating with the device. In some embodiments, the time synchronization instruction can also be generated by the device, for example, generated after meeting the time synchronization condition under some time synchronization policies. Or, the time synchronization instruction can also be generated by another device in response to the corresponding time synchronization condition and sent to the device.
[0072] In actual implementation, when the device responds to a target event and obtains the first running time, it can immediately start performing time synchronization on the first running time, that is, synchronizing the first running time with the time zone time when the target event occurs. Specifically, after the device starts performing time synchronization on the first running time, it can obtain a second running time and a second time zone time that are synchronized in time. Here, the second running time is the running duration corresponding to a certain moment during the operation of the device, which can be less than the first running time or greater than the first running time. The second time zone time is the time zone time that is synchronized in time with the second running time, and it is obtained from an external device communicatively connected to the device. In a specific implementation scenario, the second running time and the second time zone time are obtained at the same moment.
[0073] Then, based on the second running time and the second time zone time, the device performs time synchronization processing on the first running time to obtain a first time zone time that is synchronized in time with the first running time. Here, specifically, the first running time can be processed for time synchronization through the following formula (1) to obtain the first time zone time T 1 ′:
[0074] T 1 ′=(T 1 -T 2 )+T 2 ; (1)
[0075] Wherein, T 1 is the first running time, T 2 is the second running time, and T 2 ′ is the second time zone time.
[0076] In actual implementation, after obtaining the time of the first time zone, the first running time is associated and stored with the time of the first time zone. Here, it can be stored locally on the device. In some embodiments, it can also be stored in an external storage device communicatively connected to the device.
[0077] In actual implementation, based on the running time of the device, the running parameters of the device within the time period before and after the occurrence of the target event can also be obtained, the time period is converted into a corresponding time zone time period, and based on the time zone time period and the running parameters of the device, a parameter waveform diagram is constructed, and through the parameter waveform diagram, the changes in the running parameters of the device before and after the occurrence of the target event and the relationship between the running parameters of the device and time can be more intuitively and specifically displayed, so as to facilitate the analysis of the cause of the occurrence of the target event. Here, the target event can be an abnormal operation of the device, such as a device failure.
[0078] In the embodiments of the present application, by responding to the target event, obtaining the first running time of the device when the target event occurs, then obtaining the second running time and the second time zone time that are synchronized in time, based on the second running time and the second time zone time, performing time synchronization processing on the first running time to obtain the first time zone time synchronized with the first running time, and associatively storing the first running time and the first time zone time, it is possible to synchronize the time zone time only when the target event occurs and associatively store the time zone time when the target event occurs, which is beneficial to saving computing resources and does not affect recording the time zone time when the event occurs. In addition, since the number of bytes of the running time is less than that of the time zone time, the running time occupies less storage space than the time zone time, avoiding the real-time acquisition and storage frequency of the time zone time from an external device, and further saving the storage resources of the device.
[0079] In some embodiments, step 302 can be implemented in the following manner: obtaining the second running time of the device at the same moment and obtaining the second time zone time from an external device; or obtaining the second running time and the second time zone time that are associatively stored from the device.
[0080] In actual implementation, after the device obtains the first running time, at the same moment, the device obtains the second running time of the device and obtains the second time zone time from an external device. Here, the second running time is later than the first running time. Specifically, the device obtains the second running time from the timer of the running time and accesses the external device at the same moment to obtain the second time zone time from the external device. In one embodiment, the device can also directly obtain the second running time and the second time zone time that are associatively stored from the device. Here, the second running time and the second time zone time have been pre-stored in the device, and the second running time is earlier than the first running time.
[0081] In some embodiments, the method further includes: in response to the arrival of a time period, obtaining the running time of the device and obtaining the time zone time from an external device; associatively storing the running time and the time zone time.
[0082] In actual implementation, the device also performs time synchronization processing periodically. Specifically, when the time period arrives, the running time of the device is obtained, and at the same time, the time zone time is obtained from an external device, and the obtained running time and the time zone time are associatively stored. Here, the time period can be, for example, 10 minutes. By performing time synchronization periodically, excessive resource waste caused by real-time time synchronization processing can be avoided, and a time reference can be provided for the device within a certain range.
[0083] In some embodiments, step 302 can be implemented in the following manner: from multiple sets of running times and time zone times associatively stored in the device, determining the running time with the smallest time difference from the first running time and the time zone time associated with the determined running time; respectively determining the determined running time and the time zone time as the second running time and the second time zone time.
[0084] In actual implementation, multiple sets of running times and time zone times can be associatively stored in the device. It should be understood that the associatively stored running times and time zone times are synchronized in time. The device can select the set of running time and time zone time closest to the fault time from multiple sets of associatively stored running times and time zone times as the second running time and the second time zone time respectively. By determining the running time with the smallest difference from the first running time and the time zone time corresponding to the running time from the multiple sets of already stored running times and time zone times, and using them as the second running time and the time zone time respectively, it is possible to avoid using a time that is too different from the fault time as the time synchronization reference for the fault time, resulting in a large time synchronization error.
[0085] In some embodiments, after associatively storing the running time and the time zone time, it includes: obtaining the third running time and the third time zone time associatively stored; calculating the target running time that is different from the third running time by the difference between the time zone time and the third time zone time; if the target running time is inconsistent with the running time, updating the running time associatively stored with the time zone time to the target running time.
[0086] In actual implementation, after performing periodic time synchronization processing, the accuracy of the running time is also judged. Specifically, when the time period arrives, after the device obtains the running time and the time zone time, it also obtains the associated and stored third running time and the third time zone time, calculates the difference between the time zone time and the third time zone time, and based on this difference, calculates the target running time that is different from the third running time by this difference. If the target running time is consistent with the running time obtained when this time period arrives, it is determined that the running time measurement of the device is accurate. If the target running time is inconsistent with the running time obtained when this time period arrives, it is determined that the running time measurement of the device is inaccurate, the running time obtained when this time period arrives is modified to the target running time, and the target running time and the time zone time obtained in this cycle are associated and stored.
[0087] In some embodiments, the method further includes: adjusting the current running time of the device based on the target running time, so that the device measures the running time based on the adjusted current running time.
[0088] In actual implementation, the device also corrects the measurement of the running time. Specifically, after determining that the target running time is inconsistent with the running time, the current running time of the device is adjusted based on the target running time, so that the device measures the running time based on the adjusted current running time. Here, the adjustment method can specifically be to obtain the current time zone time from an external device, calculate the time difference between the current time zone time and the time zone time corresponding to the target running time, and determine the sum of this time difference and the target running time as the current running time. In some embodiments, after the device periodically performs time synchronization processing for the running time and the time zone time, it may not store the running time and the time zone time, but only use them to correct the running time of the device. Alternatively, the device can perform time synchronization processing for the running time every other running time storage cycle, and associate and store the running time and the time zone time.
[0089] Next, the exemplary structure of the event time recording device 2022 provided in the embodiment of the present application implemented as a software module will be continued. In some embodiments, as Figure 2 shown, the software module stored in the event time recording device 2022 in the memory 202 may include:
[0090] A response module 20221, configured to obtain the first running time of the device when a target event occurs in response to the target event;
[0091] An obtaining module 20222, configured to obtain a second running time and a second time zone time that are synchronized in time, where the second time zone time is obtained from an external device;
[0092] A processing module 20223 for performing time synchronization processing on the first running time based on the second running time and the second time zone time to obtain a first time zone time synchronized with the first running time;
[0093] A storage module 20224 for associatively storing the first running time and the first time zone time to record the occurrence time of the target event;
[0094] Wherein, the first running time and the second running time represent the running duration of the device, the first time zone time and the second time zone time are the reference times of the time zone to which the geographical location of the device belongs, and the external device has the same time zone as the geographical location corresponding to the device.
[0095] In some embodiments, the obtaining module 20222 is further configured to obtain the second running time of the device at the same moment and obtain the second time zone time from an external device; or obtain the second running time and the second time zone time stored associatively in the device.
[0096] In some embodiments, the device further includes: a periodic response module for, in response to the arrival of a time period, obtaining the running time of the device and obtaining the time zone time from an external device; associatively storing the running time and the time zone time.
[0097] In some embodiments, the obtaining module 20222 is further configured to determine, from multiple groups of running times and time zone times stored associatively in the device, the running time with the smallest time difference from the first running time and the time zone time associated with the determined running time; determine the determined running time and time zone time as the second running time and the second time zone time respectively.
[0098] In some embodiments, the device further includes: an update module for obtaining the third running time and the third time zone time stored associatively; calculating a target running time that differs from the third running time by the difference between the time zone time and the third time zone time; if the target running time is inconsistent with the running time, updating the running time associated with the time zone time to the target running time.
[0099] In some embodiments, the device further includes: an adjustment module for adjusting the current running time of the device based on the target running time so that the device performs running time counting based on the adjusted current running time.
[0100] In some embodiments, the target event is that the device runs abnormally, the device is powered on, or a time synchronization instruction is received.
[0101] It should be noted that the description of the device in the embodiments of the present application is similar to the description of the above method embodiments, and has similar beneficial effects to the method embodiments, so it will not be elaborated here.
[0102] The embodiments of the present application provide an electronic device, including: a memory for storing executable instructions; a processor for implementing the event time recording method provided by the embodiments of the present application when executing the executable instructions stored in the memory. Here, the electronic device may be implemented as the power supply device provided by the embodiments of the present application.
[0103] The embodiments of the present application provide a computer program product, which includes computer instructions stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the event time recording method described above in the embodiments of the present application.
[0104] The embodiments of the present application provide a computer-readable storage medium storing executable instructions, where the executable instructions are stored, and when the executable instructions are executed by a processor, the processor will be caused to execute the event time recording method provided by the embodiments of the present application.
[0105] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disc, or CD-ROM; or may be various devices including one or any combination of the above memories.
[0106] In some embodiments, the executable instructions may be in the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including being deployed as an independent program or being deployed as a module, component, subroutine, or other unit suitable for use in a computing environment.
[0107] As an example, the executable instructions may or may not correspond to a file in the file system, and may be stored as a part of a file storing other programs or data. For example, they may be stored in one or more scripts in a Hyper Text Markup Language (HTML) document, stored in a single file dedicated to the program being discussed, or stored in multiple cooperating files (for example, files storing one or more modules, subroutines, or code portions).
[0108] As an example, the executable instructions may be deployed to execute on one computing device, or on multiple computing devices located at one location, or on multiple computing devices distributed across multiple locations and interconnected by a communication network.
[0109] In summary, through the embodiments of the present application, it is possible to save device computing resources without affecting the recording event time.
[0110] As described above, the above are only embodiments of the present application and are not intended to limit the protection scope of the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and scope of the present application are included in the protection scope of the present application.
Claims
1. A method for recording event time, characterized in that: include: In response to a target event, obtaining a first running time of a device when the target event occurs; Obtaining a second operating time and a second time zone time that are synchronized in time, wherein the second time zone time is obtained from an external device; Based on the second running time and the second time zone time, performing time synchronization processing on the first running time to obtain a first time zone time synchronized with the first running time; storing the first running time and the first time zone time in association with each other to record the occurrence time of the target event; Among them, the first operating time and the second operating time represent the operating time of the device, the first time zone time and the second time zone time are the reference time of the time zone to which the device is located, and the time zone corresponding to the geographical location of the external device is the same as that of the device.
2. The method according to claim 1, characterized in that The step of obtaining the second operating time and the second time zone time that are synchronized in time includes: At the same time, obtaining a second operating time of the device and obtaining a second time zone time from an external device; or, The second operating time and the second time zone time stored in association are obtained from the device.
3. The method according to claim 2, characterized in that The method further comprises: In response to the arrival of the time period, obtaining the running time of the device and obtaining the time zone time from an external device; The running time and the time zone time are associated and stored.
4. The method according to claim 3, characterized in that: The step of acquiring the second operating time and the second time zone time associated and stored from the device includes: Determine, from among the plurality of sets of operating times and time zone times associated and stored in the device, an operating time having a minimum time difference with the first operating time, and a time zone time associated with the determined operating time; The determined running time and time zone time are respectively determined as the second running time and the second time zone time.
5. The method according to claim 3, characterized in that: After the running time and the time zone time are stored in association, the method includes: Obtaining the third running time and the third time zone time associated with the storage; Based on the difference between the time zone time and the third time zone time, calculating a target running time that differs from the third running time by the difference; If the target running time is inconsistent with the running time, the running time stored in association with the time zone time is updated to the target running time.
6. The method according to claim 5, characterized in that The method further comprises: The current running time of the device is adjusted based on the target running time, so that the device measures the running time based on the adjusted current running time.
7. The method according to any one of claims 1 to 6, characterized in that: The target event is abnormal operation of the device, powering on of the device, or receiving a time synchronization instruction.
8. An event time recording device, characterized in that: include: A response module, configured to respond to a target event and obtain a first running time of a device when the target event occurs; An acquisition module, used for acquiring a second running time and a second time zone time which are synchronized in time, wherein the second time zone time is acquired from an external device; a processing module, configured to perform time synchronization processing on the first running time based on the second running time and the second time zone time, so as to obtain a first time zone time synchronized with the first running time; A storage module, used for storing the first running time and the first time zone time in association with each other; Among them, the first operating time and the second operating time represent the operating time of the device, the first time zone time and the second time zone time are the reference time of the time zone to which the device is located, and the time zone corresponding to the geographical location of the external device is the same as that of the device.
9. A power supply device, characterized in that: include: A power converter, used for converting input electric energy of a first standard into electric energy of a second standard; And the event time recording device as claimed in claim 8.
10. An electronic device, characterized in that: include: A memory for storing executable instructions; The processor is used to implement the event time recording method as described in any one of claims 1 to 7 when executing the executable instructions stored in the memory.