Web log display method, device, equipment and storage medium

By identifying and encapsulating application requests and obtaining and displaying their network logs, the problem of not being able to view network logs on terminal devices is solved, and the log display and positioning functions that are valuable to operation and maintenance users are realized.

CN114721907BActive Publication Date: 2025-03-11SHENZHEN PING AN SMART HEALTHCARE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210368671.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-08
Publication Date
2025-03-11
Estimated Expiration
2042-04-08

AI Technical Summary

Technical Problem

The network logs of the program running cannot be viewed on the terminal device, which makes it difficult for operation and maintenance users to quickly locate the program.

Method used

By identifying pending applications, encapsulate preset requests as information interception requests, run interception requests in real time to obtain request and response information, generate request logs, and display logs and response status in preset list pages and details pages.

Benefits of technology

It realizes the display of network logs during program runtime, helps operation and maintenance users to quickly locate problems, improves the comprehensiveness and recognition of logs, and is suitable for the needs of different users.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114721907B_ABST
    Figure CN114721907B_ABST
Patent Text Reader

Abstract

The present invention relates to monitoring, and provides a network log display method, device, equipment and storage medium. The method encapsulates a preset request of a to-be-processed application based on a preset function, obtains an information interception request, runs the information interception request in real time, obtains request information and response information, and generates a request log including a uniform resource locator and a request method, identifies the response status of the preset request, displays the uniform resource locator and the request method based on a preset list page, displays the request log based on a preset detail page and the response status, and can intuitively display the request log. In addition, the present invention also relates to blockchain technology, and the request log can be stored in a blockchain.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of monitoring technology, and in particular to a network log display method, device, equipment and storage medium. Background Art

[0002] Currently, when running a program in debug mode on a terminal device, the inventors realized that the network logs of the program running cannot be viewed on the terminal device, resulting in discrepancies between the information displayed on the front-end page and the background data, and the operation and maintenance users cannot quickly locate the problem.

[0003] Therefore, how to display the network logs when the program is running to assist operation and maintenance users in locating program problems has become an urgent problem that needs to be solved. Summary of the invention

[0004] In view of the above, it is necessary to provide a network log display method, device, equipment and storage medium, which can directly display the network log when the program is running.

[0005] In one aspect, the present invention provides a network log display method, which is applied to an electronic device. The network log display method includes:

[0006] receiving a network log display request, and identifying a pending application according to the network log display request;

[0007] Encapsulating the preset request of the application to be processed based on the preset function to obtain an information interception request;

[0008] Running the information interception request in real time to obtain request information corresponding to the preset request and response information corresponding to the preset request;

[0009] Generate a request log according to the request information and the response information, wherein the request log includes a uniform resource locator and a request method of the preset request;

[0010] Identifying a response status of the preset request according to the response information;

[0011] The uniform resource locator and the request method are displayed based on a preset list page, and the request log is displayed based on a preset detail page and the response status.

[0012] According to a preferred embodiment of the present invention, encapsulating the preset request of the application to be processed based on the preset function to obtain the information interception request includes:

[0013] Acquire a request for the to-be-processed application to communicate with a preset network as the preset request, and acquire a request identifier of the preset request;

[0014] Acquire a first callback function from a preset callback library based on the first identifier, and acquire a second callback function from the preset callback library based on the second identifier;

[0015] Writing the request identifier into the first callback function to obtain a request callback function, and writing the request identifier into the second callback function to obtain a response callback function;

[0016] Concatenate the request callback function and the response callback function to obtain a target callback function;

[0017] The initial callback function in the preset function is replaced with the target callback function to obtain the information interception request.

[0018] According to a preferred embodiment of the present invention, the real-time execution of the information interception request to obtain the request information corresponding to the preset request and the response information corresponding to the preset request includes:

[0019] Monitoring in real time whether the application to be processed sends the preset request to the preset network;

[0020] When it is monitored that the application to be processed successfully sends the preset request to the preset network, the request information is obtained from the preset request based on the request basic tag in the information interception request, and the time when the preset request is successfully sent is obtained as the target time;

[0021] Monitoring, based on the target time, whether the application to be processed receives a feedback response sent by the preset network;

[0022] When it is monitored that the application to be processed successfully receives the feedback response sent by the preset network, the response information is obtained from the feedback response based on the response basic tag in the information interception request.

[0023] According to a preferred embodiment of the present invention, identifying the application to be processed according to the network log display request includes:

