CN110569222B - Link tracking method and device, computer equipment and readable storage medium - Google Patents

Link tracking method and device, computer equipment and readable storage medium Download PDF

Info

Publication number
CN110569222B
CN110569222B CN201910783701.XA CN201910783701A CN110569222B CN 110569222 B CN110569222 B CN 110569222B CN 201910783701 A CN201910783701 A CN 201910783701A CN 110569222 B CN110569222 B CN 110569222B
Authority
CN
China
Prior art keywords
link
node
log
timestamp file
timestamp
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
CN201910783701.XA
Other languages
Chinese (zh)
Other versions
CN110569222A (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.)
Zhejiang Dasou Vehicle Software Technology Co Ltd
Original Assignee
Zhejiang Dasou Vehicle Software 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 Zhejiang Dasou Vehicle Software Technology Co Ltd filed Critical Zhejiang Dasou Vehicle Software Technology Co Ltd
Priority to CN201910783701.XA priority Critical patent/CN110569222B/en
Publication of CN110569222A publication Critical patent/CN110569222A/en
Application granted granted Critical
Publication of CN110569222B publication Critical patent/CN110569222B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/11File system administration, e.g. details of archiving or snapshots
    • G06F16/113Details of archiving
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/1805Append-only file systems, e.g. using logs or journals to store data
    • G06F16/1815Journaling file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/182Distributed file systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application relates to a link tracking method, a device, a computer device and a readable storage medium, wherein the method comprises the following steps: creating a timestamp file by taking a preset time as a period, and storing a link log of which the generation time is within a preset time period into a corresponding timestamp file; analyzing each link log in the timestamp file to obtain a root node and a father node of each link node in each link log; and merging the link nodes with the same root node and the father node in the timestamp file to obtain a link log statistical result of the timestamp file. In the method, the link logs are stored in the timestamp file, and the link logs in the timestamp file are counted at a certain time interval, so that the counting real-time performance of the link logs is greatly improved as the counting time interval is obviously shortened relative to the data processing period of a data warehouse; and all the link logs are stored in corresponding timestamp files, so that the information integrity of the link log statistics is further ensured.

Description

