Processing delay evaluation method, device, medium and electronic device

By obtaining the file paths and target keywords to be monitored in multi-microservice applications, and using scripts to automatically find and trigger network requests, the accuracy of event linkage delay evaluation among multi-microservices is solved, and low-cost and efficient delay evaluation and wide adaptation are achieved.

CN114139091BActive Publication Date: 2025-08-15CHINA PING AN LIFE INSURANCE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111448421.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-30
Publication Date
2025-08-15
Estimated Expiration
2041-11-30

AI Technical Summary

Technical Problem

The prior art cannot accurately evaluate the processing delay of event linkage between multiple microservices, resulting in large errors in delay statistical results and actual situations, and related technical solutions require additional development work and security risks.

Method used

By obtaining the path and target keywords of the files to be monitored, using scripts to automatically find matching results and trigger network requests, delay evaluation of event linkage in multi-microservice applications is achieved, secondary development is avoided, cost is reduced and efficiency is improved.

Benefits of technology

It realizes efficient and accurate evaluation of event linkage processing delays between multiple microservices, with a wide range of adaptation and strong versatility, reducing development costs and security risks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114139091B_ABST
    Figure CN114139091B_ABST
Patent Text Reader

Abstract

The present disclosure relates to the fields of artificial intelligence and microservices, and discloses a method, device, medium and electronic device for evaluating processing delays in multi-microservice applications. The method includes: obtaining the path of a file to be monitored and a target keyword to be monitored, wherein the content of the file to be monitored is generated by the first microservice in the application of the multi-microservice architecture when a first event is triggered; accessing the file to be monitored according to the path, and searching the file to be monitored based on the target keyword to obtain a matching result; if the matching result is a match, triggering a specified network request so that the monitoring client can monitor the specified network request, and evaluating the processing delay of the microservice in the application according to the monitoring time, wherein the specified network request is the second event triggered by the second microservice in the application. This method does not require secondary development, has low cost and high efficiency, can more accurately evaluate the processing delay of event linkage in multiple microservices, has a wide range of adaptability for monitoring objects, and is highly versatile.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the fields of artificial intelligence and microservice technologies, and in particular to a method, device, medium, and electronic device for evaluating processing delay in multi-microservice applications. Background Art

[0002] In the background logic processing delay evaluation scenario, event linkage between multiple microservices is often involved. However, the generation of some events is not reflected in the HTTP request and response, and cannot be monitored by the client. As a result, the next level of events cannot be triggered in time. As a result, the delay statistics need to filter out this part of the reaction time, resulting in a large error between the delay statistics results and the actual situation.

[0003] Related technical solutions require encapsulating event processing into HTTP interfaces for client calls, triggering events by monitoring responses. However, this encapsulation requires additional development work, and exposing these interfaces to the outside world may also pose security risks. Summary of the Invention

[0004] In the field of artificial intelligence and microservice technology, in order to solve the technical problem of being unable to accurately evaluate the processing delay of event linkage between multiple microservices, the purpose of the present disclosure is to provide a method, device, medium and electronic device for evaluating processing delay in multi-microservice applications.

[0005] According to one aspect of the present disclosure, a method for evaluating processing delay in a multi-microservice application is provided, the method comprising:

[0006] Obtaining a path of a file to be monitored and target keywords to be monitored, where the content of the file to be monitored is generated by a first microservice in an application of a multi-microservice architecture when a first event is triggered;

[0007] Accessing the file to be monitored according to the path, and performing a search operation on the content of the file to be monitored based on the target keyword to obtain a matching result between the file to be monitored and the target keyword;

[0008] If the matching result is a match, a specified network request is triggered so that the monitoring client can monitor the specified network request and evaluate the processing delay of the microservice in the application based on the monitoring time, wherein the specified network request is a second event triggered by the second microservice in the application.

[0009] According to another aspect of the present disclosure, a device for evaluating processing delay in a multi-microservice application is provided, the device comprising:

[0010] an acquisition module configured to acquire a path of a file to be monitored and target keywords to be monitored, wherein the content of the file to be monitored is generated by a first microservice in an application of a multi-microservice architecture when a first event is triggered;