[0024] Parsing the message of the network log display request to obtain data information carried in the message;

[0025] Extracting a communication object identifier from the data information;

[0026] An application corresponding to the communication object identifier is determined as the application to be processed.

[0027] According to a preferred embodiment of the present invention, the step of identifying the response status of the preset request according to the response information includes:

[0028] Encoding the response information to obtain a response vector;

[0029] Get the phrase vector of the preset phrase;

[0030] Calculating the vector similarity between the response vector and the phrase vector;

[0031] If the vector similarity is greater than a first preset threshold, determining the response status as a response failure; or

[0032] If the vector similarity is less than a second preset threshold, the response status is determined as a successful response, and the first preset threshold is greater than the second preset threshold.

[0033] According to a preferred embodiment of the present invention, the displaying of the request log based on the preset detail page and the response status includes:

[0034] Acquire a display interface of the electronic device, wherein the display interface includes the preset details page;

[0035] Obtaining a state color corresponding to the response state;

[0036] The request log is displayed on the preset detail page based on the status color.

[0037] According to a preferred embodiment of the present invention, the method further comprises:

[0038] Converting the display interface into a hidden icon based on a movable view container;

[0039] Obtaining a log display position from the network log display request;

[0040] The screen position of the hidden icon in the electronic device is set based on the log display position.

[0041] On the other hand, the present invention further provides a network log display device, the network log display device comprising:

[0042] an identification unit, configured to receive a network log display request and identify an application to be processed according to the network log display request;

[0043] An encapsulation unit, configured to encapsulate a preset request of the application to be processed based on a preset function to obtain an information interception request;

[0044] An operation unit, used for executing the information interception request in real time, obtaining request information corresponding to the preset request and response information corresponding to the preset request;

[0045] A generating unit, configured to generate a request log according to the request information and the response information, wherein the request log includes a uniform resource locator and a request method of the preset request;

[0046] The identification unit is further configured to identify a response status of the preset request according to the response information;

[0047] A display unit is used to display the uniform resource locator and the request method based on a preset list page, and to display the request log based on a preset detail page and the response status.

[0048] On the other hand, the present invention further provides an electronic device, comprising:

[0049] a memory storing computer readable instructions; and

[0050] The processor executes the computer-readable instructions stored in the memory to implement the network log display method.

[0051] On the other hand, the present invention further proposes a computer-readable storage medium, in which computer-readable instructions are stored. The computer-readable instructions are executed by a processor in an electronic device to implement the network log display method.

[0052] It can be seen from the above technical solutions that the present invention can encapsulate the preset request of the pending application in combination with the preset function by identifying the pending application, so as to quickly generate the information interception request, which is beneficial to intercept the network log generated by the pending application during operation. By intercepting the request information and the response information, the comprehensiveness of the request log can be improved, and then by displaying the request log, the operation and maintenance user can be assisted to fully view the network log of the preset request. At the same time, by displaying the response status, the recognition of the network log is improved, which is beneficial to assist the operation and maintenance user to quickly locate the network log that needs to be analyzed. In addition, by displaying the request log in the preset list page and the preset details page respectively, it can be adapted to the needs of different users. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 It is a flow chart of a preferred embodiment of the network log display method of the present invention.

[0054] Figure 2 It is a functional module diagram of a preferred embodiment of the network log display device of the present invention.

[0055] Figure 3 It is a structural schematic diagram of an electronic device of a preferred embodiment of the network log display method of the present invention. DETAILED DESCRIPTION

[0056] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention is described in detail below with reference to the accompanying drawings and specific embodiments.

[0057] like Figure 1 FIG. 1 is a flow chart of a preferred embodiment of the network log display method of the present invention. According to different requirements, the order of the steps in the flow chart can be changed, and some steps can be omitted.

[0058] The web log display method can acquire and process relevant data based on artificial intelligence technology. Artificial Intelligence (AI) is a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0059] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0060] The network log display method is applied to one or more electronic devices, and the electronic device is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored computer-readable instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (ASIC), programmable gate arrays (FPGA), digital signal processors (DSP), embedded devices, etc.

[0061] The electronic device may be any electronic product that can perform human-computer interaction with a user, such as a personal computer, a tablet computer, a smart phone, a personal digital assistant (PDA), a game console, an interactive network television (IPTV), a smart wearable device, etc.

[0062] The electronic device may include a network device and / or a user device. The network device includes, but is not limited to, a single network electronic device, an electronic device group consisting of multiple network electronic devices, or a cloud consisting of a large number of hosts or network electronic devices based on cloud computing.