Link tracking method and device, computer equipment and readable storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a link tracking method, an apparatus, a computer device, and a readable storage medium.
Background
With the popularization and development of micro-services, a large internet company generally has several hundreds to thousands of systems which are mutually called, and the relationship among the systems is distributed in a mesh shape, which is complicated. When a system link request occurs, the database records a system log generated by the link request, and by analyzing the system log, the system log can be known which systems the link request relates to and the calling relationship among the systems. Usually, a large number of link requests are generated every minute or even every second, and if all call relations between systems are to be acquired, system logs generated by all link requests need to be counted, so that the database load is unbalanced due to huge data volume.
Therefore, in the conventional technology, a data warehouse is used to store the system logs generated by all the link requests, and then the same link requests in the historical system logs are merged at a fixed time period (usually one hour or longer), so that the data volume of the system logs can be greatly reduced, and the merged link request data is stored in a database for a user to invoke statistics.
However, the period of data warehouse processing data used in the conventional technology is long, and the calling relationship among the systems cannot be counted in real time.
Disclosure of Invention
Based on this, it is necessary to provide a link tracking method, apparatus, computer device and readable storage medium for solving the problem that the conventional technology cannot count the call relationship between systems in real time.
In a first aspect, an embodiment of the present application provides a link tracking method, including:
creating a timestamp file by taking a preset time as a period, and storing a link log of which the generation time is within a preset time period into the corresponding timestamp file;
analyzing each link log in the timestamp file to obtain a root node and a father node of each link node in each link log;
and merging the link nodes with the same root node and father node in the timestamp file to obtain a link log statistical result of the timestamp file.
In one embodiment, after obtaining the link log statistics of the timestamp file, the method further includes:
and acquiring the link calling relationship of the link node from the link log statistical result according to the identifier of the link node, and displaying the link calling relationship.
In one embodiment, the merging the link nodes having the same root node and parent node in the timestamp file to obtain the link log statistical result of the timestamp file includes:
counting the link parameters which have the same root node and belong to the same link branch in the timestamp file to obtain a link log counting result of the timestamp file; the link leg includes a link node and a parent node of the link node.
In one embodiment, the link log comprises: analyzing each link log in the timestamp file to determine a root node and a father node of each link node in each link log, wherein the steps of analyzing each link log in the timestamp file to determine the root node and the father node comprise:
analyzing each link log in the timestamp file according to a preset data structure;
and traversing each analyzed link log, and determining a root node and a father node of each link node according to the link ID, the link request sequence number and the link node name.
In one embodiment, the link parameters include: the link request times, link request time consumption and link request results are obtained by counting link parameters which have the same root node and belong to the same link branch in the timestamp file, and the link log statistical results of the timestamp file are obtained, and the link log statistical results comprise the following steps:
adding the times of the link requests which have the same root node and belong to the same link branch in the timestamp file to obtain the times of the link requests of the link branches in the timestamp file;
averaging the link request consumed time which has the same root node and belongs to the same link branch in the timestamp file to obtain the average link request consumed time of each link branch in the timestamp file;
and adding the times of the link request results which are wrong in the link request results which have the same root node and belong to the same link branch in the timestamp file to obtain the wrong link request times of each link branch in the timestamp file.
In one embodiment, the storing the link log whose generation time is within the preset time period to the corresponding timestamp file includes:
analyzing the link ID of the link log to obtain the generation time of the link log; the link ID includes a generation time of the link log;
and determining a preset time period corresponding to the generation time, and storing the link log to a timestamp file corresponding to the preset time period.
In one embodiment, after obtaining the link log statistics of the timestamp file, the method further includes:
and storing the link log statistical result of the timestamp file into a preset database.
In one embodiment, the preset time period is a time range with the creation time of the timestamp file as the starting time and lasting for a preset time length.
In one embodiment, the method further includes:
analyzing each link log in the timestamp file within a preset time interval after the creation time; the preset time interval is less than the average period of the data warehouse processing data.
In a second aspect, an embodiment of the present application provides a link tracking apparatus, including:
the creating module is used for creating a timestamp file by taking a preset time as a cycle and storing a link log of which the generation time is within a preset time period into a corresponding timestamp file;
the analysis module is used for analyzing each link log in the timestamp file to obtain a root node and a father node of each link node in each link log;
and the counting module is used for combining the link nodes with the same root node and father node in the timestamp file to obtain a link log counting result of the timestamp file.
In a third aspect, an embodiment of the present application provides a computer device, including a memory and a processor, where the memory stores a computer program, and the processor implements the following steps when executing the computer program:
creating a timestamp file by taking a preset time as a period, and storing a link log of which the generation time is within a preset time period into a corresponding timestamp file;
analyzing each link log in the timestamp file to obtain a root node and a father node of each link node in each link log;
and merging the link nodes with the same root node and the father node in the timestamp file to obtain a link log statistical result of the timestamp file.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the following steps:
creating a timestamp file by taking a preset time as a period, and storing a link log of which the generation time is within a preset time period into the corresponding timestamp file;
analyzing each link log in the timestamp file to obtain a root node and a father node of each link node in each link log;
and merging the link nodes with the same root node and father node in the timestamp file to obtain a link log statistical result of the timestamp file.
According to the link tracking method, the device, the computer equipment and the readable storage medium, firstly, a timestamp file is created with a preset duration as a period, link logs of which the generation time is within a preset time period are stored in the corresponding timestamp file, then, each link log in the timestamp file is analyzed to obtain a root node and a father node of each link node in each link log, and finally, the link nodes with the same root node and father node in the timestamp file are combined to obtain a link log statistical result of the timestamp file. In the method, each link log is stored in a timestamp file, each link log in the timestamp file can be counted at a certain time interval, and the time interval for counting each link log is obviously shortened relative to the data processing period of a data warehouse, so that the real-time performance of link log counting is greatly improved; and all the link logs are stored in corresponding timestamp files, so that the information integrity of the link log statistics is further ensured.
Drawings
FIG. 1 is a schematic diagram of an internal structure of a computer device according to an embodiment;
FIG. 2 is a flowchart illustrating a link tracking method according to an embodiment;
FIG. 2a is a diagram illustrating a format of a link invocation relationship, according to an embodiment;
fig. 3 is a schematic flowchart of a link tracking method according to another embodiment;
fig. 4 is a flowchart illustrating a link tracking method according to another embodiment;
FIG. 5 is a block diagram of a link tracking device according to an embodiment;
fig. 6 is a schematic structural diagram of a link tracking apparatus according to another embodiment;
fig. 7 is a schematic structural diagram of a link tracking apparatus according to yet another embodiment.
Detailed Description
The link tracking method provided by the embodiment of the application can be applied to the computer equipment shown in fig. 1. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communicating with an external terminal through a network connection. Optionally, the computer device may further comprise a display screen and an input device. Optionally, the computer device may be a server, a Personal Computer (PC), a personal digital assistant, or other terminal devices, such as a tablet computer (PAD), a mobile phone, and the like, and the specific form of the computer device is not limited in this embodiment.
In the conventional technology, when link tracking is performed, a data warehouse is usually used for storing system logs generated by all link requests, and then the same link requests in historical system logs are combined in a fixed time period, so that the data volume of the system logs can be greatly reduced, and the combined link request data is stored in a database for statistics of users. However, the period of processing data by the data warehouse used in the conventional technology is long, so that the call relation between systems cannot be counted in real time. The present application provides a link tracking method, an apparatus, a computer device and a readable storage medium, which aim to solve the above technical problems.
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions in the embodiments of the present application are further described in detail by the following embodiments in conjunction with the accompanying drawings. It should be understood that the specific embodiments described herein are merely illustrative of and not restrictive on the broad application.
It should be noted that the execution subject of the method embodiments described below may be a link tracking apparatus, which may be implemented as part of or all of a computer device by software, hardware, or a combination of software and hardware. The following method embodiments are described by taking the execution subject as the computer device as an example.
Fig. 2 is a flowchart illustrating a link tracking method according to an embodiment. The embodiment relates to a specific process that a computer device creates a timestamp file, stores a generated link log into a corresponding timestamp file, and performs statistics on the link log in the timestamp file. As shown in fig. 2, the method includes:
s101, creating a timestamp file by taking a preset time as a period, and storing a link log of which the generation time is within a preset time period into the corresponding timestamp file.
Specifically, the computer device creates a plurality of timestamp files with a preset time length as a period, and the naming format of the timestamp files can be year, month, day, hour, minute and second, so that the timestamp file names created at different times are different. The preset duration can be set according to the time requirement of the user for link tracking, such as one minute, two minutes, and the like, that is, the time period of each system call relation needs to be counted. Taking the preset time length as one minute as an example, assuming that the created first timestamp file is 20190717090130, the second timestamp file is 20190717090230, the third timestamp file is 20190717090330, and so on.
Then, the computer device stores the collected link logs into corresponding timestamp files according to the generation time and a preset time period of the collected link logs, and optionally, the preset time period may be a time range lasting for the preset time duration with the creation time of the timestamp files as the starting time. For example, assuming that the preset time duration is one minute, the first timestamp file is 20190717090130, the second timestamp file is 20190717090230, and the creation time of the first timestamp file is 9 hours, 1 minute and 30 seconds, from this time point, link logs generated within one minute are all stored in the first timestamp file; the second timestamp file is created at 9 hours, 2 minutes, 30 seconds, then from this point in time, a link log that lasts for one minute or so is stored in the second timestamp file, and so on.
The link logs are logs generated during system call and can be distributed in different servers, and then the computer equipment acquires the link logs from different servers. Optionally, the computer device may obtain each link log in real time, and then store the link log into a corresponding timestamp file, or may obtain the link log generated in the time length without using a server by using a preset time length as a period, which is not limited in this embodiment.
And S102, analyzing each link log in the timestamp file to obtain a root node and a father node of each link node in each link log.
Specifically, after creating the timestamp file, the computer device may analyze each link log in the timestamp file to obtain a root node and a parent node of each link node in each link log. Optionally, the storage form of the link log may be a tree structure, each node in the tree structure is a link node, which may be represented by a sequence number, that is, the root node is represented as 1, the child nodes of the root node are represented as 1.1, 1.2.., the child nodes of the 1.1 node are represented as 1.1.1, 1.1.2.., and so on, then by traversing the tree structure, the root node and the parent node of each link node may be known.
Optionally, the computer device may analyze each link log in the timestamp file immediately after a preset time period, or may analyze each link log in the timestamp file within a preset time interval after the creation time of the timestamp file. The preset time interval may be set according to a call duration called by a system request, and is usually longer than the preset time duration, for example, when the preset time duration is one minute, the preset time interval may be set to three minutes, that is, within three minutes after the timestamp file is created, the computer device performs statistics on the link logs in the timestamp, so that it is ensured that all the link logs in the preset time duration are completely collected, and although the set time interval is delayed by several minutes, compared with a data processing period of a data warehouse in the conventional technology, the real-time performance of the data processing period is greatly improved. Optionally, the preset time interval is smaller than an average period of processing data in the data warehouse. Therefore, the computer device can periodically analyze the link logs in the corresponding timestamp files within a preset time interval.
And S103, merging the link nodes with the same root node and the father node in the timestamp file to obtain a link log statistical result of the timestamp file.
Specifically, after the root node and the parent node of each link node are obtained, the computer device may merge the link nodes having the same root node and the same parent node, where the root node and the parent node also carry the request invocation relationship therebetween, and parameter information of each request invocation relationship, such as the request invocation times, the request invocation duration, and the like, and then when the computer device merges the link nodes having the same root node and the same parent node, the information is also merged at the same time, so as to obtain the link log statistical result.
Optionally, after the computer device obtains the statistical result of each link log, the result may be stored in a preset database, so that the user may view the statistical result in real time and track the link information.
In the link tracking method provided by this embodiment, a computer device first creates a timestamp file with a preset duration as a period, stores a link log generated within a preset time period into a corresponding timestamp file, then analyzes each link log in the timestamp file to obtain a root node and a parent node of each link node in each link log, and finally merges link nodes having the same root node and parent node in the timestamp file to obtain a link log statistical result of the timestamp file. In the method, each link log is stored in a timestamp file, each link log in the timestamp file can be counted at a certain time interval, and the time interval for counting each link log is obviously shortened relative to the data processing period of a data warehouse, so that the real-time performance of link log counting is greatly improved; and all the link logs are stored in corresponding timestamp files, so that the information integrity of the link log statistics is further ensured.
Optionally, in some embodiments, after obtaining the link log statistics of the timestamp file, the method further includes: and according to the identification of the link node, acquiring the link call relation of the link node from the link log statistical result, and displaying the link call relation. That is, when a user wants to query the call relationship of a certain link node (i.e., which link node calls the link node, and which link node calls the link node), the user can obtain the link call relationship of the link node from the link log statistical result by referring to the identifier of the link node, and the obtained link call relationship can be displayed by the computer device. Optionally, the display interface may further display the number of calls, the call duration, the number of times of call errors, and the like of the call relation of each link, so as to facilitate the user to check. The presentation form of the link invocation relation can be seen in fig. 2 a.
Optionally, in some embodiments, the merging the link nodes having the same root node and the parent node in the timestamp file to obtain the link log statistical result of the timestamp file includes: counting the link parameters which have the same root node and belong to the same link branch in the timestamp file to obtain a link log counting result of the timestamp file; a link leg includes a link node and a parent node of the link node.
Specifically, the computer device counts link parameters that have the same root node and belong to the same link branch in one timestamp file, where the same link branch is the same for each node in the link branch, and counts the link parameters of all a-B branches, for example, for a link log having the same root node. Optionally, the computer device may also perform statistics on link parameters belonging to the same link branch in all link logs in the timestamp file, that is, perform statistics on link logs with different root nodes and also perform statistics on link parameters of all a-B branches.
Fig. 3 is a flowchart illustrating a link tracking method according to another embodiment. The embodiment relates to a specific process that the computer device analyzes each link log in the timestamp file and determines a root node and a father node of each link node in each link log. Optionally, on the basis of the foregoing embodiment, as shown in fig. 3, S102 includes:
s201, analyzing each link log in the time stamp file according to a preset data structure.
Specifically, the link logs may include link IDs, link node sequence numbers and link node names, the computer device may first analyze each link log in the timestamp file according to a preset data structure, and may obtain the link ID, the link node sequence number and the link node name of each link log, and optionally, the link node sequence number may be a sequence number of the tree structure; from this information, the computer device may then determine the root and parent nodes of each link node, and the node names of each root and parent node.
S202, traversing each analyzed link log, and determining a root node and a father node of each link node according to the link ID, the link node sequence number and the link node name.
Specifically, after analyzing the link logs according to a preset data structure, the computer device may traverse the analyzed link logs, and may determine a root node and a parent node of each link node according to the link ID, the link node sequence number, and the link node name. For example, after the computer traverses the link log, if the sequence number of a certain link node is 1.1.2, the sequence number of the root node is 1, and the sequence number of the parent node is 1.1, then the corresponding link ID and the link node name, that is, the information of the root node and the parent node, may be obtained according to the sequence numbers.
Optionally, the link parameters may include a number of link requests, a time consumed by the link requests, and a link request result, where the link request result includes a request success and a request error; the computer device may add the link request times of the same link branch having the same root node in the timestamp file to obtain the link request times of each link branch of the timestamp file, where if there are 10 a-B branches in the timestamp file, the link request times of the a-B branches of the timestamp file are 10; averaging the link request consumed time which has the same root node and belongs to the same link branch in the timestamp file to obtain the average link request consumed time of each link branch in the timestamp file, wherein if the total consumed time of the A-B branches in the timestamp file is 10 and is 200ms, the average link request consumed time of the A-B branches in the timestamp file is 20ms; and adding the times of wrong link request results in the link request results which have the same root node and belong to the same link branch in the timestamp file to obtain the times of wrong link requests of the link branches in the timestamp file, wherein if the number of A-B branches in the timestamp file is 10 and the results of 3 link requests are wrong requests, the times of wrong link requests of the A-B branches in the timestamp file are 3.
In the link tracking method provided in this embodiment, the computer device analyzes each link log in the timestamp file according to a preset data structure, and traverses each analyzed link log to determine a root node and a parent node of each link node in each link log. According to the method, the root node and the father node of each link node are determined according to the link ID, the link node sequence number and the link node name by traversing each analyzed link log, the superior-subordinate calling relation of each link node can be tracked, and the statistical result of the link log is more complete.
Fig. 4 is a flowchart illustrating a link tracking method according to another embodiment. The present embodiment relates to a specific process in which a computer device stores a link log whose generation time is within a preset time period to a corresponding timestamp file, optionally, on the basis of the foregoing embodiment, as shown in fig. 4, S101 includes:
s301, analyzing the link ID of the link log to obtain the generation time of the link log; the link ID includes the generation time of the link log.
Specifically, the link log may include a link ID, and the link ID may uniquely identify one link log. Optionally, the link ID may include a generation time of the link log, and when the generation times of the plurality of link logs are the same, the link ID may further include different characters generated randomly to distinguish the different link logs. The computer device can obtain the generation time of the link log by analyzing the link ID of the link log.
S302, determining a preset time period corresponding to the generation time, and storing the link log to a timestamp file corresponding to the preset time period.
Specifically, after obtaining the generation time of the link log, the computer device may determine a corresponding preset time period, and store the link log in a corresponding timestamp file. Exemplarily, assuming that the first timestamp file is 20190717090130 and the second timestamp file is 20190717090230, the first reference time period is 9 hours, 1 minute, and 30 seconds, and the second reference time period is 9 hours, 2 minutes, and 30 seconds, and the first reference time period is one minute, and if the generation time of the link log obtained by the analysis of the computer device is 9 hours, 1 minute, and 50 seconds, the link log is stored in the first timestamp file corresponding to the first preset time period.
In the link tracking method provided by this embodiment, the computer device determines the generation time of the link log by analyzing the link ID of the link log, so as to improve the accuracy of the determined generation time of the link log, then determines the preset time period corresponding to the generation time and stores the link log into the corresponding timestamp file, thereby improving the accuracy of the statistical result of the link log within the preset time period.
It should be understood that although the various steps in the flowcharts of fig. 2-4 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2-4 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternating with other steps or at least some of the sub-steps or stages of other steps.
Fig. 5 is a schematic structural diagram of a link tracking apparatus according to an embodiment. As shown in fig. 5, the apparatus includes: a creation module 11, a parsing module 12 and a statistics module 13.
Specifically, the creating module 11 is configured to create a timestamp file with a preset time as a cycle, and store a link log of which the generation time is within a preset time period to the corresponding timestamp file.
And the analysis module 12 is configured to analyze each link log in the timestamp file to obtain a root node and a parent node of each link node in each link log.
And the counting module 13 is configured to combine the link nodes having the same root node and the parent node in the timestamp file to obtain a link log counting result of the timestamp file.
The link tracking apparatus provided in this embodiment may implement the method embodiments described above, and the implementation principle and technical effect are similar, which are not described herein again.
In one embodiment, the apparatus further includes a display module, configured to obtain a link call relationship of the link node from the link log statistical result according to the identifier of the link node, and display the link call relationship.
In one embodiment, the statistics module 13 is specifically configured to perform statistics on link parameters that have the same root node and belong to the same link branch in the timestamp file to obtain a link log statistics result of the timestamp file; the link leg includes a link node and a parent node of the link node.
Fig. 6 is a schematic structural diagram of a link tracking apparatus according to another embodiment. On the basis of the embodiment shown in fig. 5, the link log includes: as shown in fig. 6, the parsing module 12 includes: a first parsing unit 121 and a first determining unit 122.
Specifically, the first parsing unit 121 is configured to parse each link log in the timestamp file according to a preset data structure.
The first determining unit 122 is configured to traverse the analyzed link logs, and determine a root node and a parent node of each link node according to the link ID, the link node sequence number, and the link node name.
The link tracking apparatus provided in this embodiment may perform the method embodiments, and the implementation principle and technical effect are similar, which are not described herein again.
In one embodiment, the link parameters include: the statistics module 13 is specifically configured to add the link request times that have the same root node and belong to the same link branch in the timestamp file to obtain the link request times of each link branch in the timestamp file; averaging the link request consumed time which has the same root node and belongs to the same link branch in the timestamp file to obtain the average link request consumed time of each link branch in the timestamp file; and adding the times of the link request results which are wrong in the link request results which have the same root node and belong to the same link branch in the timestamp file to obtain the wrong link request times of each link branch in the timestamp file.
Fig. 7 is a schematic structural diagram of a link tracking apparatus according to yet another embodiment. On the basis of the embodiment shown in fig. 5 or fig. 6, as shown in fig. 7, the creating module 11 includes: a second parsing unit 111 and a second determining unit 112.
Specifically, the second analyzing unit 111 is configured to analyze a link ID of the link log to obtain a generation time of the link log; the link ID includes the generation time of the link log.
The second determining unit 112 is configured to determine a preset time period corresponding to the generation time, and store the link log into a timestamp file corresponding to the preset time period.
The link tracking apparatus provided in this embodiment may perform the method embodiments, and the implementation principle and technical effect are similar, which are not described herein again.
In one embodiment, the apparatus further includes a storage module, configured to store the link log statistics of the timestamp file in a preset database.
In one embodiment, the preset time period is a time range with the creation time of the timestamp file as the starting time and lasting for a preset time length.
In one embodiment, the parsing module 12 is further configured to parse each link log in the timestamp file within a preset time interval after the creation time; the preset time interval is less than the average period of the data warehouse processing data.
For the specific definition of the link tracking device, reference may be made to the above definition of the link tracking method, which is not described herein again. The modules in the link tracking apparatus may be implemented in whole or in part by software, hardware, and a combination 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.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 1. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operating system and the computer program to run on the non-volatile storage medium. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a link tracing method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 1 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the following steps when executing the computer program:
creating a timestamp file by taking a preset time as a period, and storing a link log of which the generation time is within a preset time period into a corresponding timestamp file;
analyzing each link log in the timestamp file to obtain a root node and a father node of each link node in each link log;
and merging the link nodes with the same root node and father node in the timestamp file to obtain a link log statistical result of the timestamp file.
The implementation principle and technical effect of the computer device provided in this embodiment are similar to those of the method embodiment described above, and are not described herein again.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
and acquiring the link calling relationship of the link node from the link log statistical result according to the identifier of the link node, and displaying the link calling relationship.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
counting the link parameters which have the same root node and belong to the same link branch in the timestamp file to obtain a link log counting result of the timestamp file; the link leg includes a link node and a parent node of the link node.
In one embodiment, the link log comprises: the processor executes the computer program and further implements the following steps:
analyzing each link log in the timestamp file according to a preset data structure;
and traversing each analyzed link log, and determining a root node and a father node of each link node according to the link ID, the link request sequence number and the link node name.
In one embodiment, the link parameters include: the number of link requests, the link request time consumption and the link request result, and the processor further realizes the following steps when executing the computer program:
adding the times of the link requests which have the same root node and belong to the same link branch in the timestamp file to obtain the times of the link requests of the link branches in the timestamp file;
carrying out average processing on the link request consumed time which has the same root node and belongs to the same link branch in the timestamp file to obtain the average link request consumed time of each link branch in the timestamp file;
and adding the times of the link request results which are wrong in the link request results which have the same root node and belong to the same link branch in the timestamp file to obtain the wrong link request times of each link branch in the timestamp file.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
analyzing the link ID of the link log to obtain the generation time of the link log; the link ID includes a generation time of the link log;
and determining a preset time period corresponding to the generation time, and storing the link log to a timestamp file corresponding to the preset time period.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
and storing the link log statistical result of the timestamp file into a preset database.
In one embodiment, the preset time period is a time range which takes the creation time of the timestamp file as the starting time and lasts for a preset time length.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
analyzing each link log in the timestamp file within a preset time interval after the creation time; the preset time interval is less than the average period of the data warehouse processing data.
In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored which, when executed by a processor, performs the steps of:
creating a timestamp file by taking a preset time as a period, and storing a link log of which the generation time is within a preset time period into a corresponding timestamp file;
analyzing each link log in the timestamp file to obtain a root node and a father node of each link node in each link log;
and merging the link nodes with the same root node and father node in the timestamp file to obtain a link log statistical result of the timestamp file.
The implementation principle and technical effect of the computer-readable storage medium provided in this embodiment are similar to those of the above method embodiments, and are not described herein again.
In one embodiment, the computer program when executed by the processor further performs the steps of:
and acquiring the link calling relationship of the link node from the link log statistical result according to the identifier of the link node, and displaying the link calling relationship.
In one embodiment, the computer program when executed by the processor further performs the steps of:
counting the link parameters which have the same root node and belong to the same link branch in the timestamp file to obtain a link log counting result of the timestamp file; the link leg includes a link node and a parent node of the link node.
In one embodiment, the link log comprises: the computer program, when executed by the processor, further performs the steps of:
analyzing each link log in the timestamp file according to a preset data structure;
and traversing each analyzed link log, and determining a root node and a father node of each link node according to the link ID, the link request sequence number and the link node name.
In one embodiment, the link parameters include: the number of link requests, the link request elapsed time and the link request result, the computer program when executed by the processor further implementing the steps of:
adding the link request times which have the same root node and belong to the same link branch in the timestamp file to obtain the link request times of each link branch in the timestamp file;
averaging the link request consumed time which has the same root node and belongs to the same link branch in the timestamp file to obtain the average link request consumed time of each link branch in the timestamp file;
and adding the times of the link request results which are wrong in the link request results which have the same root node and belong to the same link branch in the timestamp file to obtain the wrong link request times of each link branch in the timestamp file.
In one embodiment, the computer program when executed by the processor further performs the steps of:
analyzing the link ID of the link log to obtain the generation time of the link log; the link ID includes a generation time of the link log;
and determining a preset time period corresponding to the generation time, and storing the link log to a timestamp file corresponding to the preset time period.
In one embodiment, the computer program when executed by the processor further performs the steps of:
and storing the link log statistical result of the timestamp file into a preset database.
In one embodiment, the preset time period is a time range with the creation time of the timestamp file as the starting time and lasting for a preset time length.
In one embodiment, the computer program when executed by the processor further performs the steps of:
analyzing each link log in the time stamp file within a preset time interval after the creation time; the preset time interval is less than the average period of the data warehouse processing data.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), rambus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
All possible combinations of the technical features in the above embodiments may not be described for the sake of brevity, but should be considered as being within the scope of the present disclosure as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, and these are all within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (8)

