CN110502216B - Method and terminal for recording log time of software architecture - Google Patents

Method and terminal for recording log time of software architecture Download PDF

Info

Publication number
CN110502216B
CN110502216B CN201910764976.9A CN201910764976A CN110502216B CN 110502216 B CN110502216 B CN 110502216B CN 201910764976 A CN201910764976 A CN 201910764976A CN 110502216 B CN110502216 B CN 110502216B
Authority
CN
China
Prior art keywords
layer
time
standard time
time difference
standard
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.)
Active
Application number
CN201910764976.9A
Other languages
Chinese (zh)
Other versions
CN110502216A (en
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.)
Hangzhou Zhongzhuo Information Technology Co ltd
Original Assignee
Hangzhou Zhongzhuo Information Technology 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 Hangzhou Zhongzhuo Information Technology Co ltd filed Critical Hangzhou Zhongzhuo Information Technology Co ltd
Priority to CN201910764976.9A priority Critical patent/CN110502216B/en
Publication of CN110502216A publication Critical patent/CN110502216A/en
Application granted granted Critical
Publication of CN110502216B publication Critical patent/CN110502216B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/1805Append-only file systems, e.g. using logs or journals to store data
    • G06F16/1815Journaling file systems
    • 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)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention provides a method for recording the log time of a software architecture, which comprises the following steps: acquiring the standard time of the layer of the log record of each layer in N layers of the software architecture; calculating the optimal standard time according with all layers according to the standard time of the layer of each layer; and recording the log time of each layer according to the optimal standard time. According to the invention, an optimal standard time is used as the standard time of each layer in the software architecture, so that the standard time referred by the recording of the log time of each layer in the software architecture has no time difference, the recording of the log time of each layer in the software architecture is simplified, and the recording efficiency of the log time of each layer in the software architecture is improved.

Description