[0063] The network where the electronic device is located includes, but is not limited to: the Internet, a wide area network, a metropolitan area network, a local area network, a virtual private network (VPN), etc.

[0064] The network log display method may be stored in the electronic device in the form of a plug-in.

[0065] S10, receiving a network log display request, and identifying an application to be processed according to the network log display request.

[0066] In at least one embodiment of the present invention, the network log display request may be triggered by an operation and maintenance user. The network log display request carries a communication object identifier, and the communication object identifier is used to indicate the application to be processed.

[0067] The application program to be processed may be any application software, and the present invention does not limit the application program to be processed.

[0068] In at least one embodiment of the present invention, the electronic device identifying the application to be processed according to the network log display request includes:

[0069] Parsing the message of the network log display request to obtain data information carried in the message;

[0070] Extracting a communication object identifier from the data information;

[0071] An application corresponding to the communication object identifier is determined as the application to be processed.

[0072] By parsing the message, the parsing efficiency of the data information can be improved, and then by obtaining the communication object identifier from the data information, the extraction efficiency of the communication object identifier can be further improved because the data information does not contain interference from redundant information such as a message header.

[0073] S11, encapsulating the preset request of the application to be processed based on a preset function to obtain an information interception request.

[0074] In at least one embodiment of the present invention, the preset function refers to a constructor including an initial callback function.

[0075] The preset request refers to a request for the to-be-processed application to communicate with a preset network, wherein the preset network may be the Internet.

[0076] The information interception request is used to intercept requests and responses.

[0077] In at least one embodiment of the present invention, the electronic device encapsulates the preset request of the application to be processed based on a preset function to obtain the information interception request, including:

[0078] Acquire a request for the to-be-processed application to communicate with a preset network as the preset request, and acquire a request identifier of the preset request;

[0079] Acquire a first callback function from a preset callback library based on the first identifier, and acquire a second callback function from the preset callback library based on the second identifier;

[0080] Writing the request identifier into the first callback function to obtain a request callback function, and writing the request identifier into the second callback function to obtain a response callback function;

[0081] Concatenate the request callback function and the response callback function to obtain a target callback function;

[0082] The initial callback function in the preset function is replaced with the target callback function to obtain the information interception request.

[0083] The request identifier is used to indicate the preset request, for example, the request identifier may be wx.request.

[0084] The preset callback library stores a plurality of preset callback functions.

[0085] The first callback function is used to intercept information corresponding to the request basic tag in the request. The request basic tag may include, but is not limited to: http address, request method, request header and parameters, etc.

[0086] The second callback function is used to intercept information corresponding to the response basic tag in the response. The response basic tag may include, but is not limited to: a response header, a return value, etc.

[0087] Through the first callback function and the second callback function, since there is no need to repeatedly construct a callback function, a response callback function can be quickly obtained, thereby improving the generation efficiency of the information interception request.

[0088] S12, running the information interception request in real time to obtain request information corresponding to the preset request and response information corresponding to the preset request.

[0089] In at least one embodiment of the present invention, the request information refers to information corresponding to the request basic tag in the preset request, and the response information refers to information corresponding to the response basic tag in a feedback response corresponding to the preset request.

[0090] In at least one embodiment of the present invention, the electronic device executes the information interception request in real time, and obtains the request information corresponding to the preset request and the response information corresponding to the preset request, including:

[0091] Monitoring in real time whether the application to be processed sends the preset request to the preset network;

[0092] When it is monitored that the application to be processed successfully sends the preset request to the preset network, the request information is obtained from the preset request based on the request basic tag in the information interception request, and the time when the preset request is successfully sent is obtained as the target time;

[0093] Monitoring, based on the target time, whether the application to be processed receives a feedback response sent by the preset network;

[0094] When it is monitored that the application to be processed successfully receives the feedback response sent by the preset network, the response information is obtained from the feedback response based on the response basic tag in the information interception request.

[0095] By monitoring the preset request in real time, omissions in monitoring the preset request can be avoided, thereby improving the comprehensiveness of obtaining the request information; and by monitoring the feedback response at the target time, invalid monitoring of the feedback response can be avoided, thereby improving the accuracy of the response information.

[0096] S13, generating a request log according to the request information and the response information, wherein the request log includes a uniform resource locator and a request method of the preset request.