1. A method of link tracing, comprising:
creating a timestamp file by taking a preset time as a period, and storing a link log of which the generation time is within a preset time period into a corresponding timestamp file; the preset time period is a time range which takes the creating time of the timestamp file as the starting time and lasts for the preset time length, and the timestamp corresponding to the timestamp file is the creating time of the timestamp file;
analyzing each link log in the timestamp file according to a preset data structure in a preset time interval after the creation time; traversing each analyzed link log, and determining a root node and a father node of each link node according to the link ID, the link node sequence number and the link node name; the preset time period is less than the preset time interval, and the preset time interval is less than the average period of processing data of the data warehouse; the link log includes: the link ID, the link node sequence number and the link node name;
counting the link parameters which have the same root node and belong to the same link branch in the timestamp file to obtain a link log counting result of the timestamp file; the link leg includes a link node and a parent node of the link node.
2. The method of claim 1, wherein after obtaining the link log statistics for the timestamp file, the method further comprises:
and acquiring the link calling relationship of the link node from the link log statistical result according to the identifier of the link node, and displaying the link calling relationship.
3. The method of claim 1, wherein the link parameters comprise: the link request times, link request time consumption and link request results, wherein the link parameters which have the same root node and belong to the same link branch in the timestamp file are counted to obtain the link log statistical results of the timestamp file, and the link log statistical results comprise:
adding the link request times which have the same root node and belong to the same link branch in the timestamp file to obtain the link request times of each link branch in the timestamp file;
averaging the link request consumed time which has the same root node and belongs to the same link branch in the timestamp file to obtain the average link request consumed time of each link branch in the timestamp file;
and adding the times of the link request results which are wrong in the link request results which have the same root node and belong to the same link branch in the timestamp file to obtain the wrong link request times of each link branch in the timestamp file.
4. The method of claim 1, wherein storing the link log with the generation time within the preset time period to a corresponding timestamp file comprises:
analyzing the link ID of the link log to obtain the generation time of the link log; the link ID includes a generation time of the link log;
and determining a preset time period corresponding to the generation time, and storing the link log to a timestamp file corresponding to the preset time period.
5. The method of any of claims 1-4, wherein after obtaining the link log statistics for the timestamp file, the method further comprises:
and storing the link log statistical result of the timestamp file into a preset database.
6. A link tracing apparatus, comprising:
the creating module is used for creating a timestamp file by taking a preset time as a cycle and storing a link log of which the generating time is within a preset time period into the corresponding timestamp file; the preset time period is a time range which takes the creation time of the timestamp file as the starting time and lasts for the preset time length, and the timestamp corresponding to the timestamp file is the creation time of the timestamp file;
the analysis module is used for analyzing each link log in the timestamp file according to a preset data structure in a preset time interval after the creation time; traversing each analyzed link log, and determining a root node and a father node of each link node according to the link ID, the link node sequence number and the link node name; the preset time period is less than the preset time interval, and the preset time interval is less than the average period of the data warehouse processing data; the link log includes: the link ID, the link node sequence number and the link node name;
the statistical module is used for carrying out statistics on the link parameters which have the same root node and belong to the same link branch in the timestamp file to obtain a link log statistical result of the timestamp file; the link leg includes a link node and a parent node of the link node.
7. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor realizes the steps of the method according to any of claims 1-5 when executing the computer program.
8. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 5.
CN201910783701.XA 2019-08-23 2019-08-23 Link tracking method and device, computer equipment and readable storage medium Active CN110569222B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910783701.XA CN110569222B (en) 2019-08-23 2019-08-23 Link tracking method and device, computer equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910783701.XA CN110569222B (en) 2019-08-23 2019-08-23 Link tracking method and device, computer equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN110569222A CN110569222A (en) 2019-12-13
CN110569222B true CN110569222B (en) 2022-11-15