[0011] a search module configured to access the file to be monitored according to the path, and perform a search operation on the content of the file to be monitored based on the target keyword to obtain a matching result between the file to be monitored and the target keyword;

[0012] The trigger module is configured to trigger a specified network request if the matching result is a match, so that the monitoring client can monitor the specified network request and evaluate the processing delay of the microservice in the application based on the monitoring time, wherein the specified network request is a second event triggered by the second microservice in the application.

[0013] According to another aspect of the present disclosure, a computer-readable program medium is provided, which stores computer program instructions. When the computer program instructions are executed by a computer, the computer is caused to perform the above-mentioned method.

[0014] According to another aspect of the present disclosure, an electronic device is provided, comprising:

[0015] processor;

[0016] A memory having computer-readable instructions stored thereon, wherein the computer-readable instructions, when executed by the processor, implement the method described above.

[0017] The technical solutions provided by the embodiments of the present disclosure may have the following beneficial effects:

[0018] The present disclosure provides a method, apparatus, medium, and electronic device for evaluating processing delay in a multi-microservice application. The method includes the following steps: obtaining a path of a file to be monitored and a target keyword to be monitored, wherein the content of the file to be monitored is generated by a first microservice in an application of a multi-microservice architecture when a first event is triggered; accessing the file to be monitored according to the path, and performing a search operation on the content of the file to be monitored based on the target keyword to obtain a matching result between the file to be monitored and the target keyword; if the matching result is a match, triggering a specified network request so that a monitoring client can monitor the specified network request, and evaluating the processing delay of the microservice in the application based on the monitoring time, wherein the specified network request is a second event triggered by a second microservice in the application.

[0019] Under this method, since the entire solution can be implemented through scripts, there is no need for secondary development, which is low-cost and highly efficient. The monitoring script can automatically perform keyword retrieval on the monitored file and trigger a specified network request based on the retrieval results. This triggers the corresponding next-level event, so that the processing delay at this stage can be monitored by the monitoring client, thereby enabling a more accurate assessment of the processing delay of event linkage in multiple microservices. In addition, monitoring can be achieved as long as the microservice generates a text file. Therefore, as long as it is a readable text file, it can be monitored. The monitoring object has a wide range of adaptability and strong versatility.

[0020] It should be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0022] Figure 1 1 is a schematic diagram of a system architecture of a method for evaluating processing delay in a multi-microservice application according to an exemplary embodiment;

[0023] Figure 2 This is a flowchart of a method for evaluating processing delay in a multi-microservice application according to an exemplary embodiment;

[0024] Figure 3 is based on Figure 2 The embodiment is a flowchart showing details of step 220 of an embodiment;

[0025] Figure 4 is based on Figure 2 The embodiment is a flowchart showing details of step 220 and step 230 of an embodiment;

[0026] Figure 5 is a block diagram of a device for evaluating processing delay in a multi-microservice application according to an exemplary embodiment;

[0027] Figure 6 is an example block diagram of an electronic device for implementing the above-mentioned method for evaluating processing delay in a multi-microservice application according to an exemplary embodiment;

[0028] Figure 7 The present invention is a program product according to an exemplary embodiment for implementing a method for evaluating processing delay in the multi-microservice application. DETAILED DESCRIPTION

[0029] Exemplary embodiments will be described in detail herein, examples of which are illustrated in the accompanying drawings. In the following description, when referring to the drawings, like numbers in different figures represent like or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all possible embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present invention, as detailed in the appended claims.

[0030] In addition, the accompanying drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. Identical reference numerals in the drawings represent identical or similar parts, and thus repeated descriptions thereof will be omitted. Some of the blocks shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically separate entities.

[0031] As described in the background technology section, the delay statistics results of event linkage between multiple microservices in the relevant technologies currently have large errors compared to the actual situation. The relevant technologies have the problem of poor accuracy of delay statistics. In addition, the relevant technologies implement delay statistics through interface encapsulation and calling, which requires additional development work. Therefore, there are also defects such as high cost, low efficiency and poor security risks.