[0097] It should be emphasized that in order to further ensure the privacy and security of the above request log, the above request log can also be stored in a blockchain node.

[0098] In at least one embodiment of the present invention, the uniform resource locator refers to a specific location where the response information is obtained from the Internet, and the uniform resource locator may be address information.

[0099] The request method includes a post method and a get method.

[0100] In at least one embodiment of the present invention, the electronic device concatenates the request information and the response information to obtain the request log.

[0101] S14: Identify a response status of the preset request according to the response information.

[0102] In at least one embodiment of the present invention, the response status includes response failure and response success.

[0103] In at least one embodiment of the present invention, the electronic device identifying the response status of the preset request according to the response information includes:

[0104] Encoding the response information to obtain a response vector;

[0105] Get the phrase vector of the preset phrase;

[0106] Calculating the vector similarity between the response vector and the phrase vector;

[0107] If the vector similarity is greater than a first preset threshold, determining the response status as a response failure; or

[0108] If the vector similarity is less than a second preset threshold, the response status is determined as a successful response, and the first preset threshold is greater than the second preset threshold.

[0109] The response vector refers to a vector generated after the response information is encoded by a preset encoding mapping table.

[0110] The preset phrases include words displayed when a response fails. For example, the preset phrases may include error, etc.

[0111] The first preset threshold and the second preset threshold can be set according to actual needs. For example, the first preset threshold can be 95%, and the second preset threshold can be 20%.

[0112] By comparing the response vector with the phrase vector of the preset phrase, since the vocabulary corresponding to the response failure is relatively stable, the recognition accuracy of the response state can be improved. By introducing the first preset threshold and the second preset threshold, the accuracy of the response state can be further improved.

[0113] S15, displaying the uniform resource locator and the request method based on a preset list page, and displaying the request log based on a preset detail page and the response status.

[0114] In at least one embodiment of the present invention, the preset list page and the preset details page are pages in the display interface, respectively.

[0115] In at least one embodiment of the present invention, the electronic device presenting the uniform resource locator and the request method based on a preset list page includes:

[0116] Generate a target list according to the uniform resource locator and the request method;

[0117] The target list is displayed on the preset list page.

[0118] In at least one embodiment of the present invention, the electronic device displays the request log based on the preset detail page and the response status, including:

[0119] Acquire a display interface of the electronic device, wherein the display interface includes the preset details page;

[0120] Obtaining a state color corresponding to the response state;

[0121] The request log is displayed on the preset detail page based on the status color.

[0122] Wherein, the display interface also includes the preset list page.

[0123] There is a corresponding relationship between the status color and the response status. For example, if the response status is response failure, the status color is red.

[0124] Through the above implementation, the response status can be directly and intuitively displayed on the preset details page, which can assist operation and maintenance users to quickly learn the response status of the preset request.

[0125] In this embodiment, the request log is displayed in different forms to meet different viewing requirements.

[0126] In at least one embodiment of the present invention, the method further comprises:

[0127] Converting the display interface into a hidden icon based on a movable view container;

[0128] Obtaining a log display position from the network log display request;

[0129] The screen position of the hidden icon in the electronic device is set based on the log display position.

[0130] The movable view container refers to an icon that can convert the interface into a foldable icon.

[0131] Through the above implementation, when the user does not need to view the network log, the display interface can be converted into a hidden icon, thereby avoiding the display interface from occupying the display screen of the electronic device.

[0132] It can be seen from the above technical solutions that the present invention can encapsulate the preset request of the pending application in combination with the preset function by identifying the pending application, so as to quickly generate the information interception request, which is beneficial to intercept the network log generated by the pending application during operation. By intercepting the request information and the response information, the comprehensiveness of the request log can be improved, and then by displaying the request log, the operation and maintenance user can be assisted to fully view the network log of the preset request. At the same time, by displaying the response status, the recognition of the network log is improved, which is beneficial to assist the operation and maintenance user to quickly locate the network log that needs to be analyzed. In addition, by displaying the request log in the preset list page and the preset details page respectively, it can be adapted to the needs of different users.

[0133] like Figure 2 , which is a functional module diagram of a preferred embodiment of the network log display device of the present invention. The network log display device 11 includes an identification unit 110, an encapsulation unit 111, an operation unit 112, a generation unit 113, a display unit 114, a conversion unit 115, an acquisition unit 116 and a setting unit 117. The module / unit referred to in the present invention refers to a series of computer-readable instruction segments that can be acquired by the processor 13 and can complete fixed functions, which are stored in the memory 12. In this embodiment, the functions of each module / unit will be described in detail in subsequent embodiments.