Family

ID=68775857

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910783701.XA Active CN110569222B (en) 2019-08-23 2019-08-23 Link tracking method and device, computer equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN110569222B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112134739B (en) * 2020-09-24 2022-07-08 平安科技(深圳)有限公司 Link state tracking method and device, electronic equipment and computer storage medium
CN112433757A (en) * 2020-11-27 2021-03-02 中国建设银行股份有限公司 Method and device for determining interface calling relationship
CN113094423A (en) * 2021-03-30 2021-07-09 鞍钢集团北京研究院有限公司 Method and device for constructing product gene chain, computer equipment and storage medium
CN112988520B (en) * 2021-04-22 2021-08-13 北京搜狐新媒体信息技术有限公司 Service call link monitoring method and device
CN113760648A (en) * 2021-07-22 2021-12-07 北京房江湖科技有限公司 Interface calling link time consumption statistical method and device, equipment and medium
CN113891174B (en) * 2021-09-27 2023-09-29 上海哔哩哔哩科技有限公司 Bandwidth statistics method and system for live video
CN114385551B (en) * 2021-12-20 2023-03-24 武汉物易云通网络科技有限公司 Log time-sharing management method, device, equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104317811A (en) * 2014-09-25 2015-01-28 小米科技有限责任公司 Operational indicator summarizing method, operational indicator summarizing device and server
CN105488187A (en) * 2015-12-02 2016-04-13 北京四达时代软件技术股份有限公司 Method and device for extracting multi-source heterogeneous data increment
CN105550241A (en) * 2015-12-07 2016-05-04 珠海多玩信息技术有限公司 Multidimensional database query method and apparatus
CN106790718A (en) * 2017-03-16 2017-05-31 北京搜狐新媒体信息技术有限公司 Service call link analysis method and system
CN107016039A (en) * 2017-01-06 2017-08-04 阿里巴巴集团控股有限公司 The method and Database Systems of database write-in
CN110019236A (en) * 2017-12-29 2019-07-16 北京金风科创风电设备有限公司 non-recursive classification method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9202052B1 (en) * 2013-06-21 2015-12-01 Emc Corporation Dynamic graph anomaly detection framework and scalable system architecture

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104317811A (en) * 2014-09-25 2015-01-28 小米科技有限责任公司 Operational indicator summarizing method, operational indicator summarizing device and server
CN105488187A (en) * 2015-12-02 2016-04-13 北京四达时代软件技术股份有限公司 Method and device for extracting multi-source heterogeneous data increment
CN105550241A (en) * 2015-12-07 2016-05-04 珠海多玩信息技术有限公司 Multidimensional database query method and apparatus
CN107016039A (en) * 2017-01-06 2017-08-04 阿里巴巴集团控股有限公司 The method and Database Systems of database write-in
CN106790718A (en) * 2017-03-16 2017-05-31 北京搜狐新媒体信息技术有限公司 Service call link analysis method and system
CN110019236A (en) * 2017-12-29 2019-07-16 北京金风科创风电设备有限公司 non-recursive classification method and device