Method and terminal for recording log time of software architecture
Technical Field
The invention belongs to the technical field of communication, and particularly relates to a method and a terminal for recording log time of a software architecture.
Background
Software architecture (software architecture) is a set of interrelated abstract patterns used to guide the design of various aspects of a large software system. The software architecture is multi-level, which typically includes: an application layer, a middle layer, a hardware abstraction layer, a driver layer, etc. However, each level is operationally asynchronous and their log times must be computed separately and independently.
Generally, in a software system designed under the guidance of a software architecture, for example, a bluetooth system of a mobile terminal, the logging of the logging time of each layer of the software architecture is recorded by using different standard times, so that there is a time difference necessarily between the standard times referred by the logging of the logging time of each layer, which complicates the logging of the logging time of each layer, and thus the logging efficiency of the logging time of each layer is low.
Disclosure of Invention
In order to solve the above-mentioned problems of the prior art, an object of the present invention is to provide a method and a terminal for recording log time in a software architecture that records log time by using uniform standard time.
According to an aspect of the present invention, there is provided a method for recording a log time of a software architecture, the method comprising: acquiring local layer standard time of log records of each layer in N layers of a software architecture; calculating the optimal standard time according with all layers according to the standard time of the layer of each layer; and recording the log time of each layer according to the optimal standard time.
Further, the specific method for calculating the optimal standard time meeting all layers according to the initial standard time of each layer comprises the following steps: acquiring the time difference between the layer standard time of each layer and the layer standard time of each layer based on the layer standard time of each layer; acquiring a time difference comparison value of the layer standard time corresponding to each layer according to the time difference; and determining the optimal standard time according to the time difference comparison value of the standard time of the layer corresponding to each layer.
Further, the specific method for obtaining the time difference between the layer standard time of each layer and the layer standard time of each layer based on the layer standard time of each layer includes: acquiring the time difference between the layer standard time of each layer in the N layers and the layer standard time of the ith layer based on the layer standard time of the ith layer, thereby acquiring N time differences corresponding to the layer standard time of the ith layer; wherein i is more than or equal to 1 and less than or equal to N.
Further, the specific method for obtaining the time difference comparison value of the layer standard time corresponding to each layer according to the time difference includes: and carrying out absolute value summation operation on the N time differences corresponding to the layer standard time of the ith layer to obtain a time difference comparison value corresponding to the layer standard time of the ith layer.
Optionally, the specific method for obtaining the time difference comparison value of the layer standard time corresponding to each layer according to the time difference includes: respectively carrying out absolute value calculation on N time differences corresponding to the layer standard time of the ith layer to obtain N time difference absolute values corresponding to the layer standard time of the ith layer; and determining the minimum value of the N absolute values of the time difference as a comparison value of the time difference of the standard time of the layer corresponding to the ith layer.
Optionally, the specific method for obtaining the time difference comparison value of the layer standard time corresponding to each layer according to the time difference includes: respectively carrying out absolute value operation on N time differences corresponding to the layer of standard time of the ith layer to obtain N time difference absolute values corresponding to the layer of standard time of the ith layer; and calculating the time difference absolute value variance of the local standard time corresponding to the ith layer according to the N time difference absolute values of the local standard time corresponding to the ith layer, and taking the time difference absolute value variance as a time difference comparison value of the local standard time corresponding to the ith layer.
Optionally, the specific method for obtaining the time difference comparison value of the layer standard time corresponding to each layer according to the time difference includes: respectively carrying out absolute value calculation on N time differences corresponding to the layer standard time of the ith layer to obtain N time difference absolute values corresponding to the layer standard time of the ith layer; and calculating the standard deviation of the absolute value of the time difference of the layer standard time corresponding to the ith layer according to the N absolute values of the time difference of the layer standard time corresponding to the ith layer, and taking the standard deviation of the time difference as the comparison value of the time difference of the layer standard time corresponding to the ith layer.
Further, the specific method for determining the optimal standard time according to the time difference comparison value of the standard time of the current layer corresponding to each layer comprises the following steps: determining the minimum value of the time difference comparison value of the layer standard time corresponding to each layer in the N layers; and determining the standard time of the current layer corresponding to the minimum value as the optimal standard time.
According to another aspect of the present invention, there is also provided a computer readable storage medium, on which a recording program of a logging time of a software architecture is stored, the recording program, when executed by a processor, implementing the method of recording the logging time of the software architecture as described above.
According to still another aspect of the present invention, there is provided a terminal, including a memory, a processor, and a recording program of log time of a software architecture stored on the memory and executable on the processor, wherein the recording program, when executed by the processor, implements the method of recording log time of a software architecture as described above.
The invention has the beneficial effects that: according to the invention, an optimal standard time is used as the standard time of each layer in the software architecture, so that the standard time referred by the recording of the log time of each layer in the software architecture has no time difference, the recording of the log time of each layer in the software architecture is simplified, and the recording efficiency of the log time of each layer in the software architecture is improved.
Drawings
The above and other aspects, features and advantages of embodiments of the present invention will become more apparent from the following description taken in conjunction with the accompanying drawings, in which:
FIG. 1 is a flow diagram of a method of logging time of a software architecture according to an embodiment of the invention;
FIG. 2 is a flow chart of a method of calculating an optimal standard time according to an embodiment of the present invention;
FIG. 3 is a flowchart of a method for obtaining a comparison value of time difference of the standard time of the current floor corresponding to each floor according to the time difference according to another embodiment of the present invention;
FIG. 4 is a flowchart of a method for obtaining a comparison value of time difference of standard time of the current layer corresponding to each layer according to the time difference according to another embodiment of the present invention;
FIG. 5 is a flowchart of a method for obtaining a comparison value of time difference of standard time of the current layer corresponding to each layer according to the time difference according to another embodiment of the present invention;
FIG. 6 is a flow chart of a method of determining an optimal standard time according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a terminal according to an embodiment of the present invention.
Detailed Description
Hereinafter, specific embodiments of the present invention will be described in detail with reference to the accompanying drawings. This invention may, however, be embodied in many different forms and should not be construed as limited to the specific embodiments set forth herein. Rather, these embodiments are provided to explain the principles of the invention and its practical application to thereby enable others skilled in the art to understand the invention for various embodiments and with various modifications as are suited to the particular use contemplated.
Although the software architecture is a design for guiding a software system, generally, the software system in the terminal may also include a software architecture composed of various levels. That is, in the present invention, the software architecture can also be considered as a software system included in a terminal to constitute the terminal, i.e., the terminal includes the software architecture.
Further, the software architecture of the terminal is multi-tiered, which typically includes: an application layer, a middle layer, a hardware abstraction layer, a driver layer, etc. As described in the background art, the logging of the logging time of each layer of the software architecture of the existing terminal respectively uses different standard times to record, so that the logging efficiency of the logging time is low. In order to solve this problem, an embodiment of the present invention proposes a unified standard time suitable for each level of a software architecture, and uses the unified standard time as a time standard for logging time records of each level, thereby improving the efficiency of logging time records of each level.
FIG. 1 is a flow chart of a method of logging time of a software architecture according to an embodiment of the invention.
Referring to fig. 1, the method for recording a log time of a software architecture according to an embodiment of the present invention includes step S110, step S120, and step S130. In the description of the present embodiment, for convenience of description, the software architecture of the terminal is configured by N layers, which may be, for example, the application layer, the middle layer, the hardware abstraction layer, the driver layer, and the like, as described above. Where N is a positive integer and is determined according to the actual conditions of the software system of the terminal.
In step S110, the local layer standard time of the log record of each of the N layers of the software architecture is obtained.
Here, since the layer of standard time (or the layer of time zone) of each layer is different, there is a time difference between the layer of standard time of each layer.
In step S120, the optimal standard time for all layers is calculated according to the standard time of the layer of each layer. That is, an optimal standard time of all layers according to the software architecture is calculated according to the standard time of the layer of each layer, namely N standard times of the layer.
Therefore, each layer in the N layers of the software architecture adopts the optimal standard time as a timing standard, and the log time of each layer is recorded in the unified standard time, so that the recording of the log time of each layer can be simplified, and the recording efficiency of the log time of each layer is improved.
In step S130, the log time of each layer is recorded according to the optimal standard time.
That is, an optimal standard time calculated in step S120 is used as the standard time of each layer, that is, each layer uses the same standard time zone for recording the log time, so that there is no time difference between the standard times referred by the log time records of each layer.
The following is a detailed description of a calculation method for calculating the optimal standard time for all layers based on the standard time of the layer. Fig. 2 is a flowchart of a method of calculating an optimal standard time according to an embodiment of the present invention.
Referring to fig. 2, the calculation method for calculating the optimal standard time to meet all layers according to the present layer standard time of each layer includes steps S210, S220, and S230.
Specifically, in step S210, based on the local standard time of each of the N layers of the software architecture, a time difference between the local standard time of each layer and the local standard time of each layer is obtained.
Here, the present layer standard time of the i-th layer of the N layers is set to Ti, where i =1, 2,3, … …, N. The time difference between the standard time Ti of the layer i and the standard time of each layer in the N layers is as follows: w (i, j) = Ti-Tj, where j =1, 2,3, … …, N.
For example, the time difference between the layer standard time T1 of the first layer and the layer standard time of each of the N layers is: w (1,1) = T1-T1, W (1,2) = T1-T2, W (1,3) = T1-T3, … …, W (1,N) = T1-TN.
The time difference between the standard time T2 of the second layer and the standard time of each layer in the N layers is as follows: w (2,1) = T2-T1, W (2,2) = T2-T2, W (2,3) = T2-T3, … …, W (2,N) = T2-TN.
The time difference between the standard time T3 of the layer at the third layer and the standard time of the layer at each layer in the N layers is as follows: w (3,1) = T3-T1, W (1,2) = T3-T2, W (3,3) = T3-T3, … …, W (3,N) = T3-TN.
And so on.
The time difference between the standard time TN of the layer N and the standard time TN of each layer in the layer N is as follows: w (N, 1) = TN-T1, W (N, 2) = TN-T2, W (N, 3) = TN-T3, … …, W (N, N) = TN-TN.
In this way, based on the local standard time of the ith layer, the time difference between the local standard time of each of the N layers and the local standard time of the ith layer is obtained, so that N time differences corresponding to the local standard time of the ith layer can be obtained, and further N time differences corresponding to the local standard time of each of the N layers can be obtained, which is specifically described above.
With continued reference to fig. 2, in step S220, a time difference comparison value of the layer standard time corresponding to each layer is obtained according to the time difference.
Specifically, as an embodiment of the present invention, a summation of absolute values of N time differences corresponding to the local layer standard time of the ith layer is performed to obtain a time difference comparison value corresponding to the local layer standard time of the ith layer. The method comprises the following specific steps:
e (1) = | W (1,1) | + | W (1,2) | + | W (1,3) | + … … + | W (1,N) |, wherein E (1) is a time difference comparison value corresponding to the layer standard time of the first layer.
E (2) = | W (2,1) | + | W (2,2) | + | W (2,3) | + … … + | W (2,N) |, where E (2) is a time difference comparison value corresponding to the layer standard time of the second layer.
E (3) = | W (3,1) | + | W (3,2) | + | W (3,3) | + … … + | W (3,N) |, wherein E (3) is a time difference comparison value corresponding to the present layer standard time of the third layer.
And so on.
E (N) = | W (N, 1) | + | W (N, 2) | + | W (N, 3) | + … … + | W (N, N) |, where E (N) is the time difference comparison value of the layer standard time corresponding to the nth layer.
Here, in this embodiment, the time difference between each layer and the corresponding layer (for example, the ith layer, which is the corresponding layer) is comprehensively considered in calculating the time difference comparison value of the layer standard time corresponding to each layer, so that the optimal standard time obtained from the time difference comparison value of the layer standard time corresponding to each layer is closer to the layer standard time of each layer, thereby reducing the time error.
Fig. 3 is a flowchart of a method for obtaining a time difference comparison value of the layer standard time corresponding to each layer according to the time difference according to another embodiment of the present invention. Referring to fig. 3, the method for obtaining a time difference comparison value of the present floor standard time corresponding to each floor according to the time difference according to another embodiment of the present invention includes steps S310 and S320.
Specifically, in step S310, the absolute value of each of the N time differences corresponding to the local standard time of the i-th layer is calculated to obtain N absolute values of the time difference corresponding to the local standard time of the i-th layer.
For example, the N absolute values of the time difference corresponding to the layer standard time of the first layer include: i W (1,1) |, | W (1,2) |, | W (1,3) |, … …, | W (1,N) |.
The N absolute values of the time difference corresponding to the layer standard time of the second layer include: i W (2,1) |, | W (2,2) |, | W (2,3) |, … …, | W (2,N) |.
The N absolute values of the time difference corresponding to the layer standard time of the third layer include: i W (3,1) |, | W (3,2) |, | W (3,3) |, … …, | W (3,N) |.
And so on.
The N absolute values of the time difference corresponding to the layer of standard time of the nth layer include: i W (N, 1) |, | W (N, 2) |, | W (N, 3) |, … …, | W (N, N) |.
In step S320, the minimum value of the N absolute values of the time difference is determined as the comparison value of the time difference corresponding to the standard time of the layer i.
For example, the minimum value of | W (1,1) |, | W (1,2) |, | W (1,3) |, … …, | W (1,N) | is determined as the time difference comparison value E (1) of the present layer standard time corresponding to the first layer.
The minimum value of | W (2,1) |, | W (2,2) |, | W (2,3) |, … …, | W (2,N) | is determined as the time difference comparison value E (2) of the standard time of the current layer corresponding to the second layer.
The minimum value of | W (3,1) |, | W (3,2) |, | W (3,3) |, … …, | W (3,N) | is determined as the time difference comparison value E (3) of the present layer standard time corresponding to the third layer.
And so on.
And determining the minimum value of the | W (N, 1) |, | W (N, 2) |, | W (N, 3) |, … … and | W (N, N) | as the time difference comparison value E (N) of the layer standard time corresponding to the Nth layer.
Fig. 4 is a flowchart of a method for obtaining a time difference comparison value of the layer standard time corresponding to each layer according to a time difference according to another embodiment of the present invention. Referring to fig. 4, the method for obtaining a time difference comparison value of the standard time of the current layer corresponding to each layer according to the time difference according to the further embodiment of the present invention includes steps S410 and S420.
Specifically, in step S410, the absolute value of each of the N time differences corresponding to the local standard time of the i-th layer is calculated to obtain N absolute values of the time difference corresponding to the local standard time of the i-th layer.
For example, the N absolute values of the time difference corresponding to the layer standard time of the first layer include: i W (1,1) |, | W (1,2) |, | W (1,3) |, … …, | W (1,N) |.
The N absolute values of the time difference corresponding to the layer standard time of the second layer include: i W (2,1) |, | W (2,2) |, | W (2,3) |, … …, | W (2,N) |.
The N absolute values of the time difference corresponding to the layer standard time of the third layer include: i W (3,1) |, | W (3,2) |, | W (3,3) |, … …, | W (3,N) |.
And so on.
The N absolute values of the time difference corresponding to the layer of standard time of the nth layer include: i W (N, 1) |, | W (N, 2) |, | W (N, 3) |, … …, | W (N, N) |.
In step S420, the time difference absolute value variance of the local standard time corresponding to the i-th floor is calculated from the N time difference absolute values of the local standard time corresponding to the i-th floor, and the time difference absolute value variance of the local standard time corresponding to the i-th floor is used as the time difference comparison value of the local standard time corresponding to the i-th floor.
E.g. local layer standard time for the first layer, its time difference absolute value variance
Figure BDA0002171648400000071
Expressed as:
Figure BDA0002171648400000072
wherein, mu 1 Represents the average of | W (1,1) |, | W (1,2) |, | W (1,3) |, … …, | W (1,N) |. Thus, the absolute value variance of the time difference of the standard time of the current layer corresponding to the first layer can be calculated. Further, the variance of the absolute value of the time difference of the layer standard time corresponding to the first layer
Figure BDA0002171648400000081
And determining the time difference comparison value of the standard time of the current layer corresponding to the first layer. />
The standard time of the second layer, the absolute value variance of the time difference
Figure BDA0002171648400000082
Expressed as:
Figure BDA0002171648400000083
wherein, mu 2 Represents the average of | W (2,1) |, | W (2,2) |, | W (2,3) |, … …, | W (2,N) |. In this way, the time difference absolute value variance of the layer standard time corresponding to the second layer can be calculated. Further, the variance of absolute value of time difference of the standard time of the layer corresponding to the second layer
Figure BDA0002171648400000084
And determining the time difference comparison value of the standard time of the current layer corresponding to the second layer.
The absolute value variance of time difference of the local standard time of the third layer
Figure BDA0002171648400000085
Expressed as:
Figure BDA0002171648400000086
wherein, mu 3 Representing | W (3,1) |, | W (3,2) Average of |, | W (3,3) |, … …, | W (3,N) |. Thus, the absolute value variance of the time difference corresponding to the standard time of the layer at the third layer can be calculated. Further, the variance of absolute value of time difference of the layer standard time corresponding to the third layer
Figure BDA0002171648400000087
And determining the time difference comparison value of the standard time of the current layer corresponding to the third layer.
And so on.
The standard time of the layer N, the absolute value variance of the time difference
Figure BDA0002171648400000088
Expressed as:
Figure BDA0002171648400000089
wherein, mu N Represents the average of | W (N, 1) |, | W (N, 2) |, | W (N, 3) |, … …, | W (N, N) |. In this way, the time difference absolute value variance of the layer standard time corresponding to the Nth layer can be calculated. Further, the variance of absolute value of time difference of the layer standard time corresponding to the Nth layer
Figure BDA00021716484000000810
And determining the time difference comparison value of the standard time of the layer corresponding to the Nth layer.
Here, since the time difference absolute value variance indicates the degree of deviation of the variable from the population mean, the smaller the variance, the smaller the degree of deviation of the variable from the population mean. For example,
Figure BDA00021716484000000811
the smaller the time difference, the more concentrated the representation | W (1,1) |, | W (1,2) |, | W (1,3) |, … …, | W (1,N) |, and further the smaller the time difference between the standard time of each layer and the standard time of the first layer. Therefore, the standard time of the layer corresponding to the minimum deviation degree (i.e., the minimum deviation) is used as the optimal standard time, and the time error is greatly reduced.
Fig. 5 is a flowchart of a method for obtaining a time difference comparison value of the standard time of the current layer corresponding to each layer according to the time difference according to still another embodiment of the present invention. Referring to fig. 5, the method for obtaining a time difference comparison value of the standard time of the current layer corresponding to each layer according to the time difference according to the further embodiment of the present invention includes steps S510 and S520.
Specifically, in step S510, the absolute value of each of the N time differences corresponding to the local standard time of the i-th layer is calculated to obtain N absolute values of the time difference corresponding to the local standard time of the i-th layer.
For example, the N absolute values of the time difference corresponding to the layer standard time of the first layer include: i W (1,1) |, | W (1,2) |, | W (1,3) |, … …, | W (1,N) |.
The N absolute values of the time difference corresponding to the layer standard time of the second layer include: i W (2,1) |, | W (2,2) |, | W (2,3) |, … …, | W (2,N) |.
The N absolute values of the time difference corresponding to the layer standard time of the third layer include: i W (3,1) |, | W (3,2) |, | W (3,3) |, … …, | W (3,N) |.
And so on.
The N absolute values of the time difference corresponding to the layer standard time of the nth layer include: i W (N, 1) |, | W (N, 2) |, | W (N, 3) |, … …, | W (N, N) |.
In step S520, the time difference absolute value standard deviation of the local standard time corresponding to the i-th floor is calculated from the N time difference absolute values of the local standard time corresponding to the i-th floor, and the time difference absolute value standard deviation of the local standard time corresponding to the i-th floor is used as the time difference comparison value of the local standard time corresponding to the i-th floor.
For example, the standard time of the layer with respect to the first layer has the standard deviation σ of the absolute value of the time difference 1 Expressed as:
Figure BDA0002171648400000091
wherein, mu 1 Represents the average of | W (1,1) |, | W (1,2) |, | W (1,3) |, … …, | W (1,N) |. Thus, canSo as to calculate the standard deviation of the absolute value of the time difference of the standard time of the current layer corresponding to the first layer. Further, the standard deviation sigma of the absolute value of the time difference of the standard time of the layer corresponding to the first layer 1 And determining the time difference comparison value of the standard time of the current layer corresponding to the first layer.
The standard time of the layer aiming at the second layer has the standard deviation sigma of the absolute value of the time difference 2 Expressed as:
Figure BDA0002171648400000101
wherein, mu 2 Represents the average of | W (2,1) |, | W (2,2) |, | W (2,3) |, … …, | W (2,N) |. Thus, the time difference absolute value standard deviation of the standard time of the current layer corresponding to the second layer can be calculated. Further, the standard deviation sigma of the absolute value of the time difference of the standard time of the layer corresponding to the second layer 2 And determining the time difference comparison value of the standard time of the current layer corresponding to the second layer.
For the standard time of the layer of the third layer, the absolute value standard deviation sigma of the time difference 3 Expressed as:
Figure BDA0002171648400000102
wherein, mu 3 Represents the average of | W (3,1) |, | W (3,2) |, | W (3,3) |, … …, | W (3,N) |. Thus, the standard deviation of the absolute value of the time difference of the standard time of the layer corresponding to the third layer can be calculated. Further, the standard deviation sigma of the absolute value of the time difference corresponding to the standard time of the layer of the third layer 3 And determining the time difference comparison value of the standard time of the current layer corresponding to the third layer.
And so on.
For the standard time of the layer N, the absolute value standard deviation sigma of the time difference N Expressed as:
Figure BDA0002171648400000103
wherein, mu N Represents an average value of | W (N, 1) |, | W (N, 2) |, | W (N, 3) |, … …, | W (N, N) |. Thus, the time difference absolute value standard deviation of the layer standard time corresponding to the Nth layer can be calculated. Further, the standard deviation sigma of the absolute value of the time difference of the standard time of the layer corresponding to the Nth layer N And determining the time difference comparison value of the standard time of the layer corresponding to the Nth layer.
Here, since the standard deviation of the absolute value of the time difference can represent the degree of deviation of the variable from the population mean more intuitively than the variance of the absolute value of the time difference, it is possible to easily represent the degree of deviation of the variable from the population mean. Furthermore, like the variance, σ 1 The smaller the time difference, the more concentrated the representation | W (1,1) |, | W (1,2) |, | W (1,3) |, … …, | W (1,N) |, and further the smaller the time difference between the standard time of each layer and the standard time of the first layer. Therefore, the standard time of the layer corresponding to the minimum deviation degree (i.e., the minimum deviation) is used as the optimal standard time, and the time error is greatly reduced.
With continued reference to fig. 2, in step S230, the optimal standard time is determined according to the time difference comparison value of the standard time of the current layer corresponding to each layer.
FIG. 6 shows a flow diagram of a method of determining an optimal standard time according to an embodiment of the invention.
Referring to fig. 6, the method of determining an optimal standard time according to an embodiment of the present invention includes steps S610 and S620.
Specifically, in step S610, the minimum value of the time difference comparison value of the layer standard time corresponding to each of the N layers is determined.
The method comprises the steps of obtaining a time difference comparison value of the layer of standard time corresponding to a first layer, a time difference comparison value of the layer of standard time corresponding to a second layer, a time difference comparison value of the layer of standard time corresponding to a third layer, … …, and a minimum value of N time difference comparison values according to the time difference comparison value of the layer of standard time corresponding to an Nth layer. The method for obtaining the time difference comparison value of the layer standard time corresponding to each layer refers to the description above, and is not described again.
In step S620, the current layer standard time corresponding to the minimum value is determined as the optimal standard time. For example, if the time difference comparison value corresponding to the local standard time of the first layer is the minimum, the local standard time of the first layer is set as the optimal standard time.
Fig. 7 is a schematic structural diagram of a terminal according to an embodiment of the present invention. Referring to fig. 7, the terminal includes, at a hardware level, a processor 710, an internal bus 720, a network interface 730, and a memory 740, but may also include hardware required for other services. The processor 710 reads the corresponding computer program from the memory 740 and then runs, forming a request processing means on a logical level. Of course, besides software implementation, the one or more embodiments in this specification do not exclude other implementations, such as logic devices or combinations of software and hardware, and so on, that is, the execution subject of the following processing flow is not limited to each logic unit, and may also be hardware or logic devices.
Further, the memory 740 stores thereon a logging program of the logging time of the software architecture, and the logging program, when executed by the processor, implements the logging method of the logging time of the software architecture as shown in fig. 1.
The terminal may take the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email messaging device, game console, tablet computer, wearable device, or a combination of any of these devices.
The memory may include forms of volatile memory in a computer readable medium, random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or Flash memory (Flash RAM). The memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of a computer-readable medium include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic disk storage, quantum memory, graphene-based storage media or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a … …" does not exclude the presence of another identical element in a process, method, article, or apparatus that comprises the element.
The foregoing description of specific embodiments has been presented for purposes of illustration and description. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The terminology used in the description of the one or more embodiments is for the purpose of describing the particular embodiments only and is not intended to be limiting of the description of the one or more embodiments. As used in one or more embodiments of the present specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used in one or more embodiments of the present description to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of one or more embodiments herein. The word "if," as used herein, may be interpreted as "at … …" or "at … …" or "in response to a determination," depending on the context.
The above description is only for the purpose of illustrating the preferred embodiments of the one or more embodiments of the present disclosure, and is not intended to limit the scope of the one or more embodiments of the present disclosure, and any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the one or more embodiments of the present disclosure should be included in the scope of the one or more embodiments of the present disclosure.