[0134] The network log display method may be stored in the electronic device in the form of a plug-in.

[0135] The identification unit 110 receives a web log display request and identifies an application to be processed according to the web log display request.

[0136] In at least one embodiment of the present invention, the network log display request may be triggered by an operation and maintenance user. The network log display request carries a communication object identifier, and the communication object identifier is used to indicate the application to be processed.

[0137] The application program to be processed may be any application software, and the present invention does not limit the application program to be processed.

[0138] In at least one embodiment of the present invention, the identifying unit 110 identifies the application to be processed according to the network log display request, including:

[0139] Parsing the message of the network log display request to obtain data information carried in the message;

[0140] Extracting a communication object identifier from the data information;

[0141] An application corresponding to the communication object identifier is determined as the application to be processed.

[0142] By parsing the message, the parsing efficiency of the data information can be improved, and then by obtaining the communication object identifier from the data information, the extraction efficiency of the communication object identifier can be further improved because the data information does not contain interference from redundant information such as a message header.

[0143] The encapsulation unit 111 encapsulates the preset request of the application to be processed based on a preset function to obtain an information interception request.

[0144] In at least one embodiment of the present invention, the preset function refers to a constructor including an initial callback function.

[0145] The preset request refers to a request for the to-be-processed application to communicate with a preset network, wherein the preset network may be the Internet.

[0146] The information interception request is used to intercept requests and responses.

[0147] In at least one embodiment of the present invention, the encapsulation unit 111 encapsulates the preset request of the application to be processed based on a preset function, and obtaining the information interception request includes:

[0148] Acquire a request for the to-be-processed application to communicate with a preset network as the preset request, and acquire a request identifier of the preset request;

[0149] Acquire a first callback function from a preset callback library based on the first identifier, and acquire a second callback function from the preset callback library based on the second identifier;

[0150] Writing the request identifier into the first callback function to obtain a request callback function, and writing the request identifier into the second callback function to obtain a response callback function;

[0151] Concatenate the request callback function and the response callback function to obtain a target callback function;

[0152] The initial callback function in the preset function is replaced with the target callback function to obtain the information interception request.

[0153] The request identifier is used to indicate the preset request, for example, the request identifier may be wx.request.

[0154] The preset callback library stores a plurality of preset callback functions.

[0155] The first callback function is used to intercept information corresponding to the request basic tag in the request. The request basic tag may include, but is not limited to: http address, request method, request header and parameters, etc.

[0156] The second callback function is used to intercept information corresponding to the response basic tag in the response. The response basic tag may include, but is not limited to: a response header, a return value, etc.

[0157] Through the first callback function and the second callback function, since there is no need to repeatedly construct a callback function, a response callback function can be quickly obtained, thereby improving the generation efficiency of the information interception request.

[0158] The running unit 112 runs the information interception request in real time to obtain request information corresponding to the preset request and response information corresponding to the preset request.

[0159] In at least one embodiment of the present invention, the request information refers to information corresponding to the request basic tag in the preset request, and the response information refers to information corresponding to the response basic tag in a feedback response corresponding to the preset request.

[0160] In at least one embodiment of the present invention, the running unit 112 runs the information interception request in real time, and obtains the request information corresponding to the preset request and the response information corresponding to the preset request, including:

[0161] Monitoring in real time whether the application to be processed sends the preset request to the preset network;

[0162] When it is monitored that the application to be processed successfully sends the preset request to the preset network, the request information is obtained from the preset request based on the request basic tag in the information interception request, and the time when the preset request is successfully sent is obtained as the target time;

[0163] Monitoring, based on the target time, whether the application to be processed receives a feedback response sent by the preset network;

[0164] When it is monitored that the application to be processed successfully receives the feedback response sent by the preset network, the response information is obtained from the feedback response based on the response basic tag in the information interception request.

[0165] By monitoring the preset request in real time, omissions in monitoring the preset request can be avoided, thereby improving the comprehensiveness of obtaining the request information; and by monitoring the feedback response at the target time, invalid monitoring of the feedback response can be avoided, thereby improving the accuracy of the response information.

[0166] The generating unit 113 generates a request log according to the request information and the response information, wherein the request log includes a uniform resource locator and a request method of the preset request.

[0167] It should be emphasized that in order to further ensure the privacy and security of the above request log, the above request log can also be stored in a blockchain node.