Also Published As

Publication number Publication date
CN110569222A (en) 2019-12-13

Similar Documents

Publication Publication Date Title
CN110569222B (en) Link tracking method and device, computer equipment and readable storage medium
CN108874926B (en) Mass data query method, device, computer equipment and storage medium
CN108197200B (en) Log tracking method and device, computer equipment and storage medium
CN112910945B (en) Request link tracking method and service request processing method
CN111563368A (en) Report generation method and device, computer equipment and storage medium
CN107748752B (en) Data processing method and device
CN113076104A (en) Page generation method, device, equipment and storage medium
CN112434048B (en) Data cross analysis method and device, computer equipment and storage medium
CN111026647B (en) Method and device for acquiring code coverage rate, computer equipment and storage medium
CN110750443A (en) Webpage testing method and device, computer equipment and storage medium
CN110633306A (en) Service data processing method and device, computer equipment and storage medium
CN113391901A (en) RPA robot management method, device, equipment and storage medium
CN111538754A (en) Data collection management system, method, device, equipment and storage medium
CN114168544A (en) Clinical test data processing method and device, computer equipment and storage medium
CN112671878B (en) Block chain information subscription method, device, server and storage medium
CN111046240B (en) Gateway traffic statistics method, device, computer equipment and storage medium
CN111259050A (en) User operation track recording method and device, computer equipment and storage medium
CN112434062A (en) Quasi-real-time data processing method, device, server and storage medium
CN111679963A (en) User behavior data processing method, device, equipment and storage medium
CN104317820B (en) Statistical method and device for report forms
CN112835779A (en) Test case determination method and device and computer equipment
CN110148011B (en) Method, device, equipment and medium for analyzing active amount drop based on big data
CN115442225A (en) Method and device for reporting buried point log and method and device for monitoring buried point quality
CN108418827B (en) Network behavior analysis method and device
CN113778996A (en) Large data stream data processing method and device, electronic 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