[0032] To this end, the present disclosure first provides a method for evaluating processing delay in multi-microservice applications. This method can overcome the above-mentioned drawbacks and thus achieve efficient, accurate, and low-cost evaluation of processing delay in multi-microservice applications.

[0033] The implementation terminal of the present disclosure can be any device with computing, processing and communication functions, which can be connected to an external device for receiving or sending data. Specifically, it can be a portable mobile device, such as a smart phone, tablet computer, laptop computer, PDA (Personal Digital Assistant), etc., or it can be a fixed device, such as computer equipment, field terminal, desktop computer, server, workstation, etc. It can also be a collection of multiple devices, such as the physical infrastructure of cloud computing or a server cluster.

[0034] Optionally, the implementation terminal of the present disclosure may be a server or a physical infrastructure of cloud computing.

[0035] Figure 1 FIG. 1 is a schematic diagram of a system architecture of a method for evaluating processing delay in a multi-microservice application according to an exemplary embodiment. Figure 1As shown, the system architecture includes a personal computer 110 and a server 120 that establishes a communication connection with the personal computer 110 through a network. A container 121 is deployed on the server 120, and an application with three microservices is deployed in the container 121. The server 120 is also provided with a script 122 and a monitoring client 123. When the evaluation method for processing delay in a multi-microservice application provided by the present disclosure is applied to Figure 1 In the system architecture shown, the specific process can be as follows: first, the first microservice in the container 121 triggers a first event, which is reflected by the issued network request or the received network response. At this time, the monitoring client 123 can perform a delay evaluation. After the first event is triggered, a file to be monitored is generated and output to the directory of the container 121; then, the file path of the file to be monitored and the target keyword to be monitored are added to the script 122; then, the script 122 can perform a search operation on the file to be monitored to determine the matching result between the file to be monitored and the target keyword; next, the script 122 can also trigger a corresponding network request based on the obtained matching result, thereby triggering a second event in the second microservice in the container 121. At this time, the monitoring client 123 can monitor the network request, so as to evaluate the delay in the linkage between the first event of the first microservice and the second event of the second microservice.

[0036] In one embodiment of the present disclosure, the script 122 and the file to be monitored are deployed in the same container directory.

[0037] It is worth mentioning that Figure 1 This is only one embodiment of the present disclosure. Figure 1 The implementation terminal in the embodiment is a server, but in other embodiments of the present disclosure, the implementation terminal can also be various terminal devices as described above; Figure 1 In the embodiment, all microservices of the application are deployed on the same server and in the same container. However, in other embodiments of the present disclosure, multiple microservices in the application can be deployed in different containers or even on different terminal devices. Figure 1 In the illustrated embodiment, the monitoring client only monitors the delay between two events triggered by two microservices. However, it is easy to understand that monitoring two events can be just one step in the monitoring client's delay evaluation of inter-microservice event linkage. In other words, the monitoring client can also evaluate the delay between events triggered by more microservices. This is not limited in any way by this disclosure, and the scope of protection of this disclosure should not be limited by this.

[0038] Figure 2This is a flowchart of a method for evaluating processing delay in a multi-microservice application according to an exemplary embodiment. Logically, the method for evaluating processing delay in a multi-microservice application provided by this embodiment can be executed by a script; physically, the method can be executed by a server, such as Figure 2 As shown, the following steps are included:

[0039] Step 210 , obtaining a path of a file to be monitored and target keywords to be monitored, wherein the content of the file to be monitored is generated by the first microservice in the application of the multi-microservice architecture when a first event is triggered.

[0040] An application uses a multi-microservice architecture, consisting of multiple microservices. Each microservice is small, focusing on a specific business function or requirement. This results in clear business logic and minimal code. Microservices can be independently developed and maintained by small teams, improving code readability. Microservices communicate with each other using lightweight mechanisms (typically RESTful APIs based on HTTP).

[0041] The first event triggered by the first microservice may be an event of an unsuccessful network request or response. Whenever the first microservice triggers the first event, a file to be monitored can be automatically generated. The target keyword may be a keyword set according to actual business needs.