[0168] In at least one embodiment of the present invention, the uniform resource locator refers to a specific location where the response information is obtained from the Internet, and the uniform resource locator may be address information.

[0169] The request method includes a post method and a get method.

[0170] In at least one embodiment of the present invention, the generating unit 113 concatenates the request information and the response information to obtain the request log.

[0171] The identification unit 110 identifies a response status of the preset request according to the response information.

[0172] In at least one embodiment of the present invention, the response status includes response failure and response success.

[0173] In at least one embodiment of the present invention, the identifying unit 110 identifies the response status of the preset request according to the response information, including:

[0174] Encoding the response information to obtain a response vector;

[0175] Get the phrase vector of the preset phrase;

[0176] Calculating the vector similarity between the response vector and the phrase vector;

[0177] If the vector similarity is greater than a first preset threshold, determining the response status as a response failure; or

[0178] If the vector similarity is less than a second preset threshold, the response status is determined as a successful response, and the first preset threshold is greater than the second preset threshold.

[0179] The response vector refers to a vector generated after the response information is encoded by a preset encoding mapping table.

[0180] The preset phrases include words displayed when a response fails. For example, the preset phrases may include error, etc.

[0181] The first preset threshold and the second preset threshold can be set according to actual needs. For example, the first preset threshold can be 95%, and the second preset threshold can be 20%.

[0182] By comparing the response vector with the phrase vector of the preset phrase, since the vocabulary corresponding to the response failure is relatively stable, the recognition accuracy of the response state can be improved. By introducing the first preset threshold and the second preset threshold, the accuracy of the response state can be further improved.

[0183] The display unit 114 displays the uniform resource locator and the request method based on a preset list page, and displays the request log based on a preset detail page and the response status.

[0184] In at least one embodiment of the present invention, the preset list page and the preset details page are pages in the display interface, respectively.

[0185] In at least one embodiment of the present invention, the display unit 114 displays the uniform resource locator and the request method based on the preset list page, including:

[0186] Generate a target list according to the uniform resource locator and the request method;

[0187] The target list is displayed on the preset list page.

[0188] In at least one embodiment of the present invention, the display unit 114 displays the request log based on the preset detail page and the response status, including:

[0189] Acquire a display interface of the electronic device, wherein the display interface includes the preset details page;

[0190] Obtaining a state color corresponding to the response state;

[0191] The request log is displayed on the preset detail page based on the status color.

[0192] Wherein, the display interface also includes the preset list page.

[0193] There is a corresponding relationship between the status color and the response status. For example, if the response status is response failure, the status color is red.

[0194] Through the above implementation, the response status can be directly and intuitively displayed on the preset details page, which can assist operation and maintenance users to quickly learn the response status of the preset request.

[0195] In this embodiment, the request log is displayed in different forms to meet different viewing requirements.

[0196] In at least one embodiment of the present invention, the conversion unit 115 converts the display interface into a hidden icon based on the movable view container;

[0197] The acquiring unit 116 acquires the log display position from the network log display request;

[0198] The setting unit 117 sets the screen position of the hidden icon in the electronic device based on the log display position.

[0199] The movable view container refers to an icon that can convert the interface into a foldable icon.

[0200] Through the above implementation, when the user does not need to view the network log, the display interface can be converted into a hidden icon, thereby avoiding the display interface from occupying the display screen of the electronic device.

[0201] It can be seen from the above technical solutions that the present invention can encapsulate the preset request of the pending application in combination with the preset function by identifying the pending application, so as to quickly generate the information interception request, which is beneficial to intercept the network log generated by the pending application during operation. By intercepting the request information and the response information, the comprehensiveness of the request log can be improved, and then by displaying the request log, the operation and maintenance user can be assisted to fully view the network log of the preset request. At the same time, by displaying the response status, the recognition of the network log is improved, which is beneficial to assist the operation and maintenance user to quickly locate the network log that needs to be analyzed. In addition, by displaying the request log in the preset list page and the preset details page respectively, it can be adapted to the needs of different users.

[0202] like Figure 3 , which is a schematic diagram of the structure of an electronic device of a preferred embodiment of the network log display method of the present invention.

[0203] In one embodiment of the present invention, the electronic device 1 includes, but is not limited to, a memory 12, a processor 13, and computer-readable instructions stored in the memory 12 and executable on the processor 13, such as a network log display program.

