CN112000555B - Log generation method, device, equipment and storage medium based on dyeing - Google Patents

Log generation method, device, equipment and storage medium based on dyeing Download PDF

Info

Publication number
CN112000555B
CN112000555B CN202010903044.0A CN202010903044A CN112000555B CN 112000555 B CN112000555 B CN 112000555B CN 202010903044 A CN202010903044 A CN 202010903044A CN 112000555 B CN112000555 B CN 112000555B
Authority
CN
China
Prior art keywords
feature code
dyeing
log
target
code set
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
CN202010903044.0A
Other languages
Chinese (zh)
Other versions
CN112000555A (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.)
Shenzhen Tongxingzhe Technology Co ltd
Original Assignee
Shenzhen Tongxingzhe 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 Shenzhen Tongxingzhe Technology Co ltd filed Critical Shenzhen Tongxingzhe Technology Co ltd
Priority to CN202010903044.0A priority Critical patent/CN112000555B/en
Publication of CN112000555A publication Critical patent/CN112000555A/en
Application granted granted Critical
Publication of CN112000555B publication Critical patent/CN112000555B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3065Monitoring arrangements determined by the means or processing involved in reporting the monitored data
    • G06F11/3086Monitoring arrangements determined by the means or processing involved in reporting the monitored data where the reporting involves the use of self describing data formats, i.e. metadata, markup languages, human readable formats
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • 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)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Library & Information Science (AREA)
  • Quality & Reliability (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention relates to the field of log dyeing, and discloses a log generation method, device and equipment based on dyeing and a storage medium. The method comprises the following steps: receiving a debug log sent by a preset background server, wherein the debug log comprises: a user feature code set, an interface feature code set and a channel feature code set; dyeing the character record in the debug log based on a preset dyeing strategy to obtain a dyeing debug log; and extracting dyed character records in the dyeing debugging log to generate a target debugging log.

Description

Log generation method, device, equipment and storage medium based on dyeing
Technical Field
The present invention relates to the field of log dyeing, and in particular, to a log generating method, device, equipment and storage medium based on dyeing.
Background
In the development and maintenance process of the database, huge log data are generated, and debug logs and error logs are arranged in the log data. Error logs are necessary at project run time, however debug logs are not only numerous and there is a great deal of redundancy. The log records the context state of the program running, and when an abnormality occurs, the log can better locate the problem by matching with the error log. It is therefore desirable to control the output of debug logs without on-line manual code removal.
At present, log output can be effectively reduced through log dyeing, however, at present, log dyeing is still directly performed on a dyed object, errors always occur in the dyeing process, and a scheme capable of accurately dyeing different objects is needed.
Disclosure of Invention
The invention mainly aims to solve the technical problem of insufficient dyeing accuracy when different dyeing objects are dyed.
The first aspect of the invention provides a log generation method based on dyeing, which comprises the following steps:
receiving a debug log sent by a preset background server, wherein the debug log comprises: a user feature code set, an interface feature code set and a channel feature code set;
dyeing the character record in the debug log based on a preset dyeing strategy to obtain a dyeing debug log;
and extracting dyed character records in the dyeing debugging log to generate a target debugging log.
Optionally, in a first implementation manner of the first aspect of the present invention, the dyeing processing is performed on the character record in the debug log based on a preset dyeing policy, and obtaining the dyeing debug log includes:
reading a preset dyeing strategy to obtain a target feature code corresponding to a character record to be dyed in the dyeing strategy;
matching all elements in the user feature code set, the interface feature code set and the channel feature code set with the target feature code respectively to obtain a feature code matching set;
and according to the feature codes in the feature code matching set, dyeing the character record corresponding to the feature code in the debug log to obtain a dyed debug log.
Optionally, in a second implementation manner of the first aspect of the present invention, the matching all elements in the user feature code set, the interface feature code set, and the channel feature code set with the target feature code respectively, to obtain a feature code matching set includes:
sequentially matching all elements in the user feature code set and the interface feature code set with the target feature code to obtain a first matching element set;
matching all elements in the channel feature code set with the target feature code respectively to obtain a second matched element set;
grabbing a dyeing proportion corresponding to a target feature code in the dyeing strategy, and writing the dyeing proportion corresponding to the dyeing proportion into the second matching element set;
and splicing the first matching element set and the second matching element set to generate a feature code matching set.
Optionally, in a third implementation manner of the first aspect of the present invention, the capturing a dyeing proportion corresponding to the target feature code in the dyeing policy, and writing the dyeing proportion corresponding to the second matching element set includes:
reading the dyeing proportion correspondingly set by the target feature code in the dyeing strategy;
marking elements corresponding to the target feature codes in the second matching element set according to the target feature codes;
and writing the corresponding dyeing proportion into the elements of the second matching element set according to the target feature code.
Optionally, in a fourth implementation manner of the first aspect of the present invention, the dyeing processing is performed on the character record in the debug log based on a preset dyeing policy, and obtaining the dyeing debug log further includes:
judging whether the user feature code set and/or the interface feature code set in the debug log are empty sets or not;
and if the user feature code set and/or the interface feature code set are empty sets, all the debug logs are dyed, a dyed debug log is generated, and the debug log is confirmed to be in an abnormal state.
Optionally, in a fifth implementation manner of the first aspect of the present invention, the extracting a dyed character record in the dyeing debug log, and generating a target debug log includes:
acquiring a target debugging log frame;
judging whether the character record corresponding to the user feature code set in the dyeing debugging log is dyed or not;
if the character records corresponding to the user feature code set are dyed, writing the character records corresponding to the user feature code set into the target debugging log frame to generate a target debugging log;
if the character record corresponding to the user feature code set is not dyed, judging whether the character record corresponding to the interface feature code set in the dyeing debugging log is dyed or not;
if the character record corresponding to the interface feature code set is dyed, writing the character record corresponding to the interface feature code set into the target debugging log frame to generate a target debugging log;
if the character record corresponding to the interface feature code set is not dyed, judging whether the character record corresponding to the channel feature code set in the dyeing debugging log is dyed or not;
if the character record corresponding to the channel feature code set is dyed, writing the character record corresponding to the user feature code into a debug log frame to generate a target debug log;
and if the character record corresponding to the channel feature code set is not dyed, canceling the task of generating the target debugging log.
Optionally, in a sixth implementation manner of the first aspect of the present invention, before receiving the debug log sent by the preset background server, the method further includes:
controlling a preset background server to receive a recording request;
analyzing the recording request to obtain a user feature code and an interface feature code;
inquiring a channel feature code in the record request according to the user feature code, and writing the record request into a debug log according to the user feature code, the interface feature code and the channel feature code.
The second aspect of the present invention provides a log generating device based on dyeing, comprising:
the receiving module is used for receiving a debug log sent by a preset background server, wherein the debug log comprises: a user feature code set, an interface feature code set and a channel feature code set;
the dyeing module is used for dyeing the character records in the debug log based on a preset dyeing strategy to obtain a dyeing debug log;
the generation module is used for extracting dyed character records in the dyeing debugging log and generating a target debugging log.
A third aspect of the present invention provides a log generating apparatus based on staining, comprising: a memory and at least one processor, the memory having instructions stored therein, the memory and the at least one processor being interconnected by a line; the at least one processor invokes the instructions in the memory to cause the dye-based journal generation device to perform the dye-based journal generation method described above.
A fourth aspect of the present invention provides a computer readable storage medium having instructions stored therein which, when run on a computer, cause the computer to perform the above-described dye-based log generation method.
Drawings
FIG. 1 is a schematic diagram of a first embodiment of a method for generating a log based on staining in an embodiment of the present invention;
FIG. 2 is a schematic diagram of a second embodiment of a staining-based log generation method in an embodiment of the present invention;
FIG. 3 is a schematic diagram of a third embodiment of a staining-based log generation method according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of an embodiment of a staining-based log generation apparatus in an embodiment of the present invention;
FIG. 5 is a schematic diagram of another embodiment of a staining-based log generation apparatus in an embodiment of the present invention;
FIG. 6 is a schematic diagram of an embodiment of a dye-based log generating apparatus in an embodiment of the invention.
Detailed Description
The embodiment of the invention provides a log generation method, device and equipment based on dyeing and a storage medium.
The terms "first," "second," "third," "fourth" and the like in the description and in the claims and in the above drawings, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments described herein may be implemented in other sequences than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed or inherent to such process, method, article, or apparatus.
For ease of understanding, a specific flow of an embodiment of the present invention is described below with reference to fig. 1, where a first embodiment of a method for generating a log based on staining in an embodiment of the present invention includes:
101. receiving a debug log sent by a preset background server, wherein the debug log comprises: a user feature code set, an interface feature code set and a channel feature code set;
in this embodiment, the background server generates a debug log of the database, and the debug log records { uid22 cgi86 app id 56,uid212 cgi166 appid 526}, where uid22 and uid212 are user feature codes, cgi86 and cgi166 are interface feature codes, app id 56 and app id 526 are channel feature codes, and the debug log may combine the user feature codes, the interface feature codes, and the channel feature codes into a specific set.
102. Dyeing the character records in the debug log based on a preset dyeing strategy to obtain a dyeing debug log;
in this embodiment, the preset dyeing policy is to determine whether the dyed object is blank, first determine whether the user feature code and the channel feature code are blank, if not, determine whether the user feature code has a dyeing policy, if the user feature code does not have a dyeing policy, sequentially determine whether the interface feature code and the channel feature code have a dyeing policy, and if neither has a dyeing policy, cancel the dyeing scheme. If one staining strategy exists in the user feature code, the interface feature code and the channel feature code, the log of the corresponding feature code is required to be stained. And performing accurate dyeing according to the dyeing strategies correspondingly set by the user feature codes, the interface feature codes and the channel feature codes.
103. And extracting dyed character records in the dyeing debug log to generate a target debug log.
In this embodiment, the characters of the log to be dyed are extracted, and the extracted characters are sequentially output. For example, { uid22:2821 ] exists in the dye debug log; cgi75:dsadasd } where only uid22 has a dyeing policy and uid22 is dyed, the character generation target debug log { uid22:2821} of dyed uid22:2821 is extracted.
In the embodiment of the invention, the dyeing process is finished through different feature codes according to the preset dyeing state and the dyeing state according to whether the user feature code, the interface feature code and the channel feature code are set or not, so that the dyeing accuracy of different dyeing objects is improved.
Referring to fig. 2, a second embodiment of the method for generating a log based on staining according to an embodiment of the present invention includes:
201. receiving a debug log sent by a preset background server, wherein the debug log comprises: a user feature code set, an interface feature code set and a channel feature code set;
the method embodiment described in this embodiment is similar to the first embodiment, and reference may be made to the corresponding procedure in the foregoing method embodiment, which is not described herein.
202. Reading a preset dyeing strategy to obtain a target feature code corresponding to a character record to be dyed in the dyeing strategy;
in the present embodiment, the target feature code corresponding to the dyed character is uid, cgi, appid with the feature code of such character combination.
203. Sequentially matching all elements in the user feature code set and the interface feature code set with the target feature code to obtain a first matching element set;
in this embodiment, the user feature code set { ui 32, ui 211, ui 212}, the interface feature code set { cgi22, cgi 610, cgi22 } and the characters of the target feature code are matched, and the successfully matched characters are combined to generate the first matching element set.
204. Matching all elements in the channel feature code set with the target feature code respectively to obtain a second matching element set;
in this embodiment, the channel feature code set { app id 322, app id 655, app id 66} matches the characters of the target feature code, and the successfully matched characters are combined to generate a second matching element set.
205. Reading the dyeing proportion correspondingly set by the target feature codes in the dyeing strategy;
in this embodiment, the proportion of app id 322 in the target feature code is 55%, the proportion of app id 655 is 12%, and the proportion of app id 66 is 52%.
206. Marking elements corresponding to the target feature codes in the second matching element set according to the target feature codes;
in this embodiment, the second matching element is marked with the feature codes of app id 322, app id 655, app id 66.
207. Writing the corresponding dyeing proportion into the elements of the second matching element set according to the target feature code;
in this embodiment, the dyeing ratio of app id 322 in the second matching element is set to 55%, the dyeing ratio of app id 655 is set to 12%, and the dyeing ratio of app id 66 is set to 52%.
208. Splicing the first matching element set and the second matching element set to generate a feature code matching set;
in this embodiment, the first matching element set and the second matching element set are directly spliced up and down. In yet another manner, the first set of matching elements and the second set of matching elements may be spelled in order. And (5) grafting.
209. According to the feature codes in the feature code matching set, dyeing the character record corresponding to the feature code in the debug log to obtain a dyed debug log;
in this embodiment, the feature code without the dyeing proportion in the feature matching code performs 100% dyeing on the corresponding feature code in the debug log, and if the dyeing proportion exists, the character is dyed according to the dyeing proportion, so as to generate the dyeing debug log.
210. Acquiring a target debugging log frame;
in this embodiment, the target debug log frame that has been set is obtained, and various data templates already exist in the target debug log frame, but no data has yet been filled in.
211. Judging whether the character record corresponding to the user feature code set in the dyeing debugging log is dyed or not;
in this embodiment, whether the dyeing condition exists or not is determined for the character corresponding to the uid in the dyeing debug log.
212. If the character records corresponding to the user feature code set are dyed, writing the character records corresponding to the user feature code set into a target debugging log frame to generate a target debugging log;
in this embodiment, the character corresponding to the uid is already dyed, the dyed character in the dyed log is extracted, and then the extracted character is written into the target debug log frame according to the sequence arrangement, so as to obtain the target debug log.
213. If the character record corresponding to the user feature code set is not dyed, judging whether the character record corresponding to the interface feature code set in the dyeing debug log is dyed or not;
in this embodiment, if the character corresponding to the uid is not dyed, it is determined whether the character corresponding to the cgi interface feature code is dyed.
214. If the character record corresponding to the interface feature code set is dyed, writing the character record corresponding to the interface feature code set into a target debugging log frame to generate a target debugging log;
in this embodiment, the dyed character corresponding to the interface cgi is extracted to generate the target debug log.
215. If the character record corresponding to the interface feature code set is not dyed, judging whether the character record corresponding to the channel feature code set in the dyeing debug log is dyed or not;
in this embodiment, if none of the characters corresponding to uid and cgi is dyed, it is determined whether the character corresponding to app id is dyed.
216. If the character record corresponding to the channel feature code set is dyed, writing the character record corresponding to the user feature code into a debug log frame to generate a target debug log;
in this embodiment, the character corresponding to the app id has a dyed character written into the frame, and a target debug log is generated.
217. And if the character record corresponding to the channel feature code set is not dyed, canceling the task of generating the target debugging log.
In this embodiment, none of the characters corresponding to uid, cgi, appid is dyed, and the target debug log is not generated.
In the embodiment of the invention, the dyeing process is finished through different feature codes according to the preset dyeing state and the dyeing state according to whether the user feature code, the interface feature code and the channel feature code are set or not, so that the dyeing accuracy of different dyeing objects is improved.
Referring to fig. 3, a third embodiment of the method for generating a log based on staining according to an embodiment of the present invention includes:
301. controlling a preset background server to receive a recording request;
in the present embodiment, various data record requests of the server are read, such as { @ Post ("uid 22:WEs", "uid 66:WEs", "uid 65:WEs", "cgi22:332", "app id556: dds") }
302. Analyzing the record request to obtain a user feature code and an interface feature code;
in this embodiment, the user feature code and the interface feature code corresponding to the ui and cgi in the record request { @ Post ("ui 22:wes", "ui 66:wes", "ui 65:wes", "cgi22:332", "app id556: dds") }.
303. Inquiring channel feature codes in the record request according to the user feature codes, and writing the record request into the debug log according to the user feature codes, the interface feature codes and the channel feature codes;
in this embodiment, the channel feature code of the app id is queried according to the uid. And then writing the data corresponding to the record into a debug log according to uid, cgi, appid.
304. Receiving a debug log sent by a preset background server, wherein the debug log comprises: a user feature code set, an interface feature code set and a channel feature code set;
the method embodiment described in this embodiment is similar to the first embodiment, and reference may be made to the corresponding procedure in the foregoing method embodiment, which is not described herein.
305. Judging whether a user feature code set and/or an interface feature code set in the debug log are empty sets or not;
in this embodiment, it is determined whether the set of feature codes in which the uid and cgi grasp and merge is an empty set.
306. If the user feature code set and/or the interface feature code set are empty sets, all the debug logs are dyed, a dyed debug log is generated, and the debug log is confirmed to be in an abnormal state;
in this embodiment, if the feature codes corresponding to the ui and cgi are detected as empty sets using the built-in probe, log abnormality is described, the debug log is entirely dyed, and then the debug log is marked as abnormal.
307. And extracting dyed character records in the dyeing debug log to generate a target debug log.
The method embodiment described in this embodiment is similar to the first embodiment, and reference may be made to the corresponding procedure in the foregoing method embodiment, which is not described herein.
In the embodiment of the invention, the dyeing process is finished through different feature codes according to the preset dyeing state and the dyeing state according to whether the user feature code, the interface feature code and the channel feature code are set or not, so that the dyeing accuracy of different dyeing objects is improved.
The method for generating a log based on dyeing in the embodiment of the present invention is described above, and the device for generating a log based on dyeing in the embodiment of the present invention is described below, referring to fig. 4, where one embodiment of the device for generating a log based on dyeing in the embodiment of the present invention includes:
the receiving module 401 is configured to receive a debug log sent by a preset background server, where the debug log includes: a user feature code set, an interface feature code set and a channel feature code set;
the dyeing module 402 is configured to perform dyeing processing on the character record in the debug log based on a preset dyeing policy, so as to obtain a dyeing debug log;
the generating module 403 is configured to extract a dyed character record in the dyeing debug log, and generate a target debug log.
In the embodiment of the invention, the dyeing process is finished through different feature codes according to the preset dyeing state and the dyeing state according to whether the user feature code, the interface feature code and the channel feature code are set or not, so that the dyeing accuracy of different dyeing objects is improved.
Referring to fig. 5, another embodiment of the log generating apparatus based on staining in the embodiment of the invention includes:
the receiving module 401 is configured to receive a debug log sent by a preset background server, where the debug log includes: a user feature code set, an interface feature code set and a channel feature code set;
the dyeing module 402 is configured to perform dyeing processing on the character record in the debug log based on a preset dyeing policy, so as to obtain a dyeing debug log;
the generating module 403 is configured to extract a dyed character record in the dyeing debug log, and generate a target debug log.
Wherein the staining module 402 comprises:
the reading unit 4021 is configured to read a preset dyeing strategy to obtain a target feature code corresponding to a character record to be dyed in the dyeing strategy;
a matching unit 4022, configured to match all elements in the user feature code set, the interface feature code set, and the channel feature code set with the target feature code respectively, to obtain a feature code matching set;
the dyeing unit 4023 is configured to dye a character record corresponding to the feature code in the debug log according to the feature code in the feature code matching set, so as to obtain a dyed debug log.
The matching unit 4022 is specifically configured to:
sequentially matching all elements in the user feature code set and the interface feature code set with the target feature code to obtain a first matching element set;
matching all elements in the channel feature code set with the target feature code respectively to obtain a second matched element set;
grabbing a dyeing proportion corresponding to a target feature code in the dyeing strategy, and writing the dyeing proportion corresponding to the dyeing proportion into the second matching element set;
and splicing the first matching element set and the second matching element set to generate a feature code matching set.
The matching unit 4022 may be specifically configured to:
reading the dyeing proportion correspondingly set by the target feature code in the dyeing strategy;
marking elements corresponding to the target feature codes in the second matching element set according to the target feature codes;
and writing the corresponding dyeing proportion into the elements of the second matching element set according to the target feature code.
Wherein, the dyeing module 402 may be further specifically configured to:
judging whether the user feature code set and/or the interface feature code set in the debug log are empty sets or not;
and if the user feature code set and/or the interface feature code set are empty sets, all the debug logs are dyed, a dyed debug log is generated, and the debug log is confirmed to be in an abnormal state.
The generating module 403 is specifically configured to:
acquiring a target debugging log frame;
judging whether the character record corresponding to the user feature code set in the dyeing debugging log is dyed or not;
if the character records corresponding to the user feature code set are dyed, writing the character records corresponding to the user feature code set into the target debugging log frame to generate a target debugging log;
if the character record corresponding to the user feature code set is not dyed, judging whether the character record corresponding to the interface feature code set in the dyeing debugging log is dyed or not;
if the character record corresponding to the interface feature code set is dyed, writing the character record corresponding to the interface feature code set into the target debugging log frame to generate a target debugging log;
if the character record corresponding to the interface feature code set is not dyed, judging whether the character record corresponding to the channel feature code set in the dyeing debugging log is dyed or not;
if the character record corresponding to the channel feature code set is dyed, writing the character record corresponding to the user feature code into a debug log frame to generate a target debug log;
and if the character record corresponding to the channel feature code set is not dyed, canceling the task of generating the target debugging log.
The log generating device based on dyeing further includes a parsing module 404, where the parsing module 404 is specifically configured to:
controlling a preset background server to receive a recording request;
analyzing the recording request to obtain a user feature code and an interface feature code;
inquiring a channel feature code in the record request according to the user feature code, and writing the record request into a debug log according to the user feature code, the interface feature code and the channel feature code.
In the embodiment of the invention, the dyeing process is finished through different feature codes according to the preset dyeing state and the dyeing state according to whether the user feature code, the interface feature code and the channel feature code are set or not, so that the dyeing accuracy of different dyeing objects is improved.
The dye-based log generating apparatus in the embodiment of the present invention is described in detail above in terms of the modularized functional entity in fig. 4 and 5, and the dye-based log generating device in the embodiment of the present invention is described in detail below in terms of hardware processing.
Fig. 6 is a schematic structural diagram of a log generating device based on staining, where the log generating device 600 based on staining may have a relatively large difference due to different configurations or performances, and may include one or more processors (central processing units, CPU) 610 (e.g., one or more processors) and a memory 620, and one or more storage media 630 (e.g., one or more mass storage devices) storing application programs 633 or data 632 according to an embodiment of the present invention. Wherein the memory 620 and the storage medium 630 may be transitory or persistent storage. The program stored on the storage medium 630 may include one or more modules (not shown), each of which may include a series of instruction operations on the dye-based log generating device 600. Still further, the processor 610 may be configured to communicate with the storage medium 630 to execute a series of instruction operations in the storage medium 630 on the dye-based journal generation device 600.
The dye-based log generating apparatus 600 may also include one or more power supplies 640, one or more wired or wireless network interfaces 650, one or more input/output interfaces 660, and/or one or more operating systems 631, such as Windows Serve, mac OS X, unix, linux, freeBSD, and the like. It will be appreciated by those skilled in the art that the dye-based log generating device structure shown in fig. 6 does not constitute a limitation of the dye-based log generating device, and may include more or fewer components than shown, or may combine certain components, or may be a different arrangement of components.
The present invention also provides a computer readable storage medium, which may be a non-volatile computer readable storage medium, and which may also be a volatile computer readable storage medium, the computer readable storage medium having instructions stored therein which, when executed on a computer, cause the computer to perform the steps of the dye-based log generation method.
It will be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the system or apparatus and unit described above may refer to the corresponding process in the foregoing method embodiment, which is not repeated herein.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied essentially or in part or all of the technical solution or in part in the form of a software product stored in a storage medium, including instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a read-only memory (ROM), a random access memory (random access memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (7)

1. A method for generating a log based on staining, comprising the steps of:
receiving a debug log sent by a preset background server, wherein the debug log comprises: a user feature code set, an interface feature code set and a channel feature code set;
dyeing the character records in the debug log based on a preset dyeing strategy to obtain a dyeing debug log, wherein the dyeing the character records in the debug log based on the preset dyeing strategy to obtain the dyeing debug log comprises the following steps:
reading a preset dyeing strategy to obtain a target feature code corresponding to a character record to be dyed in the dyeing strategy;
matching all elements in the user feature code set, the interface feature code set and the channel feature code set with the target feature code respectively to obtain a feature code matching set, wherein the matching all elements in the user feature code set, the interface feature code set and the channel feature code set with the target feature code respectively to obtain a feature code matching set comprises:
sequentially matching all elements in the user feature code set and the interface feature code set with the target feature code to obtain a first matching element set;
matching all elements in the channel feature code set with the target feature code respectively to obtain a second matched element set;
grabbing a dyeing proportion corresponding to a target feature code in the dyeing strategy, and writing the dyeing proportion corresponding to the dyeing proportion into the second matching element set;
splicing the first matching element set and the second matching element set to generate a feature code matching set;
dyeing the character record corresponding to the feature code in the debug log according to the feature code in the feature code matching set to obtain a dyeing debug log, wherein the dyeing processing is performed on the character record in the debug log based on a preset dyeing strategy, and the obtaining the dyeing debug log further comprises:
judging whether the user feature code set and/or the interface feature code set in the debug log are empty sets or not;
if the user feature code set and/or the interface feature code set are empty sets, all the debug logs are dyed, a dyed debug log is generated, and the debug log is confirmed to be in an abnormal state;
and extracting dyed character records in the dyeing debugging log to generate a target debugging log.
2. The method of claim 1, wherein the capturing the dyeing proportion corresponding to the target feature code in the dyeing policy, and writing the dyeing proportion corresponding to the second matching element set includes:
reading the dyeing proportion correspondingly set by the target feature code in the dyeing strategy;
marking elements corresponding to the target feature codes in the second matching element set according to the target feature codes;
and writing the corresponding dyeing proportion into the elements of the second matching element set according to the target feature code.
3. The method of claim 1, wherein the extracting the dyed character record in the dyeing debug log to generate a target debug log comprises:
acquiring a target debugging log frame;
judging whether the character record corresponding to the user feature code set in the dyeing debugging log is dyed or not;
if the character records corresponding to the user feature code set are dyed, writing the character records corresponding to the user feature code set into the target debugging log frame to generate a target debugging log;
if the character record corresponding to the user feature code set is not dyed, judging whether the character record corresponding to the interface feature code set in the dyeing debugging log is dyed or not;
if the character record corresponding to the interface feature code set is dyed, writing the character record corresponding to the interface feature code set into the target debugging log frame to generate a target debugging log;
if the character record corresponding to the interface feature code set is not dyed, judging whether the character record corresponding to the channel feature code set in the dyeing debugging log is dyed or not;
if the character records corresponding to the channel feature code set are dyed, writing the character records corresponding to the user feature code set into a debug log frame to generate a target debug log;
and if the character record corresponding to the channel feature code set is not dyed, canceling the task of generating the target debugging log.
4. A method of generating a dye-based log according to any one of claims 1-3, further comprising, prior to receiving the debug log sent by the preset background server:
controlling a preset background server to receive a recording request;
analyzing the recording request to obtain a user feature code and an interface feature code;
inquiring a channel feature code in the record request according to the user feature code, and writing the record request into a debug log according to the user feature code, the interface feature code and the channel feature code.
5. A staining-based log generation apparatus, the staining-based log generation apparatus comprising:
the receiving module is used for receiving a debug log sent by a preset background server, wherein the debug log comprises: a user feature code set, an interface feature code set and a channel feature code set;
the dyeing module is used for dyeing the character records in the debug log based on a preset dyeing strategy to obtain a dyeing debug log, wherein the dyeing module comprises:
the reading unit is used for reading a preset dyeing strategy to obtain a target feature code corresponding to the character record to be dyed in the dyeing strategy;
the matching unit is used for respectively matching all elements in the user feature code set, the interface feature code set and the channel feature code set with the target feature code to obtain a feature code matching set, wherein the matching unit is specifically used for:
sequentially matching all elements in the user feature code set and the interface feature code set with the target feature code to obtain a first matching element set;
matching all elements in the channel feature code set with the target feature code respectively to obtain a second matched element set;
grabbing a dyeing proportion corresponding to a target feature code in the dyeing strategy, and writing the dyeing proportion corresponding to the dyeing proportion into the second matching element set;
splicing the first matching element set and the second matching element set to generate a feature code matching set;
the dyeing unit is used for dyeing the character record corresponding to the feature code in the debug log according to the feature code in the feature code matching set to obtain a dyeing debug log, wherein the dyeing module is further specifically used for:
judging whether the user feature code set and/or the interface feature code set in the debug log are empty sets or not;
if the user feature code set and/or the interface feature code set are empty sets, all the debug logs are dyed, a dyed debug log is generated, and the debug log is confirmed to be in an abnormal state;
the generation module is used for extracting dyed character records in the dyeing debugging log and generating a target debugging log.
6. A staining-based log generating apparatus, the staining-based log generating apparatus comprising: a memory and at least one processor, the memory having instructions stored therein, the memory and the at least one processor being interconnected by a line;
the at least one processor invoking the instructions in the memory to cause the dye-based journal generation device to perform the dye-based journal generation method as recited in any one of claims 1-4.
7. A computer readable storage medium having stored thereon a computer program, wherein the computer program when executed by a processor implements the dye-based log generation method of any of claims 1-4.
CN202010903044.0A 2020-08-31 2020-08-31 Log generation method, device, equipment and storage medium based on dyeing Active CN112000555B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010903044.0A CN112000555B (en) 2020-08-31 2020-08-31 Log generation method, device, equipment and storage medium based on dyeing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010903044.0A CN112000555B (en) 2020-08-31 2020-08-31 Log generation method, device, equipment and storage medium based on dyeing

Publications (2)

Publication Number Publication Date
CN112000555A CN112000555A (en) 2020-11-27
CN112000555B true CN112000555B (en) 2023-06-06

Family

ID=73465761

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010903044.0A Active CN112000555B (en) 2020-08-31 2020-08-31 Log generation method, device, equipment and storage medium based on dyeing

Country Status (1)

Country Link
CN (1) CN112000555B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107957937A (en) * 2017-12-19 2018-04-24 郑州云海信息技术有限公司 A kind of method and system of daily record output

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102480383B (en) * 2010-11-23 2015-12-16 腾讯科技(深圳)有限公司 A kind of log information message processing method and device
CN104102879B (en) * 2013-04-15 2016-08-17 腾讯科技(深圳)有限公司 The extracting method of a kind of message format and device
CN107273280B (en) * 2017-06-30 2021-02-09 百度在线网络技术(北京)有限公司 Log processing method and device, electronic equipment and storage medium
US20190108112A1 (en) * 2017-10-05 2019-04-11 Hcl Technologies Limited System and method for generating a log analysis report from a set of data sources
CN111538712B (en) * 2020-04-30 2023-07-21 恒生电子股份有限公司 Log recording method, processing node, electronic equipment and storage medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107957937A (en) * 2017-12-19 2018-04-24 郑州云海信息技术有限公司 A kind of method and system of daily record output

Also Published As

Publication number Publication date
CN112000555A (en) 2020-11-27

Similar Documents

Publication Publication Date Title
US10657028B2 (en) Method for replicating production behaviours in a development environment
CN113420537B (en) Method, device, equipment and storage medium for processing electronic form data
CN112667240A (en) Program code conversion method and related device
CN106681854B (en) Information verification method, device and system
CN111563016B (en) Log collection and analysis method and device, computer system and readable storage medium
CN112925524A (en) Method and device for detecting unsafe direct memory access in driver
CN114756868A (en) Network asset and vulnerability association method and device based on fingerprint
Jiang et al. Assuring the model evolution of protocol software specifications by regression testing process improvement
CN112000555B (en) Log generation method, device, equipment and storage medium based on dyeing
CN112380239A (en) Script generation method, device, equipment and storage medium
CN112363939A (en) Method, system and equipment for quickly generating fuzzy test network protocol template
CN110688823A (en) XML file verification method and device
CN114676126A (en) Database-based data verification method, device, equipment and storage medium
JP2005276040A (en) Degrade confirming examining method and system, and program for the same
CN111882419B (en) Method and device for quality inspection of files and server
CN113127874A (en) Method and device for processing intranet sensitive information
CN114330278A (en) Method and equipment for judging consistency of returned data
CN110633204B (en) Program defect detection method and device
CN112363944A (en) Method and equipment for comparing return values of multiple environment interfaces
CN114064387A (en) Log monitoring method, system, device and computer readable storage medium
CN110717131A (en) Page revising monitoring method and related system
CN112882721B (en) Software package compiling method and device
CN113553060B (en) Code processing method, device, equipment and storage medium
CN114693254A (en) Data processing method, device and computer readable storage medium
CN114625629A (en) Interface testing method, terminal and 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
GR01 Patent grant
GR01 Patent grant