[0042] The path of the file to be monitored may be an absolute path. The type of the file to be monitored may be various, such as various text files that can be read.

[0043] In one embodiment of the present disclosure, the file to be monitored is a log file.

[0044] In one embodiment of the present disclosure, the method is executed by a script, and the script is located in the container directory where the file to be monitored is located.

[0045] Specifically, the first microservice is deployed in a container. When generating a file to be monitored, the first microservice outputs the file to be monitored to the container directory and also sets the script in the container directory.

[0046] In the embodiment of the present disclosure, by placing the script in the container directory where the file to be monitored is located, it is possible to facilitate analysis of the file to be monitored.

[0047] The first microservice and the file to be monitored can both be located in one container, which facilitates the deployment and modification of the first microservice.

[0048] Step 220 : Access the file to be monitored according to the path, and perform a search operation on the content of the file to be monitored based on the target keyword to obtain a matching result between the file to be monitored and the target keyword.

[0049] The file to be monitored can be found according to the path, so that the file to be monitored can be analyzed.

[0050] As mentioned above, the file to be monitored can be a text file, and thus the content of the file to be monitored can include multiple words. The matching between the words in the file to be monitored and the target keywords can be determined by searching the content of the file to be monitored, thereby obtaining the corresponding matching results.

[0051] Figure 3 is based on Figure 2 FIG. 2 is a flow chart showing details of step 220 of an embodiment. Figure 3 As shown, step 220 may include the following steps:

[0052] Step 220 ′: traverse and search the contents of the file to be monitored starting from the first character that has not been searched in the file to be monitored each time, until the traversal of the file to be monitored is completed or a keyword matching the target keyword is found.

[0053] Specifically, the initial point of the file to be monitored is set to line 0. In the while 1 loop, the seek() function provided by Python can be used to locate the initial position point = α. The keyword is searched by traversing the file to be monitored. If it matches, it jumps out. The tell() function provided by Python is used to obtain the jump position β, set point = β, and the seek() function is used to locate β and start traversing in the next loop until the file traversal is completed.

[0054] Enter sleep mode and wait for the monitored files to be refreshed. By setting the cycle interval δ, you can balance the scanning accuracy and performance consumption.

[0055] In one embodiment of the present disclosure, accessing the file to be monitored according to the path and performing a search operation on the content of the file to be monitored based on the target keyword to obtain a matching result between the file to be monitored and the target keyword includes: accessing the file to be monitored according to the path to monitor whether the file to be monitored is updated; whenever an update to the file to be monitored is monitored, performing a search operation on the file to be monitored to obtain a matching result between the file to be monitored and the target keyword.

[0056] Specifically, whenever the first microservice triggers the first event, the file to be monitored will be updated, and a part of content will be added to the file to be monitored. This part of the newly added content can be the log generated when the first microservice triggers the first event this time.

[0057] Whether the monitored file is updated can be monitored by monitoring whether the file size of the monitored file changes, or monitoring whether the modification date of the monitored file changes.

[0058] In this embodiment, by monitoring whether the monitored file is updated and performing a search operation on the monitored file once an update occurs, the corresponding matching results can be found more quickly, and the processing delay of the event linkage between microservices can be evaluated more timely.

[0059] In one embodiment of the present disclosure, accessing the file to be monitored according to the path and performing a search operation on the content of the file to be monitored based on the target keyword to obtain a matching result between the file to be monitored and the target keyword includes: monitoring whether the file to be monitored has been updated at predetermined time intervals; and performing a search operation on the file to be monitored based on monitoring that the file to be monitored has been updated to obtain a matching result between the file to be monitored and the target keyword.

[0060] The predetermined time period can be set arbitrarily based on experience, for example, it can be set to one day, one week, etc.

[0061] In this embodiment, by monitoring the monitored file according to a set time interval and performing a search operation on the monitored file after monitoring that the monitored file has been updated, both the performance of delay evaluation and the cost of computing resources are taken into account.