[0204] Those skilled in the art will understand that the schematic diagram is merely an example of the electronic device 1 and does not constitute a limitation on the electronic device 1. The electronic device 1 may include more or fewer components than shown in the diagram, or a combination of certain components, or different components. For example, the electronic device 1 may also include input and output devices, network access devices, buses, etc.

[0205] The processor 13 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor 13 is the computing core and control center of the electronic device 1, and uses various interfaces and lines to connect various parts of the entire electronic device 1, and executes the operating system of the electronic device 1 and various installed applications, program codes, etc.

[0206] Exemplarily, the computer-readable instructions may be divided into one or more modules / units, which are stored in the memory 12 and executed by the processor 13 to complete the present invention. The one or more modules / units may be a series of computer-readable instruction segments capable of completing specific functions, which are used to describe the execution process of the computer-readable instructions in the electronic device 1. For example, the computer-readable instructions may be divided into an identification unit 110, a packaging unit 111, an operation unit 112, a generation unit 113, a display unit 114, a conversion unit 115, an acquisition unit 116, and a setting unit 117.

[0207] The memory 12 can be used to store the computer-readable instructions and / or modules, and the processor 13 implements various functions of the electronic device 1 by running or executing the computer-readable instructions and / or modules stored in the memory 12, and calling the data stored in the memory 12. The memory 12 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the electronic device, etc. The memory 12 can include non-volatile and volatile memories, such as: a hard disk, a memory, a plug-in hard disk, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other storage devices.

[0208] The memory 12 may be an external memory and / or an internal memory of the electronic device 1. Furthermore, the memory 12 may be a memory in a physical form, such as a memory stick, a TF card (Trans-flash Card), and the like.

[0209] If the module / unit integrated in the electronic device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also instruct the relevant hardware to complete it through computer-readable instructions. The computer-readable instructions can be stored in a computer-readable storage medium. When the computer-readable instructions are executed by the processor, the steps of the above-mentioned various method embodiments can be implemented.

[0210] The computer-readable instructions include computer-readable instruction codes, which may be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer-readable instruction code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM).

[0211] The blockchain referred to in the present invention is a new application mode of computer technologies such as distributed network log display, point-to-point transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the blockchain underlying platform, platform product service layer, and application service layer.

[0212] Combination Figure 1 The memory 12 in the electronic device 1 stores computer-readable instructions to implement a network log display method, and the processor 13 can execute the computer-readable instructions to implement:

[0213] receiving a network log display request, and identifying a pending application according to the network log display request;

[0214] Encapsulating the preset request of the application to be processed based on the preset function to obtain an information interception request;

[0215] Running the information interception request in real time to obtain request information corresponding to the preset request and response information corresponding to the preset request;

[0216] Generate a request log according to the request information and the response information, wherein the request log includes a uniform resource locator and a request method of the preset request;

[0217] Identifying a response status of the preset request according to the response information;

[0218] The uniform resource locator and the request method are displayed based on a preset list page, and the request log is displayed based on a preset detail page and the response status.

[0219] Specifically, the specific implementation method of the processor 13 for the above-mentioned computer readable instructions can refer to Figure 1 The description of the relevant steps in the corresponding embodiments will not be repeated here.

[0220] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.

[0221] The computer-readable storage medium stores computer-readable instructions, wherein the computer-readable instructions are used to implement the following steps when executed by the processor 13:

[0222] receiving a network log display request, and identifying a pending application according to the network log display request;

[0223] Encapsulating the preset request of the application to be processed based on the preset function to obtain an information interception request;

[0224] Running the information interception request in real time to obtain request information corresponding to the preset request and response information corresponding to the preset request;

[0225] Generate a request log according to the request information and the response information, wherein the request log includes a uniform resource locator and a request method of the preset request;

[0226] Identifying a response status of the preset request according to the response information;

[0227] The uniform resource locator and the request method are displayed based on a preset list page, and the request log is displayed based on a preset detail page and the response status.

[0228] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0229] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.

[0230] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any attached figure mark in the claims should not be regarded as limiting the claims involved.

[0231] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. The multiple units or devices mentioned can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.

[0232] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.

Claims

