CN114116291B - Log detection method, log detection device, computer device and storage medium - Google Patents
Log detection method, log detection device, computer device and storage medium Download PDFInfo
- Publication number
- CN114116291B CN114116291B CN202210076430.6A CN202210076430A CN114116291B CN 114116291 B CN114116291 B CN 114116291B CN 202210076430 A CN202210076430 A CN 202210076430A CN 114116291 B CN114116291 B CN 114116291B
- Authority
- CN
- China
- Prior art keywords
- log
- number field
- log record
- field
- sequence number
- 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
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 62
- 238000000034 method Methods 0.000 claims abstract description 34
- 238000012360 testing method Methods 0.000 claims abstract description 30
- 230000008569 process Effects 0.000 claims abstract description 17
- 230000015654 memory Effects 0.000 claims description 24
- 230000006399 behavior Effects 0.000 claims description 10
- 230000009191 jumping Effects 0.000 claims description 2
- 230000009286 beneficial effect Effects 0.000 abstract description 6
- 238000010586 diagram Methods 0.000 description 4
- 230000007246 mechanism Effects 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 239000007787 solid Substances 0.000 description 3
- 230000006870 function Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000002085 persistent effect Effects 0.000 description 2
- 238000005070 sampling Methods 0.000 description 2
- 230000009471 action Effects 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 230000000295 complement effect Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000012812 general test Methods 0.000 description 1
- 238000007689 inspection Methods 0.000 description 1
- 238000007726 management method Methods 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000002688 persistence Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/0703—Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
- G06F11/0766—Error or fault reporting or storing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3692—Test management for test results analysis
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Hardware Design (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention provides a log detection method, a log detection device, a computer device and a storage medium. The log detection method comprises the following steps: and acquiring a log record of the firmware running under the current test case. And acquiring a sequence number field obtained by calling a log record interface from the log record, and judging whether the sequence number field meets the configuration of a specified field. And if the sequence number field does not meet the specified field configuration, determining that the log record is incomplete. In the method, the condition that partial log records are missing in the calling process of the log record interface can be determined by judging whether the serial number field meets the configuration of the designated field, and then when the serial number field does not meet the configuration of the designated field, the obtained log records can be rapidly determined to have no integrity, so that the integrity detection of the log records is more convenient and more beneficial to improving the detection efficiency.
Description
Technical Field
The invention relates to the technical field of computers, in particular to a log detection method, a log detection device, computer equipment and a storage medium.
Background
In the running process of the hard disk, the firmware records information such as events or states in a log generating mode. The hard disk may include an NVMe SSD hard disk. With the continuous operation of the hard disk, the firmware can generate logs continuously. But due to firmware software or hardware reasons, partial log records may be missed during operation.
In the related art, since the firmware software needs to call a plurality of modules when the hard disk runs, when the integrity of the log record is detected, developers of the modules automatically view the log record of the module.
However, due to the large number of service scenes and log record combinations, a sampling test mode is required to be adopted for detection during detection, and the detection result is inaccurate.
Disclosure of Invention
Therefore, the technical problem to be solved by the present invention is to overcome the defect in the prior art that when detecting the integrity of a log record, each service scene cannot be completely and accurately covered, thereby providing a log detection method, a log detection apparatus, a computer device, and a storage medium.
In a first aspect, the present invention provides a log detection method, the method comprising:
acquiring a log record of the firmware running under the current test case;
acquiring a sequence number field obtained by calling a log record interface from the log record, and judging whether the sequence number field meets the configuration of a specified field;
and if the sequence number field does not meet the configuration of the specified field, determining that the log record is incomplete.
In the method, the condition that partial log records are missing in the calling process of the log record interface can be determined by judging whether the serial number field meets the configuration of the designated field, and then when the serial number field does not meet the configuration of the designated field, the obtained log records can be rapidly determined to have no integrity, so that the integrity detection of the log records is more convenient and more beneficial to improving the detection efficiency.
With reference to the first aspect, in a first embodiment of the first aspect, the method further includes: and if the sequence number field meets the configuration of the specified field, determining that the log record is complete.
In this way, the condition that part of log records are missing in the calling process of the log record interface can be determined by judging whether the serial number field meets the configuration of the specified field, so that the integrity detection of the log records is more convenient, the detection efficiency is more favorably improved, and the labor cost is favorably saved.
With reference to the first aspect or the first embodiment of the first aspect, in a second embodiment of the first aspect, the obtaining a sequence number field of a call log record interface from the log record includes:
determining historical calling information of the logging interface;
determining a starting line of the serial number field according to the historical calling information;
and acquiring a serial number field of a call log record interface according to the start line.
With reference to the second embodiment of the first aspect, in a third embodiment of the first aspect, the determining a starting row of the sequence number field according to the historical invocation information includes:
and if the history ending behavior n of the serial number field in the history calling information is detected, the starting behavior n +1 of the serial number field is detected, wherein the n is a natural number.
With reference to the third embodiment of the first aspect, in a fourth embodiment of the first aspect, the specifying the field configuration includes sequentially incrementing the numerical values of bits in the field, and a numerical difference between adjacent bits is 1.
With reference to the first aspect, in a fifth embodiment of the first aspect, the determining whether the sequence number field satisfies a specified field configuration includes:
judging whether the sequence number field comprises a plurality of sub-sequence number fields;
if the sequence number field comprises a plurality of sub-sequence number fields, respectively judging whether each sub-sequence number field meets the configuration of a specified field.
With reference to the fifth embodiment of the first aspect, in a sixth embodiment of the first aspect, the determining that the log record is incomplete if the sequence number field does not satisfy the specified field configuration includes:
and if at least one sub-sequence number field does not meet the specified field configuration, determining that the log record is incomplete.
In a second aspect, the present invention also provides a log detection apparatus, comprising:
the acquisition unit is used for acquiring the log record of the firmware running under the current test case;
the judging unit is used for acquiring a serial number field obtained by calling a log record interface from the log record and judging whether the serial number field meets the configuration of a specified field;
a determining unit, configured to determine that the log record is incomplete if the sequence number field does not satisfy the specified field configuration.
With reference to the second aspect, in a first embodiment of the second aspect, the apparatus further comprises:
and the judging unit is used for determining that the log record is complete if the sequence number field meets the configuration of the specified field.
With reference to the second aspect or the first embodiment of the second aspect, in a second embodiment of the second aspect, the determining unit includes:
the first determining unit is used for determining the historical calling information of the log recording interface;
a second determining unit, configured to determine a starting row of the sequence number field according to the historical calling information;
and the obtaining subunit is used for obtaining a serial number field for calling a log record interface from the log record according to the starting line.
With reference to the second embodiment of the second aspect, in a third embodiment of the second aspect, the second determining unit includes:
and if the history ending behavior n of the serial number field in the history calling information is detected, determining the starting behavior n +1 of the serial number field, wherein n is a natural number.
With reference to the third embodiment of the second aspect, in a fourth embodiment of the second aspect, the specifying the field configuration includes sequentially incrementing the numerical value of each bit in the field, and a numerical difference between adjacent bits is 1.
With reference to the second aspect, in a fifth embodiment of the second aspect, the determining unit includes:
the first judging subunit is used for judging whether the sequence number field comprises a plurality of sub-sequence number fields or not;
and a second judging subunit, configured to, if the sequence number field includes multiple sub-sequence number fields, respectively judge whether each sub-sequence number field satisfies a specified field configuration.
With reference to the fifth embodiment of the second aspect, in a sixth embodiment of the second aspect, the determining unit includes:
a determining subunit, configured to determine that the log record is incomplete if at least one sub-sequence number field does not satisfy the specified field configuration.
According to a third aspect, the present invention further provides a computer device, which includes a memory and a processor, where the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the log detection method of any one of the first aspect and the optional embodiments thereof.
According to a fourth aspect, the present invention further provides a computer-readable storage medium, which stores computer instructions for causing a computer to execute the log detection method of any one of the first aspect and its optional embodiments.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a flowchart of a proposed log detection method according to an exemplary embodiment.
Fig. 2 is a flow chart of another proposed log detection method according to an example embodiment.
Fig. 3 is a block diagram of a log detection apparatus according to an exemplary embodiment.
Fig. 4 is a schematic diagram of a hardware structure of a computer device according to an exemplary embodiment.
Detailed Description
The technical solutions of the present invention will be described clearly and completely with reference to the accompanying drawings, and it should be understood that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the related art, since the firmware software needs to call a plurality of modules when the hard disk runs, when the integrity of the log record is detected, developers of the modules automatically view the log record of the module.
However, due to the large number of service scenes and log record combinations, a sampling test mode is required to be adopted for detection during detection, and the detection result is inaccurate.
In order to solve the foregoing problems, an embodiment of the present invention provides a log detection method, which is used in a computer device, and it should be noted that an execution main body of the log detection method may be a log detection apparatus, and the apparatus may be implemented in a software, hardware, or a combination of software and hardware to become a part or all of the computer device, where the computer device may be a terminal, a client, or a server, and the server may be one server or a server cluster composed of multiple servers, and the terminal in this embodiment of the present application may be another intelligent hardware device such as a smart phone, a personal computer, a tablet computer, a wearable device, and an intelligent robot. In the following method embodiments, the execution subject is a computer device as an example.
In the computer device in this embodiment, in order to detect whether the hard disk can meet the use requirements of the user when operating in different service scenarios and whether the hard disk needs to be adjusted or replaced, the hard disk is controlled to operate in different test cases capable of covering various service scenarios, so that the use conditions of the hard disk in the different test cases are determined according to the obtained log records, and the performance of the hard disk is further evaluated. In order to detect the integrity of the log record of the hard disk, the calling interfaces providing the log record externally are unified to obtain the log record interface, and then when the firmware software calls each module in the running process of the hard disk, the sub-log records corresponding to each module are uniformly output by the log record interface, so that the integral log record is obtained. By the log detection method provided by the invention, the condition that partial log records are lost in the calling process of the log record interface can be determined by judging whether the serial number field meets the configuration of the specified field, and further when the serial number field does not meet the configuration of the specified field, the obtained log records can be rapidly determined to have no integrity, so that the integrity detection of the log records is more convenient and more beneficial to improving the detection efficiency.
Fig. 1 is a flowchart of a proposed log detection method according to an exemplary embodiment. As shown in fig. 1, the log detection method includes the following steps S101 to S103.
In step S101, a log record of the firmware running under the current test case is obtained.
In the embodiment of the invention, in order to determine the use condition of the firmware under the current test case, the log record of the firmware running under the current test case is acquired, so that the call condition of the log record interface is determined through the log record.
In an example, the type of test case may include read-write tests, Trim (format) tests, and the like. The read-write test may include sequential read-write and random read-write. The specifically adopted test case can be the existing general test case, and can also be a specific test case with pertinence, and is not limited in the invention.
In an implementation scenario, the log record may be obtained through a Solid State Drive (SSD) tool. For example: with the nvme cli tool (a commonly used SSD tool), the command is derived from the log record: and (3) exporting the log record by nvme pci-get-log-d-b 0x, thereby obtaining the log record of the firmware when the firmware runs under the current test case. Where 0x1 denotes the PCIe bus number of the NVMe SSD hard disk.
In step S102, a sequence number field obtained by calling a log record interface is acquired from the log record, and whether the sequence number field satisfies a specified field configuration is determined.
In the embodiment of the invention, because the firmware needs to drive and call a plurality of modules in the running process of the firmware, and the sub-diary records of each module are output by the logging interface, whether the logging interface is called or not is recorded by a Serial Number (SN) field in order to make clear of the calling condition of the logging interface.
In one example, the SN field may be a string or may be binary data. The step size of the SN field may be a fixed length or a variable length, and the form of the SN field is not limited in the present invention. In one example, the SN field may determine the step size according to the actual condition of the firmware operation, and then increment by 1 according to the calling sequence of the logging interface. For example: a 32-bit or 64-bit integer, and if the step size is 32 bits, the maximum value of the integer is 4,294,967,295, i.e., 42 billion. The SN field may be a character string with a variable length, and may be sequentially incremented according to a First Input First Output (FIFO) queue and a mutex lock mechanism when encoding is performed, according to a call sequence of a log record interface. For example: each time the logging interface is called, the encoding value corresponding to the SN field is increased by 1, and the obtained sequence number field may be 0/1/2/3 … 43022.
In another example, the SN of the log record restarts recording the call sequence of the log record interface from 0 when the firmware is burned or updated.
The specified field configuration may be understood as a sequence for determining whether the acquired sequence number field satisfies the call requirement. If the sequence number field meets the configuration of the specified field, the process of calling the log record from the log record interface is represented to meet the call requirement, and the condition that partial log records are missing does not exist, so that the obtained log record can be determined to have integrity. If the sequence number field does not meet the configuration of the designated field, the process for representing calling out the log record from the log record interface does not meet the calling requirement, and the condition that partial log records are missing exists, so that the obtained log record is determined not to have integrity.
Therefore, in order to determine the integrity of the log record, whether the sequence number field meets the call requirement is judged through the configuration of the designated field, so that the detection efficiency of the integrity of the log record is improved.
In one example, specifying a field configuration includes incrementing values of bits in the field in sequence, and a difference in the values between adjacent bits is 1. Therefore, if the numerical values of the bits in the obtained serial number field are sequentially increased and the numerical difference between adjacent bits is 1, it can be determined that the serial number field meets the configuration of the specified field, and further, it can be determined that the obtained log record is complete. If the specified field configuration is not satisfied, for example: if the numerical value of each bit is reversed or the numerical value difference between adjacent bits is greater than 1, it can be determined that the log record is incomplete and part of the log record is missing.
In step S103, if the sequence number field does not satisfy the specified field configuration, it is determined that the log record is incomplete.
In the embodiment of the present invention, if the sequence number field does not satisfy the specified field configuration, it represents that there is a case where part of the log records are missing in the calling process, and therefore, it can be determined that the log records are incomplete.
By the embodiment, the condition that partial log records are lost in the calling process of the log record interface can be determined by judging whether the serial number field meets the configuration of the designated field, and further when the serial number field does not meet the configuration of the designated field, the obtained log records can be rapidly determined to have no integrity, so that the integrity detection of the log records is more convenient and more beneficial to improving the detection efficiency.
In an implementation scenario, due to the reason of the module itself, when the log record interface is called to output the corresponding sub-log record, the sub-log record needs to be output after being temporarily stored, and thus the obtained sequence number field may have a condition of jumping. For example: normally, the sequence number field is 3/4/5, but due to the presence of a special module, the sequence number field is hopped, resulting in a sequence number field of 3/5/4.
In this case, although some adjacent bit values in the sequence number field jump, the sequence number field is incremented according to the called order. Therefore, in the process of judging whether the acquired serial number field meets the configuration of the designated field, a supplementary judgment mechanism can be added, so that the condition of false detection is avoided, and the accuracy of detecting the integrity of the log record is improved.
In an example, the complementary decision mechanism can include: if the numerical value of part of adjacent bits in the sequence number field jumps, determining the sub-log record corresponding to the jumped bit, and determining whether the module corresponding to the sub-log record is a special module. If the module is a special module and numerical values of all bits except the jump position are sequentially increased, and the numerical difference between adjacent bits is 1, determining that the sequence number field meets the configuration of the specified field, and obtaining complete log records. If the module is not a special module, the log record is determined to be incomplete.
Fig. 2 is a flow chart of another proposed log detection method according to an example embodiment. As shown in fig. 2, the log detection method includes the following steps.
In step S201, a log record of the firmware running under the current test case is obtained.
In step S202, a sequence number field obtained by calling a log record interface is acquired from the log record, and whether the sequence number field satisfies a specified field configuration is determined.
In step S2031, if the sequence number field does not satisfy the specified field configuration, it is determined that the log record is incomplete.
In step S2032, if the sequence number field satisfies the specified field configuration, it is determined that the log record is complete.
In the embodiment of the invention, if the sequence number field meets the configuration of the specified field, the condition that partial log records are not lost exists in the calling process, so that the log records can be determined to be complete.
Through the embodiment, the condition that partial log records are lost in the calling process of the log record interface can be determined by judging whether the sequence number field meets the configuration of the designated field, so that the integrity detection of the log records is more convenient, the detection efficiency is more favorably improved, and the labor cost is favorably saved.
In one embodiment, the acquired log records include all records of the hard disk running in the current system version. Therefore, in order to improve the accuracy of the detection result and avoid the interference of invalid data, when judging whether the serial number field meets the configuration of the specified field, the historical calling information of the log recording interface is determined. The historical calling information may be understood as the historical sequence information of the calling log recording interface before the hard disk runs under the current test case, including the historical end line of the sequence number field. Invalid data may be understood as a historical log. And determining a starting line of the sequence number field according to the historical calling information. For example: and if the history ending behavior n of the serial number field in the history calling information is detected, determining the starting behavior n +1 of the serial number field, wherein n is a natural number. And acquiring a sequence number field for judging whether the log record is complete from the log record according to the determined starting line.
In an implementation scenario, if the obtained log record includes a field 0/1/2 … 1188 including a log record interface call. Wherein, if the determined historical invocation information is 15, the starting action of the sequence number field is 16, and the obtained sequence number field is 16/17/18 … 1188.
In another embodiment, when the hard disk is tested under the current test case, the hard disk can be controlled to operate in a plurality of system versions respectively, and further the operation difference of the firmware under different system versions under the same test case is determined. However, due to the fact that the system versions are switched, the firmware needs to be re-burned according to the updated system versions, the firmware versions are correspondingly updated, and then the serial number fields corresponding to the log recording interfaces are re-encoded, so that the obtained serial number fields include a plurality of sub-serial number fields, and the middle part of the serial number fields are jumped. For example: the obtained sequence number field is 0/1/2 … 43022/0/1/2 … 22211/0/1/2 … 1188, wherein 0/1/2 … 43022, 0/1/2 … 22211 and 0/1/2 … 1188 correspond to different sub-sequence number fields respectively. The log record is divided into several segments starting from the start line with "SN = 0" as a boundary. In one example, each sub-sequence number field corresponds to a system version.
Therefore, when determining whether the sequence number field satisfies the specified field configuration, it is determined whether the sequence number field includes a plurality of sub-sequence number fields. If the sequence number field comprises a plurality of sub-sequence number fields, the diary record is characterized by comprising the calling condition of the diary record interface under a plurality of different firmware versions. Therefore, in this case, the acquired log records are segmented, each segment of log records is subjected to character matching check according to the log format, and unmatched records are eliminated, so that the detection is ensured to be carried out smoothly. And acquiring the sub-sequence number field corresponding to each log record according to the segmented log record, and further respectively judging whether each sub-sequence number field meets the configuration of the designated field, so that the accuracy of determining the integrity of the log record is improved, and the condition of false detection is avoided.
In another embodiment, if at least one sub-sequence number field does not satisfy the configuration of the designated field, the condition that a partial log record of the log record corresponding to the sub-sequence number field is missing is characterized, and further, the condition that a partial log record of the whole log record of the firmware is missing in the current test case can be determined, so that the obtained log record can be determined to be incomplete.
In an implementation scenario, the log detection method may be performed by a log detection apparatus. The log detection device comprises a log module and a log checking module.
And the log module is used for being responsible for log caching and persistence and providing a uniform log recording interface for the outside. And in the implementation of the logging interface, a log Sequence Number (SN) field is added, and 1 is added and increased progressively according to the actual calling sequence. The step size of the SN field may be a 32-bit integer, or may be adjusted to a 64-bit integer according to requirements. The log module is also used to provide commands to export log records in conjunction with the nvme cli tool.
And the log checking module is used for judging whether the sequence number field meets the configuration of the specified field and providing a log recording interface for the outside so as to call the test case according to the service scene. And summarizing and analyzing all test case logs.
By the embodiment, the existing test cases can be combined, and all service scenes can be completely covered. In addition, in the testing process, the testing case is driven to automatically execute, so that the execution efficiency is high, and the individual difference and uncertainty of manual inspection can be avoided.
Based on the same inventive concept, the invention also provides another log detection device.
Fig. 3 is a block diagram of a structure of a log detection apparatus according to an exemplary embodiment. As shown in fig. 3, the log detection apparatus includes an acquisition unit 301, a judgment unit 302, and a determination unit 303.
An obtaining unit 301, configured to obtain a log record of the firmware running under the current test case;
a determining unit 302, configured to obtain a sequence number field obtained by invoking a log record interface from a log record, and determine whether the sequence number field meets a specified field configuration;
a determining unit 303, configured to determine that the log record is incomplete if the sequence number field does not satisfy the specified field configuration.
In an embodiment, the apparatus further comprises: and the judging unit is used for determining that the log record is complete if the sequence number field meets the configuration of the specified field.
In another embodiment, the determining unit 302 includes: the first determination unit is used for determining the historical calling information of the log recording interface. And the second determining unit is used for determining a starting line of the sequence number field according to the historical calling information. And the obtaining subunit is used for obtaining the sequence number field for calling the log record interface from the log record according to the starting line.
In yet another embodiment, the second determination unit includes: and if the history ending behavior n of the serial number field in the history calling information is detected, determining the starting behavior n +1 of the serial number field, wherein n is a natural number.
In yet another embodiment, specifying the field configuration includes incrementing the values of the bits in the field in sequence, with the difference in values between adjacent bits being 1.
In another embodiment, the determining unit 302 includes: and the first judging subunit is used for judging whether the sequence number field comprises a plurality of sub-sequence number fields. And the second judging subunit is used for judging whether each sub-sequence number field meets the configuration of the specified field or not if the sequence number field comprises a plurality of sub-sequence number fields.
In a further embodiment, the determining unit 303 comprises: and the determining subunit is used for determining that the log record is incomplete if at least one sub-sequence number field does not meet the specified field configuration.
The specific limitations and beneficial effects of the log detection apparatus can be referred to the limitations of the log detection method in the foregoing, and are not described herein again. The various modules described above may be implemented in whole or in part by software, hardware, and combinations thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
Fig. 4 is a schematic diagram of a hardware structure of a computer device according to an exemplary embodiment. As shown in fig. 4, the apparatus includes one or more processors 410 and a storage 420, where the storage 420 includes a persistent memory, a volatile memory, and a hard disk, and one processor 410 is taken as an example in fig. 4. The apparatus may further include: an input device 430 and an output device 440.
The processor 410, the memory 420, the input device 430, and the output device 440 may be connected by a bus or other means, such as the bus connection in fig. 4.
The memory 420, which is a non-transitory computer-readable storage medium including a persistent memory, a volatile memory, and a hard disk, may be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as program instructions/modules corresponding to the service management method in the embodiment of the present application. The processor 410 executes various functional applications of the server and data processing by executing non-transitory software programs, instructions, and modules stored in the memory 420, that is, implements any of the above-described log detection methods.
The memory 420 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data used as needed or desired, and the like. Further, the memory 420 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, memory 420 may optionally include memory located remotely from processor 410, which may be connected to a data processing device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 430 may receive input numeric or character information and generate key signal inputs related to user settings and function control. The output device 440 may include a display device such as a display screen.
One or more modules are stored in the memory 420, which when executed by the one or more processors 410 perform the methods shown in fig. 1-2.
The product can execute the method provided by the embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method. Details of the technique not described in detail in the present embodiment may specifically refer to the related descriptions in the embodiments shown in fig. 1-fig. 2.
Embodiments of the present invention further provide a non-transitory computer storage medium, where a computer-executable instruction is stored in the computer storage medium, and the computer-executable instruction may execute the authentication method in any of the above method embodiments. The storage medium may be a magnetic Disk, an optical Disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a Flash Memory (Flash Memory), a Hard Disk (Hard Disk Drive, abbreviated as HDD) or a Solid State Drive (SSD), etc.; the storage medium may also comprise a combination of memories of the kind described above.
It should be understood that the above examples are only for clarity of illustration and are not intended to limit the embodiments. Other variations and modifications will be apparent to persons skilled in the art in light of the above description. And are neither required nor exhaustive of all embodiments. And obvious variations or modifications therefrom are within the scope of the invention.
Claims (8)
1. A method of log detection, the method comprising:
under the current test case, acquiring log records when the firmware is driven and calls a plurality of modules in the running process;
acquiring a serial number field obtained by calling a log record interface from the log record, and judging whether the serial number field meets the configuration of a specified field, wherein the serial number field is used for recording whether the log record interface is called, and the log record interface is an interface obtained by unifying calling interfaces for providing log records to the outside;
if the sequence number field does not meet the configuration of the designated field and part of adjacent bit values in the sequence number field jump, determining a sub-log record corresponding to the jumping bit, and determining whether a module corresponding to the sub-log record is a special module;
if the module is a special module and numerical values of all bits except a jump position are sequentially increased, and the numerical difference between adjacent bits is 1, determining that the serial number field meets the configuration of the specified field, and the log record is complete;
if the module is not the special module, determining that the log record is incomplete;
wherein, the obtaining of the sequence number field obtained by calling the log record interface from the log record comprises: determining historical calling information of the logging interface; determining a starting line of the serial number field according to the historical calling information; and acquiring a serial number field for calling a log record interface from the log record according to the starting line.
2. The method of claim 1, further comprising:
and if the sequence number field meets the configuration of the specified field, determining that the log record is complete.
3. The method of claim 1, wherein determining a starting row of the sequence number field according to the historical call information comprises:
and if the history ending behavior n of the serial number field in the history calling information is detected, determining the starting behavior n +1 of the serial number field, wherein n is a natural number.
4. The method of claim 3, wherein specifying the field configuration comprises incrementing values of bits in the field in sequence, and wherein a difference in the values between adjacent bits is 1.
5. The method of claim 1, wherein determining whether the sequence number field satisfies a specified field configuration comprises:
judging whether the sequence number field comprises a plurality of sub-sequence number fields;
and if the sequence number field comprises a plurality of sub-sequence number fields, respectively judging whether each sub-sequence number field meets the configuration of a specified field.
6. An apparatus for log detection, the apparatus comprising:
the acquisition unit is used for acquiring log records when the firmware drives and calls the modules in the running process under the current test case;
the judging unit is used for acquiring a serial number field obtained by calling a log recording interface from the log record and judging whether the serial number field meets the configuration of a specified field or not, wherein the serial number field is used for recording whether the log recording interface is called or not, and the log recording interface is an interface obtained by unifying calling interfaces for providing log records to the outside;
a determining unit, configured to determine, if the sequence number field does not satisfy the configuration of the specified field and a part of adjacent bit values in the sequence number field jump, a sub-log record corresponding to the jumped bit, and determine whether a module corresponding to the sub-log record is a special module; if the module is a special module and the numerical values of all the bits are sequentially increased except for the jump position, and the numerical difference between the adjacent bits is 1, determining that the serial number field meets the configuration of the specified field and the log record is complete; if the module is not the special module, determining that the log record is incomplete;
wherein, the judging unit comprises: the first determining unit is used for determining historical calling information of the log recording interface; a second determining unit, configured to determine a starting row of the sequence number field according to the historical calling information; and the obtaining subunit is used for obtaining a serial number field for calling a log record interface from the log record according to the starting line.
7. A computer device comprising a memory and a processor, wherein the memory and the processor are communicatively connected, the memory stores computer instructions, and the processor executes the computer instructions to perform the log detection method according to any one of claims 1 to 5.
8. A computer-readable storage medium storing computer instructions for causing a computer to perform the log detection method of any one of claims 1-5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210076430.6A CN114116291B (en) | 2022-01-24 | 2022-01-24 | Log detection method, log detection device, computer device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210076430.6A CN114116291B (en) | 2022-01-24 | 2022-01-24 | Log detection method, log detection device, computer device and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114116291A CN114116291A (en) | 2022-03-01 |
CN114116291B true CN114116291B (en) | 2022-06-14 |
Family
ID=80361165
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210076430.6A Active CN114116291B (en) | 2022-01-24 | 2022-01-24 | Log detection method, log detection device, computer device and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114116291B (en) |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108829730A (en) * | 2018-05-11 | 2018-11-16 | 中国平安人寿保险股份有限公司 | The method, apparatus and its readable storage medium storing program for executing that a kind of pair of daily record data is stored |
CN110048899B (en) * | 2019-05-29 | 2022-03-04 | 北京奇艺世纪科技有限公司 | Log detection method and device, terminal and server |
CN112231290A (en) * | 2020-11-03 | 2021-01-15 | 上海智臻智能网络科技股份有限公司 | Method, device and equipment for processing local log and storage medium |
-
2022
- 2022-01-24 CN CN202210076430.6A patent/CN114116291B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN114116291A (en) | 2022-03-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110457277B (en) | Service processing performance analysis method, device, equipment and storage medium | |
US8141053B2 (en) | Call stack sampling using a virtual machine | |
CN108459962B (en) | Code normalization detection method and device, terminal equipment and storage medium | |
US9355003B2 (en) | Capturing trace information using annotated trace output | |
CN111538659B (en) | Interface testing method, system, electronic equipment and storage medium of business scene | |
CN110674025A (en) | Interactive behavior monitoring method and device and computer equipment | |
US10552812B2 (en) | Scenario based logging | |
CN109359020A (en) | Start time test method and device, computer installation and storage medium | |
WO2016178661A1 (en) | Determining idle testing periods | |
EP4160421A1 (en) | Method and apparatus for obtaining browser running data, and storage medium | |
WO2019148657A1 (en) | Method for testing associated environments, electronic device and computer readable storage medium | |
US9916220B2 (en) | Smart logging of trace data for storage systems | |
CN111694684B (en) | Abnormal construction method and device of storage device, electronic device and storage medium | |
CN111984452A (en) | Program failure detection method, program failure detection device, electronic device, and storage medium | |
CN113127312A (en) | Method and device for testing database performance, electronic equipment and storage medium | |
CN114116291B (en) | Log detection method, log detection device, computer device and storage medium | |
CN109710521B (en) | Multimedia application performance test method and device, computer equipment and storage medium | |
CN117033099A (en) | Pressure testing method, system and device for system hard disk and storage medium | |
CN111666200A (en) | Testing method and terminal for time consumption of cold start of PC software | |
CN115168124A (en) | Stability test method and device for concurrently executing multiple files on hard disk, computer equipment and medium | |
US6795879B2 (en) | Apparatus and method for wait state analysis in a digital signal processing system | |
CN112799933B (en) | Automatic test method and device | |
CN117827659A (en) | Code debugging method and device and computing equipment | |
CN113190453A (en) | User interface testing method, device, server and medium | |
CN116974940A (en) | Interface testing method, device, equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right |
Effective date of registration: 20220822 Address after: Room 401, 4th Floor, Gangsheng Building, No. 2177 Gangxi Road, High-tech Zone, Jinan City, Shandong Province, 250101 Patentee after: Shandong Yunhai guochuang cloud computing equipment industry innovation center Co.,Ltd. Address before: 215000 Building 9, No.1 guanpu Road, Guoxiang street, Wuzhong Economic Development Zone, Suzhou City, Jiangsu Province Patentee before: SUZHOU LANGCHAO INTELLIGENT TECHNOLOGY Co.,Ltd. |
|
TR01 | Transfer of patent right |