[0062] In one embodiment of the present disclosure, the predetermined time period is determined as follows: obtaining the average value of the time intervals between all adjacent update times of the file to be monitored in history as a first average value; obtaining the average value of the time intervals between all adjacent update times of the file to be monitored in a specified time interval before the current time as a second average value; and determining the predetermined time period based on the first average value and the second average value.

[0063] The specified time interval is the time interval that ends at the current time.

[0064] Specifically, an average of the first average value and the second average value may be calculated and used as the predetermined time period.

[0065] In one embodiment of the present disclosure, determining the predetermined time period based on the first average value and the second average value includes: determining a weighted sum of the first average value and the second average value as the predetermined time period, wherein the weight of the second average value is greater than the weight of the first average value.

[0066] In this embodiment, the weighted sum of the first average value and the second average value is used as the predetermined time period, which fully reflects the effects of the first average value and the second average value in the determined predetermined time period. Moreover, since the weight of the second average value is greater than the weight of the first average value, the update time interval of the file to be monitored in the recent period plays a greater role in calculating the predetermined time period. Since the actual update time interval of the file to be monitored is more likely to be related to the recent update time interval, the predetermined time period can be determined more accurately.

[0067] Step 230: If the matching result is a match, a specified network request is triggered so that the monitoring client can monitor the specified network request and evaluate the processing delay of the microservice in the application based on the monitoring time, wherein the specified network request is a second event triggered by the second microservice in the application.

[0068] The specified network request may be, for example, an HTTP (Hypertext Transfer Protocol) request, which is a second event triggered in the second microservice. The second event may be, for example, an event reported to a log based on the network request. The second microservice and the first microservice are both applications in the multi-microservice architecture.

[0069] The monitoring client is a pre-set monitoring program that can calculate the processing time between events at all levels by monitoring network requests. For example, it can determine the processing delay based on the time difference between the first and second monitored events, thereby enabling delay evaluation of event linkage between multiple microservices.

[0070] The specific action executed by the triggered second event can be written into logic according to actual business needs.

[0071] In one embodiment of the present disclosure, performing a search operation on the content of the to-be-monitored file based on the target keyword to obtain a matching result between the to-be-monitored file and the target keyword includes:

[0072] Performing a search operation on the content of the file to be monitored based on the target keyword to determine whether a keyword consistent with the target keyword is found;

[0073] If the matching result is a match, triggering a specified network request includes:

[0074] If a keyword that matches the target keyword is found, the specified network request is triggered.

[0075] Specifically, the content of the file to be monitored may be divided into words, and keywords may be extracted from the divided words; and then it may be determined one by one whether each keyword is consistent with the target keyword.

[0076] When the content of the file to be monitored contains keywords that are consistent with the target keywords, it means that the file to be monitored is generated according to the expected event triggered by the first microservice. Therefore, by triggering a specified network request when a keyword that is consistent with the target keyword is found, the corresponding event can be monitored, and then the processing delay of the event linkage can be evaluated.

[0077] Figure 4 is based on Figure 2 Detailed flowchart of step 220 and step 230 of an embodiment is shown in FIG. Figure 4 As shown, step 220 and step 230 may specifically include the following steps:

[0078] Step 220: Search the contents of the file to be monitored based on the target keyword to determine whether a keyword associated with the target keyword is found.

[0079] Keywords associated with the target keyword are different from the target keyword but have a correlation with it. For example, the words directory and path have similarities, so there is a correlation between them.

[0080] In one embodiment of the present disclosure, a search operation is performed on the content of the file to be monitored based on the target keyword to determine whether a keyword associated with the target keyword is found, including: inputting the content of the file to be monitored and the target keyword into a preset text analysis model to obtain an association score between each keyword in the content of the file to be monitored and the target keyword output by the preset text analysis model; determining whether there is a word with an association score greater than a predetermined association score threshold; if there is a word with an association score greater than the predetermined association score threshold, determining that the keyword associated with the target keyword is found; otherwise, determining that the keyword associated with the target keyword is not found.

[0081] The preset text analysis model can be various models that can be used to calculate the association scores between different words, and can be constructed based on various algorithms such as machine learning and deep learning.