1. A network log display method, applied to an electronic device, characterized in that: The network log display method comprises: receiving a network log display request, and identifying a pending application according to the network log display request; Encapsulating the preset request of the application to be processed based on the preset function to obtain an information interception request, including: obtaining a request for the application to be processed to communicate with the preset network as the preset request, and obtaining a request identifier of the preset request; obtaining a first callback function from a preset callback library based on a first identifier, and obtaining a second callback function from the preset callback library based on a second identifier; writing the request identifier into the first callback function to obtain a request callback function, and writing the request identifier into the second callback function to obtain a response callback function; splicing the request callback function and the response callback function to obtain a target callback function; replacing the initial callback function in the preset function with the target callback function to obtain the information interception request; The information interception request is run in real time to obtain request information corresponding to the preset request and response information corresponding to the preset request, including: monitoring in real time whether the application to be processed sends the preset request to the preset network; when it is monitored that the application to be processed successfully sends the preset request to the preset network, obtaining the request information from the preset request based on the request basic tag in the information interception request, and obtaining the time when the preset request is successfully sent as the target time; monitoring whether the application to be processed receives a feedback response sent by the preset network based on the target time; when it is monitored that the application to be processed successfully receives the feedback response sent by the preset network, obtaining the response information from the feedback response based on the response basic tag in the information interception request; Generate a request log according to the request information and the response information, wherein the request log includes a uniform resource locator and a request method of the preset request; Identifying a response status of the preset request according to the response information; The uniform resource locator and the request method are displayed based on a preset list page, and the request log is displayed based on a preset detail page and the response status.

2. The web log display method according to claim 1, characterized in that: The identifying the application to be processed according to the network log display request comprises: Parsing the message of the network log display request to obtain data information carried in the message; Extracting a communication object identifier from the data information; An application corresponding to the communication object identifier is determined as the application to be processed.

3. The web log display method according to claim 1, characterized in that: The step of identifying the response status of the preset request according to the response information includes: Encoding the response information to obtain a response vector; Get the phrase vector of the preset phrase; Calculating the vector similarity between the response vector and the phrase vector; If the vector similarity is greater than a first preset threshold, determining the response status as a response failure; or If the vector similarity is less than a second preset threshold, the response status is determined as a successful response, and the first preset threshold is greater than the second preset threshold.

4. The web log display method according to claim 1, characterized in that: The displaying of the request log based on the preset details page and the response status includes: Acquire a display interface of the electronic device, wherein the display interface includes the preset details page; Obtaining a state color corresponding to the response state; The request log is displayed on the preset detail page based on the status color.

5. The web log display method according to claim 4, characterized in that: The method further comprises: Converting the display interface into a hidden icon based on a movable view container; Obtaining a log display position from the network log display request; The screen position of the hidden icon in the electronic device is set based on the log display position.

6. A network log display device, running on an electronic device, characterized in that: The network log display device comprises: an identification unit, configured to receive a network log display request and identify an application to be processed according to the network log display request; The encapsulation unit is used to encapsulate the preset request of the to-be-processed application based on a preset function to obtain an information interception request, including: obtaining a request for the to-be-processed application to communicate with a preset network as the preset request, and obtaining a request identifier of the preset request; obtaining a first callback function from a preset callback library based on a first identifier, and obtaining a second callback function from the preset callback library based on a second identifier; writing the request identifier into the first callback function to obtain a request callback function, and writing the request identifier into the second callback function to obtain a response callback function; splicing the request callback function and the response callback function to obtain a target callback function; replacing the initial callback function in the preset function with the target callback function to obtain the information interception request; The running unit is used to run the information interception request in real time to obtain request information corresponding to the preset request and response information corresponding to the preset request, including: monitoring in real time whether the application to be processed sends the preset request to the preset network; when it is monitored that the application to be processed successfully sends the preset request to the preset network, obtaining the request information from the preset request based on the request basic tag in the information interception request, and obtaining the time when the preset request is successfully sent as the target time; based on the target time, monitoring whether the application to be processed receives a feedback response sent by the preset network; when it is monitored that the application to be processed successfully receives the feedback response sent by the preset network, obtaining the response information from the feedback response based on the response basic tag in the information interception request; A generating unit, configured to generate a request log according to the request information and the response information, wherein the request log includes a uniform resource locator and a request method of the preset request; The identification unit is further configured to identify a response status of the preset request according to the response information; A display unit is used to display the uniform resource locator and the request method based on a preset list page, and to display the request log based on a preset detail page and the response status.

7. An electronic device, characterized in that: The electronic device comprises: a memory storing computer-readable instructions; and A processor executes computer-readable instructions stored in the memory to implement the network log display method according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and the computer-readable instructions are executed by a processor in an electronic device to implement the network log display method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Log information display method and system

    CN110008095A

  • Log display method and device

    CN110297623A