Claims (5)

1. A method for recording the log time of a software architecture is characterized by comprising the following steps:
acquiring local layer standard time of log records of each layer in N layers of a software architecture;
acquiring the time difference between the layer standard time of each layer in the N layers and the layer standard time of the ith layer based on the layer standard time of the ith layer, thereby acquiring N time differences corresponding to the layer standard time of the ith layer; wherein i is more than or equal to 1 and less than or equal to N;
acquiring a time difference comparison value of the layer standard time corresponding to each layer according to the time difference; the specific method for obtaining the time difference comparison value of the layer standard time corresponding to each layer according to the time difference comprises the following steps: carrying out absolute value summation operation on N time differences corresponding to the layer standard time of the ith layer to obtain a time difference comparison value corresponding to the layer standard time of the ith layer;
determining the minimum value of the time difference comparison value of the layer standard time corresponding to each layer in the N layers;
determining the standard time of the current layer corresponding to the minimum value as the optimal standard time;
and recording the log time of each layer according to the optimal standard time.
2. The recording method according to claim 1, wherein the specific method for obtaining the time difference comparison value of the layer standard time corresponding to each layer according to the time difference further comprises:
respectively carrying out absolute value calculation on N time differences corresponding to the layer standard time of the ith layer to obtain N time difference absolute values corresponding to the layer standard time of the ith layer;
and calculating the time difference absolute value variance of the local standard time corresponding to the ith layer according to the N time difference absolute values of the local standard time corresponding to the ith layer, and taking the time difference absolute value variance as a time difference comparison value of the local standard time corresponding to the ith layer.
3. The recording method according to claim 1, wherein the specific method for obtaining the time difference comparison value of the layer standard time corresponding to each layer according to the time difference further comprises:
respectively carrying out absolute value calculation on N time differences corresponding to the layer standard time of the ith layer to obtain N time difference absolute values corresponding to the layer standard time of the ith layer;
and calculating the standard deviation of the absolute value of the time difference of the layer standard time corresponding to the ith layer according to the N absolute values of the time difference of the layer standard time corresponding to the ith layer, and taking the standard deviation of the time difference as the comparison value of the time difference of the layer standard time corresponding to the ith layer.
4. A computer readable medium, characterized in that the computer readable medium has stored thereon a recording program of log time of a software architecture, and the recording program, when executed by a processor, implements the method for recording log time of a software architecture according to any one of claims 1 to 3.
5. A terminal, characterized in that the terminal comprises a memory, a processor and a logging program of logging time of a software architecture stored on the memory and executable on the processor, the logging program implementing a logging method of logging time of a software architecture according to any one of claims 1 to 3 when executed by the processor.
CN201910764976.9A 2019-08-19 2019-08-19 Method and terminal for recording log time of software architecture Active CN110502216B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910764976.9A CN110502216B (en) 2019-08-19 2019-08-19 Method and terminal for recording log time of software architecture

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910764976.9A CN110502216B (en) 2019-08-19 2019-08-19 Method and terminal for recording log time of software architecture