[0082] In this embodiment, by using a preset text analysis model to determine the association scores between words, keywords associated with the target keyword can be found more accurately.

[0083] Step 230: If a keyword associated with the target keyword is found, the designated network request is triggered.

[0084] In the embodiment of the present disclosure, by triggering a specified network request when a keyword associated with a target keyword exists in the file to be monitored, the scope of monitoring is expanded, thereby improving the universality of the solution of the embodiment of the present disclosure.

[0085] In one embodiment of the present disclosure, the search operation is performed on the content of the file to be monitored based on the target keyword to determine whether a keyword associated with the target keyword is found, including: using the target keyword to query in a preset dictionary to obtain an associated word corresponding to the target keyword; and determining whether a keyword associated with the target keyword is found based on whether the associated word is found in the content of the file to be monitored.

[0086] Specifically, the preset dictionary may include pre-set keywords and corresponding associated words. When an associated word is found in the file to be monitored, it is determined that a keyword associated with the target keyword has been found. That is, the associated word corresponding to the keyword is the keyword associated with the target keyword.

[0087] In the embodiment of the present disclosure, fuzzy matching of keywords is achieved through a preset dictionary, that is, matching can be achieved even when the file to be monitored does not contain the target keyword, which can achieve more accurate monitoring of the text in the file to be monitored.

[0088] In one embodiment of the present disclosure, there are multiple target keywords, and performing a search operation on the content of the to-be-monitored file based on the target keywords to obtain a matching result between the to-be-monitored file and the target keywords includes:

[0089] Performing a search operation on the content of the file to be monitored according to a logical expression containing a plurality of the target keywords to determine whether the logical expression is established;

[0090] If the matching result is a match, triggering a specified network request includes:

[0091] If the logical expression is true, the specified network request is triggered.

[0092] Logical expressions can be regular expressions or other expressions. Logical expressions can be constructed by combining multiple target keywords using logical operators such as AND and OR. Multiple target keywords can be set in a keyword list.

[0093] For example, the logical expression can be (weather OR climate) AND change. Then weather, climate, and change are all target keywords. The logical expression will only be valid when the content of the monitored file contains at least one of the words weather and climate, and also contains the word change.

[0094] In the embodiment of the present disclosure, by allowing matching results to be obtained in the form of a logical expression containing multiple target keywords, more abundant keyword matching conditions can be set, thereby expanding the scope of event monitoring.

[0095] In summary, according to the evaluation method for processing delay in multi-microservice applications provided by the embodiment of the present disclosure, the entire solution can be implemented by means of scripts. It is only necessary to place the script in the container directory where the monitored object is located. Therefore, no secondary development is required, the cost is low, and the efficiency is high. The monitoring script can automatically perform keyword retrieval on the monitored file, and can trigger a specified network request based on the retrieval results, thereby triggering the corresponding next-level event, so that the processing delay at this stage can be monitored by the monitoring client in a timely manner, and the trigger response is fast, thereby being able to more accurately evaluate the processing delay of event linkage in multiple microservices; in addition, monitoring can be achieved as long as the microservice generates a text file. Therefore, as long as it is a readable text file, it can be monitored, and the monitoring object has a wide adaptability and strong versatility.

[0096] The present disclosure also provides a device for evaluating processing delay in a multi-microservice application. The device is provided with a script. The following is an embodiment of the device of the present disclosure.

[0097] Figure 5 FIG. 1 is a block diagram of a device for evaluating processing delay in a multi-microservice application according to an exemplary embodiment. Figure 5 As shown, the apparatus 500 includes:

[0098] An acquisition module 510 is configured to acquire a path of a file to be monitored and target keywords to be monitored, wherein the content of the file to be monitored is generated by a first microservice in an application of a multi-microservice architecture when a first event is triggered;

[0099] A search module 520 is configured to access the file to be monitored according to the path, and perform a search operation on the content of the file to be monitored based on the target keyword to obtain a matching result between the file to be monitored and the target keyword;