Publications (2)

Publication Number Publication Date
CN110502216A CN110502216A (en) 2019-11-26
CN110502216B true CN110502216B (en) 2023-04-07

Family

ID=68588606

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910764976.9A Active CN110502216B (en) 2019-08-19 2019-08-19 Method and terminal for recording log time of software architecture

Country Status (1)

Country Link
CN (1) CN110502216B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105099649A (en) * 2015-08-14 2015-11-25 宋亚玲 Method and system for synchronously inserting network time
US9430501B1 (en) * 2012-12-31 2016-08-30 Emc Corporation Time sanitization of network logs from a geographically distributed computer system
CN106484615A (en) * 2016-09-29 2017-03-08 青岛海信移动通信技术股份有限公司 The method and apparatus of log

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9697043B2 (en) * 2015-02-02 2017-07-04 Mediatek Inc. Methods and computer systems for performance monitoring of tasks
US10719100B2 (en) * 2017-11-21 2020-07-21 Western Digital Technologies, Inc. System and method for time stamp synchronization

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9430501B1 (en) * 2012-12-31 2016-08-30 Emc Corporation Time sanitization of network logs from a geographically distributed computer system
CN105099649A (en) * 2015-08-14 2015-11-25 宋亚玲 Method and system for synchronously inserting network time
CN106484615A (en) * 2016-09-29 2017-03-08 青岛海信移动通信技术股份有限公司 The method and apparatus of log