[0100] The trigger module 530 is configured to trigger a specified network request if the matching result is a match, so that the monitoring client can monitor the specified network request and evaluate the processing delay of the microservice in the application based on the monitoring time, wherein the specified network request is a second event triggered by the second microservice in the application.

[0101] According to a third aspect of the present disclosure, an electronic device capable of implementing the above method is also provided.

[0102] Those skilled in the art will appreciate that various aspects of the present invention may be implemented as systems, methods, or program products. Therefore, various aspects of the present invention may be implemented in the following forms: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software implementations, which may be collectively referred to herein as "circuits," "modules," or "systems."

[0103] Refer to the following Figure 6 An electronic device 600 according to this embodiment of the present invention will be described. Figure 6 The electronic device 600 shown is merely an example and should not limit the functions and scope of use of the embodiments of the present invention.

[0104] like Figure 6 As shown, electronic device 600 is implemented as a general-purpose computing device. Components of electronic device 600 may include, but are not limited to, the aforementioned at least one processing unit 610, the aforementioned at least one storage unit 620, and a bus 630 connecting different system components (including storage unit 620 and processing unit 610).

[0105] The storage unit stores program codes, which can be executed by the processing unit 610, so that the processing unit 610 performs the steps according to various exemplary embodiments of the present invention described in the above “Example Method” section of this specification.

[0106] The storage unit 620 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 621 and / or a cache memory unit 622 , and may further include a read-only memory unit (ROM) 623 .

[0107] The storage unit 620 may also include a program / utility 624 having a set (at least one) of program modules 625, such program modules 625 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0108] Bus 630 may represent one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0109] The electronic device 600 can also communicate with one or more external devices 800 (e.g., a keyboard, a pointing device, a Bluetooth device, etc.), one or more devices that enable a user to interact with the electronic device 600, and / or any device that enables the electronic device 600 to communicate with one or more other computing devices (e.g., a router, a modem, etc.). Such communication can occur via an input / output (I / O) interface 650, such as with a display unit 640. Furthermore, the electronic device 600 can communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network such as the Internet) via a network adapter 660. As shown, the network adapter 660 communicates with other modules of the electronic device 600 via a bus 630. It should be understood that, although not shown, other hardware and / or software modules can be used in conjunction with the electronic device 600, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0110] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.

[0111] According to a fourth aspect of the present disclosure, a computer-readable storage medium is further provided, storing thereon a program product capable of implementing the aforementioned method of this specification. In some possible implementations, various aspects of the present invention may also be implemented in the form of a program product comprising program code that, when executed on a terminal device, causes the terminal device to execute the steps according to various exemplary embodiments of the present invention described in the "Exemplary Methods" section of this specification.

[0112] refer to Figure 7 , a program product 700 for implementing the above-described method according to an embodiment of the present invention is described. The program product 700 may be a portable compact disc read-only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, a readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0113] The program product may be implemented in any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.

[0114] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium that can transmit, propagate, or transfer a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0115] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0116] The program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, and the like, as well as conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a stand-alone software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0117] Furthermore, the above-described figures are merely illustrative of the processes included in the method according to exemplary embodiments of the present invention and are not intended to be limiting. It is readily understood that the processes illustrated in the above-described figures do not indicate or limit the temporal order of these processes. Furthermore, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.

[0118] It should be understood that the present invention is not limited to the exact construction that has been described above and shown in the drawings, and that various modifications and changes may be made without departing from its scope. The scope of the present invention is limited only by the appended claims.

Claims

1. A method for evaluating processing delay in a multi-microservice application, characterized in that: The method comprises: Obtaining a path to a file to be monitored and target keywords to be monitored, wherein the content of the file to be monitored is generated by a first microservice in an application of a multi-microservice architecture when a first event is triggered, the file to be monitored is generated by the first microservice, and a script for implementing the method is located in a container directory where the file to be monitored is located; Accessing the file to be monitored according to the path at predetermined time intervals to monitor whether the file to be monitored has been updated; the predetermined time interval is determined by: obtaining an average value of time intervals between all adjacent update times of the file to be monitored in history as a first average value; obtaining an average value of time intervals between all adjacent update times of the file to be monitored in a specified time interval before a current time as a second average value; and determining a weighted sum of the first average value and the second average value as the predetermined time interval, wherein the weight of the second average value is greater than the weight of the first average value; According to monitoring that the file to be monitored is updated, a search operation is performed on the content of the file to be monitored based on the target keyword to obtain a matching result between the file to be monitored and the target keyword; If the matching result is a match, a specified network request is triggered so that the monitoring client can monitor the specified network request and evaluate the processing delay of the microservice in the application based on the monitoring time. The specified network request is a second event triggered by a second microservice in the application, and the monitoring client determines the processing delay based on the time difference between the monitored first event and the second event.

2. The method according to claim 1, characterized in that The searching operation on the content of the file to be monitored based on the target keyword to obtain a matching result between the file to be monitored and the target keyword includes: Performing a search operation on the content of the file to be monitored based on the target keyword to determine whether a keyword consistent with the target keyword is found; If the matching result is a match, triggering a specified network request includes: If a keyword that matches the target keyword is found, the specified network request is triggered.

3. The method according to claim 1, characterized in that The searching operation on the content of the file to be monitored based on the target keyword to obtain a matching result between the file to be monitored and the target keyword includes: Performing a search operation on the content of the to-be-monitored file based on the target keyword to determine whether a keyword associated with the target keyword is found; If the matching result is a match, triggering a specified network request includes: If a keyword associated with the target keyword is found, the specified network request is triggered.

4. The method according to claim 1, wherein There are multiple target keywords, and the search operation is performed on the content of the file to be monitored based on the target keywords to obtain a matching result between the file to be monitored and the target keywords, including: Performing a search operation on the content of the file to be monitored according to a logical expression containing a plurality of the target keywords to determine whether the logical expression is established; If the matching result is a match, triggering a specified network request includes: If the logical expression is true, the specified network request is triggered.

5. The method according to claim 1, wherein The searching operation on the content of the file to be monitored based on the target keyword to obtain a matching result between the file to be monitored and the target keyword includes: Each time, the content of the file to be monitored is traversed and searched from the first character that has not been searched in the file to be monitored until the traversal of the file to be monitored is completed or a keyword matching the target keyword is found.

6. A device for evaluating processing delay in a multi-microservice application, characterized in that: The device comprises: an acquisition module configured to obtain a path of a file to be monitored and target keywords to be monitored, wherein the content of the file to be monitored is generated by a first microservice in an application of a multi-microservice architecture when a first event is triggered, the file to be monitored is generated by the first microservice, and a script for implementing the method is located in a container directory where the file to be monitored is located; A search module is configured to access the file to be monitored according to the path at predetermined time intervals to monitor whether the file to be monitored has been updated; the predetermined time interval is determined in the following manner: obtaining an average value of the time intervals between all adjacent update times of the file to be monitored in history as a first average value; obtaining an average value of the time intervals between all adjacent update times of the file to be monitored in a specified time interval before a current time as a second average value; determining a weighted sum of the first average value and the second average value as the predetermined time interval, wherein the weight of the second average value is greater than the weight of the first average value; and upon monitoring that the file to be monitored has been updated, performing a search operation on the content of the file to be monitored based on the target keyword to obtain a matching result between the file to be monitored and the target keyword; The trigger module is configured to trigger a specified network request if the matching result is a match, so that the monitoring client can monitor the specified network request and evaluate the processing delay of the microservice in the application based on the monitoring time, wherein the specified network request is a second event triggered by the second microservice in the application, and the monitoring client determines the processing delay based on the time difference between the monitored first event and the second event.

7. A computer-readable program medium, characterized in that The computer program instructions are stored therein, and when the computer program instructions are executed by a computer, the computer is caused to execute the method according to any one of claims 1 to 5.

8. An electronic device, characterized in that: The electronic device comprises: processor; A memory having computer-readable instructions stored thereon, wherein when the computer-readable instructions are executed by the processor, the method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Message queue monitoring method and device, electronic device and readable storage medium

    CN110187980A