Also Published As

Publication number Publication date
CN110502216A (en) 2019-11-26

Similar Documents

Publication Publication Date Title
US20200334214A1 (en) Blockchain consensus method and device
EP3373155A1 (en) Data writing method and device in distributed file system
CN109144414B (en) Multi-level storage method and device for block chain data
US20160142369A1 (en) Service addressing in distributed environment
WO2017143914A1 (en) Method for training model using training data, and training system
CN110826894A (en) Hyper-parameter determination method and device and electronic equipment
US20180365339A1 (en) Application classification method and apparatus
CN109033365B (en) Data processing method and related equipment
CN111880956A (en) Data synchronization method and device
CN114780537A (en) Flow table storage and message forwarding method, device, computing equipment and medium
CN111737265A (en) Block data access method, block data storage method and device
CN110502216B (en) Method and terminal for recording log time of software architecture
US11797769B1 (en) Artificial intelligence system using hybrid technique for task-oriented dialog management
CN109829678B (en) Rollback processing method and device and electronic equipment
CN113849314A (en) Data processing model deployment method and device
CN116433050B (en) Abnormality alarm method and system applied to agricultural big data management system
JP6176404B2 (en) Document classification method
EP3945694B1 (en) Block data access method, block data storage method, and apparatuses thereof
US20100131938A1 (en) Recording medium encoded with update function verification program, update function verification method, and information processing device
CN113282535B (en) Quantization processing method and device and quantization processing chip
CN115525378A (en) Standardized construction method, system and storage medium for flow chart
CN115129590A (en) Test case generation method and device, electronic equipment and storage medium
CN111027592B (en) Fine-grained object flow analysis method and device
CN110688379B (en) Data storage method, system, storage medium and electronic equipment
CN113762526B (en) Federal learning method, hierarchical network system, storage medium and electronic device

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20230302

Address after: Block ABCD, 16/F, Building D, Paradise Software Park, No. 3, Xidoumen Road, Xihu District, Hangzhou City, Zhejiang Province, 310000

Applicant after: HANGZHOU ZHONGZHUO INFORMATION TECHNOLOGY Co.,Ltd.

Address before: 516006 Zhongkai hi tech Zone, Huizhou, Guangdong, 86 Chang seven Road West

Applicant before: HUIZHOU TCL MOBILE COMMUNICATION Co.,Ltd.

GR01 Patent grant
GR01 Patent grant