Request processing method and device, electronic equipment and storage medium
By constructing a directed acyclic graph (DAG) between operators to display dependencies and generating a visual structure graph, the problem of high operator optimization difficulty and high management cost in existing technologies is solved, and the system achieves efficient management and maintainability.
Patent Information
- Application Number
- CN202510864463.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-25
- Publication Date
- 2025-10-31
AI Technical Summary
The lack of effective monitoring of dependencies between operators in existing technologies makes operator optimization difficult, system management costs high, and lacks intuitive visualization tools, which affects system maintainability.
By constructing a directed acyclic graph (DAG) to display the dependencies between operators, a visual structure graph is generated, which can count the number of operator accesses and the time consumed, providing intuitive topological relationship analysis and reducing development and management difficulty.
It improves operator management and optimization efficiency, reduces system management costs, enhances system maintainability and monitoring efficiency, and provides an intuitive data foundation.
Smart Images

Figure CN120873241A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and in particular to the fields of computer vision, data processing, etc., specifically to a request processing method, apparatus, electronic device, and storage medium. Background Technology
[0002] An operator is a logical unit in a system service that performs a specific function or calculation. For example, in a recommendation system, operators can be used for user behavior analysis, feature extraction, reasoning, and ranking. They can decouple the system, reduce development costs, and improve flexibility. Operator management is a core aspect of system development, optimization, and operation, and is crucial to ensuring the efficient and reliable operation of the system. Summary of the Invention
[0003] This disclosure aims to at least partially address one of the technical problems in the related art.
[0004] Therefore, the purpose of this disclosure is to propose a request processing method, apparatus, electronic device and storage medium that can intuitively obtain the topological relationship between operators, analyze the operation of each operator, so as to realize the redundancy management of operators, greatly reduce the development cost and difficulty, and help improve the maintainability of the system.
[0005] According to a first aspect of this disclosure, a request processing method is provided, comprising:
[0006] Determine the first identifier information corresponding to the currently received service request;
[0007] If the first identification information matches the preset second identification information, the service request is identified as the target request;
[0008] Based on the multiple first operators invoked during the execution of the target request and the first data corresponding to each first operator, a first structure diagram corresponding to the target request is generated;
[0009] The first identification information is associated with the first structural diagram and stored in the first database.
[0010] According to a second aspect of this disclosure, a request processing apparatus is provided, comprising:
[0011] The first determining module is used to determine the first identification information corresponding to the currently received service request;
[0012] The second determining module is used to determine the service request as a target request when the first identification information matches the preset second identification information;
[0013] The generation module is used to generate a first structure diagram corresponding to the target request based on multiple first operators invoked during the execution of the target request and the first data corresponding to each first operator.
[0014] The storage module is used to associate the first identification information with the first structure diagram and store it in the first database.
[0015] According to a third aspect of this disclosure, an electronic device is provided, comprising:
[0016] At least one processor; and
[0017] A memory communicatively connected to the at least one processor; wherein,
[0018] The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the request processing method as described in the first aspect.
[0019] According to a fourth aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions for causing the computer to perform the request processing method as described in the first aspect.
[0020] According to a fifth aspect of this disclosure, a computer program product is provided, including computer instructions that, when executed by a processor, implement the steps of the request processing method as described in the first aspect.
[0021] The request processing method, apparatus, electronic device, and storage medium provided in this disclosure have the following beneficial effects:
[0022] By sampling requests using identification information, the topological relationships between target request analysis operators can be obtained, and a visual structure diagram can be constructed. This can improve the monitoring efficiency of operator execution while controlling management costs, allowing users to intuitively view the overall picture of request scheduling and providing a reliable data foundation for system management and optimization.
[0023] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0024] The above and / or additional aspects and advantages of this disclosure will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, which are provided for a better understanding of the present invention and are not intended to limit the scope of this disclosure, wherein:
[0025] Figure 1This is a flowchart illustrating a request processing method according to an embodiment of the present disclosure;
[0026] Figure 2 This is a schematic diagram of a structure diagram generation provided in an embodiment of this disclosure;
[0027] Figure 3 This is a flowchart illustrating a request processing method according to another embodiment of the present disclosure;
[0028] Figure 4 This is a flowchart illustrating a request processing method according to another embodiment of the present disclosure;
[0029] Figure 5 This is a schematic diagram of a structural diagram processing procedure provided in an embodiment of this disclosure;
[0030] Figure 6 This is a flowchart illustrating a request processing method according to another embodiment of the present disclosure;
[0031] Figure 7 This is a schematic diagram of a hot-loading process for sampling conditions provided in an embodiment of this disclosure;
[0032] Figure 8 This is a flowchart illustrating a request processing method according to another embodiment of the present disclosure;
[0033] Figure 9 This is a flowchart illustrating a request processing method according to another embodiment of the present disclosure;
[0034] Figure 10 This is a schematic diagram illustrating the operation of data display provided in this public disclosure;
[0035] Figure 11 This is a schematic diagram of the structure of a request processing apparatus according to an embodiment of the present disclosure;
[0036] Figure 12 A block diagram of an exemplary electronic device suitable for implementing embodiments of the present disclosure is shown. Detailed Implementation
[0037] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0038] The embodiments disclosed herein relate to the technical fields of computer vision, data processing, etc.
[0039] Computer vision refers to machine vision that uses cameras and computers to identify, track, and measure targets instead of human eyes, and further processes the images to make them more suitable for human observation or transmission to instruments for detection.
[0040] Data processing encompasses the acquisition, storage, retrieval, processing, transformation, and transmission of data, and is a fundamental component of systems engineering and automatic control. Its basic objective is to extract and derive valuable and meaningful data from large volumes of potentially chaotic and incomprehensible data.
[0041] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0042] Current solutions for monitoring and managing operators typically use reports or trend charts to display information such as the execution time of operators in different request execution processes, the number of successful or failed executions, etc. However, they lack information on the dependencies between operators, making operator optimization quite difficult.
[0043] Therefore, in the request processing method proposed in this disclosure, the dependencies and execution status between operators during the request execution process are visualized by constructing a directed acyclic graph. Furthermore, statistical analysis is performed on the number of times the same operator is accessed and the time consumed in different requests. This allows users to quickly grasp the topological relationships between operators, improves the efficiency of operator management and optimization, reduces costs and difficulties, and enhances the maintainability of the system.
[0044] It should be noted that the request processing method provided in this disclosure can be applied to scenarios where operators are managed and optimized in any business domain system. The following embodiments only use a recommendation system as an example for illustration.
[0045] The request processing method, apparatus, electronic device, and storage medium of this disclosure are described below with reference to the accompanying drawings.
[0046] It should be noted that the execution subject of the request processing method in this embodiment is a request processing device, which can be implemented by software and / or hardware. The device can be configured in an electronic device, which may include, but is not limited to, a terminal, a server, etc.
[0047] Figure 1 This is a flowchart illustrating a request processing method according to an embodiment of the present disclosure.
[0048] like Figure 1 As shown, the request processing method includes:
[0049] S101: Determine the first identification information corresponding to the currently received service request.
[0050] The first identification information is used to determine whether the corresponding request meets the sampling conditions, and may include at least one of the following: a string that uniquely identifies the service request (i.e., the request identity document (ID)), the user ID that sent the service request, etc. During the testing or experimental phase, the first identification information may also include an identifier of the test or experiment to which the service request belongs (i.e., the experiment ID), etc.
[0051] S102: If the first identification information matches the preset second identification information, the service request is determined as the target request.
[0052] The second identification information is a pre-set request sampling condition containing at least one dimension, based on production or experimental needs. The second identification information contains data of the same dimension as the first identification information; that is, the second identification information contains at least one of the following: request ID, user ID, and experiment ID.
[0053] It should be noted that, in the embodiments of this disclosure, the second identification information may be updated at fixed time intervals, so the second identification information used for sampling may be different when the request is sampled at different times.
[0054] In this embodiment, due to the massive volume of requests, storing and managing execution data for each request using a Directed Acyclic Graph (DAG) is not only extremely inefficient but also costly. Therefore, this disclosure utilizes a sampling method. A second identifier is pre-configured in a database or cache as a sampling condition. After each received request, the first identifier corresponding to the request is matched against the sampling condition. If the first identifier matches the sampling condition, the request can be identified as the target request, and a DAG is constructed for that request and stored in the database.
[0055] S103: Generate the first structure diagram corresponding to the target request based on the multiple first operators called during the execution of the target request and the first data corresponding to each first operator.
[0056] The first operator refers to multiple logical units invoked by the system during the execution of a target request, each responsible for performing a specific function or calculation. The operators configured in the system allow the system development logic to be broken down according to operator granularity.
[0057] In this embodiment of the disclosure, the multiple first operators invoked during the execution of the target request may include an entry operator, at least one intermediate business operator, and a solution operator. The request can be solved by passing through the entry operator, intermediate business operators, and finally the solution operator. To implement rich system services, the system typically contains a large number of operators, and a request may only invoke a portion of them.
[0058] The first data is information used to describe the dependencies between each first operator and the operators executed before and after it during the request execution process.
[0059] In this embodiment of the disclosure, the operation of a first operator may depend on data passed by one or more other operators. Therefore, the first data corresponding to the first operator may include the identifiers of one or more operators that were executed before the first operator, the data passed by each operator to the first operator, the time consumed, and whether it is a long-tail critical path, etc.
[0060] In this embodiment of the disclosure, the invocation status of each operator in the system can be monitored by instrumentation to determine the first operator and the first data. Alternatively, the first operator and the first data can be determined by analyzing the execution logs after the request execution is completed, etc. This disclosure does not limit the scope of the method.
[0061] The first structural graph is a DAG graph that shows the topological relationships between operators in a single request.
[0062] In this embodiment of the disclosure, a DAG engine can be used to generate a first structure graph corresponding to the target request from the process data of the execution flow of the target request. Each first operator can be treated as a node, and then a directed edge can be constructed between the corresponding nodes based on the dependencies between the first operators contained in each first data. The arrow of the edge determines the order of execution between the first operators, thereby generating the first structure graph of the target request.
[0063] S104: Associate the first identification information with the first structure diagram and store it in the first database.
[0064] In this embodiment of the disclosure, after generating the first structure graph, the first identification information is associated with the first structure graph and stored in the first database. This allows the DAG topology graph of a request to be quickly searched and obtained in the database through the request's identifier, facilitating a view of the overall scheduling, understanding the serial-parallel relationship between operators, and enabling business development.
[0065] In this embodiment of the disclosure, due to compatibility issues with some databases, and in order to improve storage flexibility and query efficiency, after generating the first structure graph, data transformation can be performed on each edge of the first structure graph to obtain data that conforms to the JSON protocol, and then it can be associated with the first identification information and stored in the first database.
[0066] For example, the transformed data corresponding to an edge in the first structural graph can be {"from":"VertexA","data":"data1","to":"VertexB","time":12,"is_critical":true}. Here, 'from' represents the source operator, i.e., the operator sending data in this inter-operator data transfer (edge), which is node VertexA. 'data' is the data produced by 'from', named 'data1', passed from the source operator to the receiving operator. 'to' represents the receiving operator that depends on 'data', i.e., the operator receiving data in this inter-operator data transfer (edge), which is node VertexB. 'time' represents the cumulative time elapsed from receiving the target request to this data transfer, in milliseconds; that is, the system took 12 milliseconds (ms) from receiving the target request to this data transfer. 'is_critical' indicates whether the edge is a long-tail critical path; 'true' indicates that the edge is a long-tail critical path. Each edge in the first structural graph can be transformed in the above manner, and the transformed data is stored together in the first database.
[0067] In this embodiment, firstly, the first identifier information corresponding to the currently received service request is determined. Then, if the first identifier information matches the preset second identifier information, the service request is identified as the target request. Next, based on the multiple first operators invoked during the execution of the target request and the first data corresponding to each first operator, a first structure diagram corresponding to the target request is generated. Finally, the first identifier information and the first structure diagram are associated and stored in a first database. By sampling requests using identifier information, obtaining the topological relationships between target request analysis operators, and constructing a visualized structure diagram, the monitoring efficiency of operator execution can be improved while controlling management costs. This allows users to intuitively view the overall picture of request scheduling, providing a reliable data foundation for system management and optimization.
[0068] The following is based on Figure 2 The generation process of the first structural diagram will be explained using an example. Figure 2 This is a schematic diagram illustrating the generation of a structural diagram according to an embodiment of this disclosure.
[0069] like Figure 2As shown, when a user accesses the system, they send a request to the system. The request corresponds to the first identifier information 201. The execution flow of the system's business engine can be linked together using a DAG engine. Therefore, after receiving the request, the first identifier information 201 can be matched with the second identifier information 202 obtained from the sampling condition database. If the match is successful, the execution process of the request is broken down according to the granularity of the operators, passing through the entry operator, intermediate business operators, and finally to the solution operator to complete the solution. The dependencies between operators are... Figure 2 Arrows are used to indicate the order of execution, resulting in the first structure diagram 203.
[0070] exist Figure 2 In the first structural diagram 203 shown, each operator has a different time consumption. The number on each edge represents the cumulative time consumed from receiving the request to executing the data transmission corresponding to that edge. For each intermediate business operator, the cumulative time consumption corresponding to all edges pointing to that intermediate business operator in the first structural diagram 203 can be compared, and the edge with the longest consumption time can be identified as the long-tail critical path, which can be marked with a different color in the first structural diagram 203. This allows us to determine the longest path from the initial operator to the solution operator. For example, for the business operator marked as B in the first structural diagram 203, such as... Figure 2 In the example, the time taken for the two edges that transmit data to the business operator B is 80ms and 90ms respectively. Since 80ms < 90ms, the edge corresponding to 90ms is the long-tail critical path.
[0071] It should be noted that the system typically contains a large number of operators, and a request may only invoke a portion of them. Therefore, the first structural diagram 203 may also include system-configured business operators that are not invoked in this request. Figure 2 The operator is marked as A. Business operator A is not activated; its state condition is not met, so it is not executed. In the first structural diagram 203, business operator A can be identified with a different color to distinguish it from the executed operators.
[0072] like Figure 2 As shown, due to compatibility issues with some databases, and in order to improve storage flexibility and query efficiency, a reporting operator can be added after solving the operator to collect the topological information of the first structure graph 203. Each piece of information is modeled according to the edge, and the data is transmitted to the data extraction, transformation and loading (ETL) module for aggregation via JSON or protobuf protocol. The ETL module can store the data corresponding to the first structure graph 203 into the first database 204.
[0073] Figure 3This is a flowchart illustrating a request processing method according to another embodiment of this disclosure.
[0074] like Figure 3 As shown, the request processing method includes:
[0075] S301: Determine the first identification information corresponding to the currently received service request.
[0076] S302: If the first identification information matches the preset second identification information, the service request is determined as the target request.
[0077] For a detailed description of S301 and S302, please refer to the above embodiments, which will not be repeated here.
[0078] S303: Determine the multiple first operators invoked by the target request, the second operators associated with each first operator, and the first time when the second operators send data to the first operators.
[0079] The second operator is another first operator executed before the first operator.
[0080] In this embodiment of the disclosure, the invocation status of each operator in the system can be monitored by instrumentation, obtaining multiple first operators invoked by the target request, as well as the sequential execution relationship between all first operators. This allows for the determination of the second operators executed before each first operator. The execution of the first operators depends on the data transmitted by the second operators, and the first time the second operators transmit data to the first operators. Alternatively, after the request execution is completed, the multiple first operators invoked by the target request, the second operators associated with each first operator, and the first time the second operators send data to the first operators can be determined by analyzing execution logs, etc.
[0081] S304: Based on the second operator and the first time, obtain the first data corresponding to the first operator.
[0082] In this embodiment of the disclosure, by determining the dependencies between operators called by the system when processing a request by the operators executed before each operator and the first time of receiving and transmitting data, a reliable data foundation is provided for generating the topology diagram corresponding to the request, thereby improving the accuracy of request processing.
[0083] S305: For each first operator, determine the node in the reference structure graph corresponding to the first operator.
[0084] The reference structure diagram is a static diagram that contains all the operators of the system and can be configured according to the logic of system development.
[0085] In this embodiment of the disclosure, since each request calls a part of the operators in the system, each first operator should be able to find a corresponding node in the reference structure graph. Therefore, when the first structure graph is generated, these nodes are in an active state, indicating that the operators corresponding to these nodes are executed in this request.
[0086] It should be noted that after determining the nodes corresponding to the first operator in the reference structure graph, the state parameters of these nodes can be modified to the active state to indicate that these nodes are used to generate the first structure graph.
[0087] S306: Based on the second operator associated with the first operator, connect the nodes corresponding to the first operator and the nodes corresponding to the second operator to obtain edges, so as to generate the first structure graph corresponding to the target request.
[0088] The direction of the edge is from the second operator to the first operator, and the value of the edge is the first time.
[0089] In this embodiment of the disclosure, by filtering the nodes corresponding to the operators called in a single request on the structure graph containing all operators of the system, and then constructing directed edges between nodes according to the dependencies between the calling operators in this request, a first structure graph corresponding to this request is generated. This improves the efficiency and accuracy of the generation of the first structure graph and provides a data foundation for improving the efficiency of request processing and operator management.
[0090] It's important to note that after generating the first structure graph, the long-tail critical path for this request can be marked within it. A long-tail critical path refers to a set of paths or tasks that, while individually short-lived, have a large number of distinct paths, complex dependencies, or significant cumulative effects, ultimately impacting the overall project schedule or system performance. Marking the long-tail critical path allows users to quickly and accurately pinpoint the performance bottlenecks in the system under specific circumstances using the first structure graph, improving the accuracy of system optimization and saving time and resources.
[0091] Optionally, the first target node in the first structural graph can be determined first.
[0092] Here, the first operator corresponding to the first target node is of type first. Type first indicates that the operator is the last operator called in the request, i.e., as described above. Figure 2 The solver is shown in the figure.
[0093] Then, at least one candidate edge connected to the first target node is determined in the first structural graph.
[0094] In this context, the direction of the candidate edge points to the first target node. In other words, the first operator corresponding to the first target node is the operator that receives data among the two first operators connected by the edge.
[0095] Then, the first time corresponding to each candidate edge can be compared, and the candidate edge with the largest value in the first time can be determined as the target edge.
[0096] In this embodiment of the disclosure, the candidate edge with the largest time at the first moment is the path with the longest time at each node. Therefore, the path formed by all target edges in the first structural graph is the requested long-tail critical path with the longest time.
[0097] For example, if the first target node is connected by three candidate edges, denoted as edge 1, edge 2, and edge 3, with edge 1 having a first time of 80ms, edge 2 having a first time of 90ms, and edge 3 having a first time of 85ms, then edge 2 is the target edge since 80ms < 85ms < 90ms. Alternatively, if the first target node has only one candidate edge, then that candidate edge is the target edge.
[0098] Then, the other node connected to the target edge can be identified as the second target node. Based on the second target node, the operation of determining candidate edges is repeated until the operator type corresponding to the determined target node is the second type. The values of all target edges are then modified to preset values to obtain the updated first structure graph.
[0099] The second type indicates that the operator is the first operator requested to be invoked, i.e., the one mentioned above. Figure 2 The entry operator shown.
[0100] The preset value is used to mark the time-consuming long-tail critical path in the first structure graph. It can be that the target edge in the first structure graph is modified to a specific color, such as red.
[0101] In this embodiment of the disclosure, by determining the edges constituting the long-tail critical path step by step forward from the solving operator in the reverse order of the requested solution in the generated structure graph, and modifying the values of the corresponding edges in the first structure graph to update the first structure graph, the user can quickly and accurately locate those links in the system that will become performance bottlenecks under certain circumstances through the first structure graph, thereby improving the accuracy of system optimization and saving time and resources.
[0102] S307: Associate the first identification information with the first structure diagram and store it in the first database.
[0103] For a detailed description of S307, please refer to the above embodiments, which will not be repeated here.
[0104] Figure 4This is a flowchart illustrating a request processing method according to another embodiment of this disclosure.
[0105] like Figure 4 As shown, the request processing method includes:
[0106] S401: Determine the first identification information corresponding to the currently received service request.
[0107] S402: If the first identification information matches the preset second identification information, the service request is determined as the target request.
[0108] S403: Generate the first structure diagram corresponding to the target request based on the multiple first operators invoked during the execution of the target request and the first data corresponding to each first operator.
[0109] For details on S401 to S403, please refer to the above embodiments, and they will not be repeated here.
[0110] S404: If the first structural graph contains nodes and / or edges of a preset type, delete the nodes and / or edges of the preset type to obtain the second structural graph.
[0111] Among them, the preset type of nodes and edges refers to the redundant built-in node and edge relationships in the first structural graph.
[0112] In this embodiment, the DAG engine scheduling system typically has some built-in nodes, such as condition nodes. These nodes are not very useful for operator management and optimization, resulting in a large number of redundant nodes in the generated first structure graph. This affects the observability of the first structure graph and causes it to occupy a large amount of memory. Therefore, these nodes can be deleted from the first structure graph to obtain the second structure graph.
[0113] Furthermore, in the first structural graph, there may be two or more connection paths between two nodes. Redundant edges can be identified in these paths and removed, thus simplifying the changes to the connection relationships in the structural graph while preserving the dependencies between nodes. For example, if node A is connected to nodes B, C, and D in sequence to form a path, and nodes A and D are connected, and nodes B and D are also connected, since the connection relationships between nodes are already reflected in this path, the edges connecting nodes A and D, and B and D, can be identified as redundant and removed from the first structural graph.
[0114] In this embodiment of the disclosure, after generating the first structural graph, it is reported to the aggregation module. A search algorithm can be used to determine nodes and / or edges of a preset type in the first structural graph, and redundant dependencies can be removed as needed to obtain the second structural graph.
[0115] S405: Associate the second structure diagram with the first structure diagram and store it in the first database.
[0116] In this embodiment of the disclosure, the second structural diagram is associated with the first structural diagram and stored in the first database so that when the user subsequently views the topology diagram of the target request, they can choose to view the first structural diagram containing all information or the second structural diagram containing only important information as needed, thereby improving the diversity of structural diagram display and optimizing the user experience.
[0117] In this embodiment, by searching for redundant nodes and edge relationships in the generated structure graph and deleting them, an optimized structure graph is obtained, which improves the observability of the system topology graph and helps improve the efficiency of user management and optimization of system operators.
[0118] The following is based on Figure 5 Let's take an example to illustrate the optimization process of the first structure diagram. Figure 5 This is a schematic diagram of a structural diagram processing procedure provided in an embodiment of this disclosure.
[0119] like Figure 5 As shown, after generating the first structure graph and reporting it to the ETL aggregation module, the ETL aggregation module can first store the original request JSON corresponding to the first structure graph 501 in the first database 503, and perform topology reduction and path optimization on the first structure graph 503 to obtain the second structure graph 502. The optimized request JSON corresponding to the second structure graph 502 is also stored in the first database 503 and associated with the first structure graph 501.
[0120] It should be noted that, as Figure 5 As shown, the ETL aggregation module may also include an anomaly detection operator to detect whether there are path loops, access or time consumption anomalies in the first structure diagram 501. When an anomaly is found, the operator sends a command to the alarm system to trigger an anomaly alarm.
[0121] And, as Figure 5 As shown, the ETL aggregation module can also include a statistical calculator, which is used to perform statistics on the operator heat and time consumption percentile in the first database 503 at regular intervals, and store the statistical results in the aggregation database.
[0122] Figure 6 This is a flowchart illustrating a request processing method according to another embodiment of this disclosure.
[0123] like Figure 6 As shown, the request processing method includes:
[0124] S601: Upon receiving a business request, retrieve the second identification information from the first cache.
[0125] The first cache refers to the cache that is in the enabled state. The first cache may not be a fixed cache; it may be multiple caches that alternate.
[0126] In this embodiment of the disclosure, the system request traffic is huge, and sampling can be performed for different request scenarios, different experiments, different users, etc. For example, it can simply take the modulus of the request and sample 1% of the data, or it can only record data for certain user groups. This sampling often occurs at the entry point of the microservice receiving the request, that is, the parameter processing stage.
[0127] In this embodiment of the disclosure, obtaining identification information from the cache as a condition for request sampling can reduce redundant calculations, improve data processing efficiency, and ensure data consistency when sampling different requests at the same time.
[0128] In this embodiment, the sampling conditions can be manually configured visually through the system service platform and written into the database. The online microservice module can integrate a sampling tool SDK (Software Development Kit) to perform timed hot-loading of sampling conditions, thereby achieving the ability to reload different sampling conditions without affecting the performance of the online service. In this disclosure, a dual-buffer hot-loading mechanism can be used to implement online loading of sampling conditions.
[0129] Optionally, if the current time reaches a first preset time, the currently configured second identifier information can be obtained from the second database.
[0130] The first preset time is the time interval between every two reload sampling conditions set according to actual sampling needs, such as 60 seconds.
[0131] Then, the data in the second cache can be cleared, the second identification information can be stored in the second cache, and the second cache can be enabled and modified into the first cache.
[0132] The second buffer is currently closed.
[0133] The following is combined Figure 7 The hot loading process for sampling conditions is explained. Figure 7 This is a schematic diagram of a hot loading process for sampling conditions provided in an embodiment of this disclosure.
[0134] like Figure 7As shown, the first preset time is 60 seconds, and the second identification information 702 can be reloaded from the second database 702 every 60 seconds. Figure 7 At the time shown, cache 1 is used to provide services to the outside world to determine whether a request has hit the sample, and cache 0 is in a closed state. Therefore, cache 0 can be identified as the second cache. First, the data in cache 0 is cleared, and the second identification information 702 is stored in cache 0. Then, it is exchanged with cache 1, updating cache 0 to an open state and cache 1 to a closed state. After that, cache 0 becomes the first cache, used to provide services to the outside world to determine whether a request has hit the sample.
[0135] In this embodiment of the disclosure, by setting two caches, different sampling conditions can be hot-loaded periodically, maintaining the continuity of online sampling without interruption and optimizing the user experience.
[0136] S602: Determine the first identification information corresponding to the currently received service request.
[0137] S603: If the first identification information matches the preset second identification information, the service request is determined as the target request.
[0138] S604: Generate the first structure diagram corresponding to the target request based on the multiple first operators called during the execution of the target request and the first data corresponding to each first operator.
[0139] S605: Associate the first identification information with the first structure diagram and store it in the first database.
[0140] For a detailed description of S602 to S605, please refer to the above embodiments, which will not be repeated here.
[0141] Figure 8 This is a flowchart illustrating a request processing method according to another embodiment of this disclosure.
[0142] like Figure 8 As shown, the request processing method includes:
[0143] S801: Receives the first query command sent by the user.
[0144] The first query instruction includes third identification information. The third identification information may include at least one of the following: request ID, user ID, experiment ID, and operator identifier.
[0145] In this embodiment of the disclosure, a data display interface is also provided, on which users can send a first query command to view the details of a single request call operator, the processing status of all requests of a user, or the running status of a certain operator, etc.
[0146] S802: Match the third identification information with the first identification information associated with each first structure diagram in the first database to obtain the target structure diagram associated with the third identification information, and send it to the user for display.
[0147] In this embodiment of the disclosure, after receiving the first query instruction from the front end, the required data can be obtained from the database and converted into the format required by the front end. The front end performs online graph rendering, performs topological sorting on the graph scheduling relationship of the DAG, and draws and displays the scheduling style of the entire graph hierarchically.
[0148] It should be noted that, in the embodiments of this disclosure, the target structure diagram may include a first structure diagram and an optimized second structure diagram. When displaying the target structure diagram, the user can choose whether to view the complete structure diagram or the optimized structure diagram in the interface.
[0149] It should be noted that, in this embodiment of the disclosure, the data shown can be further divided into static graphs and dynamic graphs. The static graph is the original DAG graph data, which includes all operators configured by the system. The dynamic graph is the DAG graph data requested in a single request. Because the intermediate operators activated during the request of the dynamic graph are different, it is different from the static graph. The dynamic graph is a subset of the static graph.
[0150] In this embodiment of the disclosure, by accessing the data display system and querying the structure diagram stored in the database, regardless of whether the request is online or offline, the DAG topology diagram of a single request can be visualized, making it convenient to view the overall scheduling, understand the serial-parallel relationship between operators, and facilitate business development optimization.
[0151] Figure 9 This is a flowchart illustrating a request processing method according to another embodiment of this disclosure.
[0152] like Figure 9 As shown, the request processing method includes:
[0153] S901: When the current time reaches the second preset time, perform statistics on all first operators contained in the first database to obtain the current number of calls for each first operator and at least one second time corresponding to the first operator.
[0154] The second preset time is the time interval between every two times data is retrieved from the first database for statistical analysis, set according to the actual frequency of statistical analysis. For example, it could be 5 minutes.
[0155] In this embodiment of the disclosure, different requests can invoke the same business operator in the system. Therefore, when the current time reaches a second preset time, the number of times each operator is invoked in the first structural diagram is counted from the first database, thus obtaining the current invocation count of the first operator. Furthermore, in each first structural diagram where the first operator is invoked, the second time corresponding to the first operator, i.e., the execution time of the first operator in a single request, can be obtained by the difference between the first time the first operator receives data and the time it sends data in that first structural diagram. Alternatively, the second time can also be obtained by monitoring the actual execution time when generating the first structural diagram and stored in the corresponding node of the first structural diagram.
[0156] In this embodiment of the disclosure, the more times any first operator is called, the greater its role in the system, and the more important it is for operator management and optimization.
[0157] S902: Based on at least one second time and a proportional threshold, obtain the current time quantile value of the first operator.
[0158] The ratio threshold is the proportion used to calculate the operator time quantile value, which can be set as needed, for example, it can be 80%.
[0159] In this embodiment of the disclosure, at least one second time corresponding to each first operator can be sorted in ascending order. The second time corresponding to the quantile of the corresponding proportional threshold is determined in the sorted sequence to obtain the current time-consuming quantile value of the first operator. A larger time-consuming quantile value indicates that the first operator generally consumes a significant amount of time during request processing and needs optimization.
[0160] S903: Associate the current time, the identifier of each first operator, the number of calls, and the time-consuming quantile value, and store them in the third database.
[0161] In this embodiment of the disclosure, by periodically aggregating and recording the number of operator accesses and the time quantile values, users can quickly obtain reliable data such as time consumption and access frequency when managing the system, which facilitates business monitoring, provides reliable decision-making basis for system management and optimization, and improves users' work efficiency.
[0162] It should be noted that when displaying data, data can be retrieved not only from the first database but also from the third database.
[0163] The following is combined Figure 10 The process of online data management is illustrated with an example. Figure 10 This is a schematic diagram of a data display operation provided in this publication.
[0164] like Figure 10As shown, users can send query commands to the front-end system. When the command is to view the online real-time request topology map or the offline development operator topology preview, the back-end system can retrieve the structure map matching the identifier in the query command from the first database 1001 and return it to the front-end system for display. Alternatively, when the command is to view the online operator heatmap (i.e., the distribution of the number of times each operator is used), the online operator time-consuming long-tail topology map, or to perform offline redundancy management, the back-end system can retrieve the corresponding data from the third database 1002 and return it to the front-end system for display.
[0165] It should be noted that, in this disclosure, based on the operator's dependency relationship and operator access frequency, if it is determined that a certain operator is not depended on by other operators and its access frequency is below a certain value, it can be determined that the operator is redundant. In this case, the governance measure can be to delete the operator from the system.
[0166] Figure 11 This is a schematic diagram of the structure of a request processing device according to an embodiment of the present disclosure.
[0167] like Figure 11 As shown, the request processing device 110 includes:
[0168] The first determining module 1101 is used to determine the first identification information corresponding to the currently received service request;
[0169] The second determining module 1102 is used to determine the business request as the target request when the first identification information matches the preset second identification information;
[0170] The generation module 1103 is used to generate a first structure diagram corresponding to the target request based on multiple first operators called during the execution of the target request and the first data corresponding to each first operator.
[0171] The storage module 1104 is used to associate the first identification information with the first structure diagram and store it in the first database.
[0172] In some embodiments of this disclosure, the request processing apparatus 110 may further include:
[0173] The third determining module is used to determine the multiple first operators invoked by the target request, the second operators associated with each first operator, and the first time when the second operator sends data to the first operator, wherein the second operator is another first operator executed before the first operator;
[0174] The fourth determining module is used to obtain the first data corresponding to the first operator based on the second operator and the first time.
[0175] In some embodiments of this disclosure, the generation module 1103 may specifically be used for:
[0176] For each first operator, determine the node corresponding to the first operator in the reference structure graph;
[0177] Based on the second operator associated with the first operator, the nodes corresponding to the first operator and the nodes corresponding to the second operator are connected to obtain edges to generate the first structural graph corresponding to the target request. The direction of the edge is from the second operator to the first operator, and the value of the edge is the first time.
[0178] In some embodiments of this disclosure, the generation module 1103 may also be used for:
[0179] Determine the first target node in the first structural graph, wherein the first operator corresponding to the first target node is of the first type;
[0180] In the first structural graph, at least one candidate edge is identified that connects to the first target node, wherein the direction of the candidate edge points to the first target node;
[0181] For each candidate edge, compare the first time intervals and determine the candidate edge with the largest value at the first time interval as the target edge;
[0182] The node connected to the target edge is designated as the second target node;
[0183] Based on the second target node, return to perform the operation of determining candidate edges until the operator type corresponding to the determined target node is the second type, and modify the values of all target edges to preset values to obtain the updated first structure graph.
[0184] In some embodiments of this disclosure, the generation module 1103 may also be used for:
[0185] If the first structural graph contains nodes and / or edges of a preset type, delete the nodes and / or edges of the preset type to obtain the second structural graph;
[0186] The second structural diagram is associated with the first structural diagram and stored in the first database.
[0187] In some embodiments of this disclosure, the request processing apparatus 110 may further include:
[0188] The first acquisition module is used to obtain the second identification information from the first cache area when a business request is received.
[0189] In some embodiments of this disclosure, the first acquisition module may also be used for:
[0190] If the current time reaches the first preset time, retrieve the currently configured second identifier information from the second database;
[0191] Clear the data in the second cache, store the second identifier information in the second cache, and enable the second cache, changing it to the first cache. The second cache is currently in a closed state.
[0192] In some embodiments of this disclosure, the request processing apparatus 110 may further include:
[0193] The receiving module is used to receive a first query instruction sent by the user, wherein the first query instruction contains third identification information;
[0194] The display module is used to match the third identification information with the first identification information associated with each first structure diagram in the first database, obtain the target structure diagram associated with the third identification information, and send it to the user for display.
[0195] In some embodiments of this disclosure, the request processing apparatus 110 may further include:
[0196] The statistics module is used to perform statistics on all first operators contained in the first database when the current time reaches the second preset time, to obtain the current number of calls for each first operator and at least one second time corresponding to the first operator;
[0197] The fifth determining module is used to obtain the current time quantile value of the first operator based on at least one second time and a proportional threshold.
[0198] The storage module is used to associate the current time, the identifier of each first operator, the number of calls, and the time-consuming quantile value, and store them in the third database.
[0199] It should be noted that the foregoing explanation of the request processing method also applies to the request processing device of this embodiment, and will not be repeated here.
[0200] In this embodiment, by sampling requests using identification information, the topological relationship between target request analysis operators is obtained, and a visual structure diagram is constructed. This can improve the monitoring efficiency of operator execution while controlling management costs, and allow users to intuitively view the overall picture of request scheduling, providing a reliable data foundation for system management and optimization.
[0201] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0202] Figure 12A schematic block diagram of an example electronic device 1200 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0203] like Figure 12 As shown, device 1200 includes a computing unit 1201, which can perform various appropriate actions and processes according to a computer program stored in read-only memory (ROM) 1202 or a computer program loaded from storage unit 1208 into random access memory (RAM) 1203. The RAM 1203 may also store various programs and data required for the operation of device 1200. The computing unit 1201, ROM 1202, and RAM 1203 are interconnected via bus 1204. Input / output (I / O) interface 1205 is also connected to bus 1204.
[0204] Multiple components in device 1200 are connected to I / O interface 1205, including: input unit 1206, such as keyboard, mouse, etc.; output unit 1207, such as various types of monitors, speakers, etc.; storage unit 1208, such as disk, optical disk, etc.; and communication unit 1209, such as network card, modem, wireless transceiver, etc. Communication unit 1209 allows device 1200 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0205] The computing unit 1201 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 1201 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 1201 performs the various methods and processes described above, such as request processing methods. For example, in some embodiments, the request processing method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 1208. In some embodiments, part or all of the computer program may be loaded and / or installed on device 1200 via ROM 1202 and / or communication unit 1209. When the computer program is loaded into RAM 1203 and executed by the computing unit 1201, one or more steps of the request processing method described above may be performed. Alternatively, in other embodiments, the computing unit 1201 may be configured to perform request processing methods by any other suitable means (e.g., by means of firmware).
[0206] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0207] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0208] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0209] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0210] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), the Internet, and blockchain networks.
[0211] Computer systems can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. A server can be a cloud server, also known as a cloud computing server or cloud host, a hosting product within the cloud computing service ecosystem, addressing the shortcomings of traditional physical hosts and VPS (Virtual Private Server, or simply "VPS") services, such as high management difficulty and weak business scalability. Servers can also be servers for distributed systems or servers incorporating blockchain technology.
[0212] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0213] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this disclosure, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified. In the description of this disclosure, the words "if" and "suppose" as used may be interpreted as "when," "when," "in response to determination," or "in the circumstances."
[0214] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A request processing method, comprising: Determine the first identifier information corresponding to the currently received service request; If the first identification information matches the preset second identification information, the service request is identified as the target request; Based on the multiple first operators invoked during the execution of the target request and the first data corresponding to each first operator, a first structure diagram corresponding to the target request is generated; The first identification information is associated with the first structural diagram and stored in the first database.
2. The method as described in claim 1, wherein, The method further includes: Determine the multiple first operators invoked by the target request, the second operators associated with each first operator, and the first time when the second operator sends data to the first operator, wherein the second operator is another first operator executed before the first operator; Based on the second operator and the first time, the first data corresponding to the first operator is obtained.
3. The method as described in claim 2, wherein, The step of generating a first structure diagram corresponding to the target request based on multiple first operators invoked during the execution of the target request and first data corresponding to each first operator includes: For each of the first operators, determine the node in the reference structure graph corresponding to the first operator; Based on the second operator associated with the first operator, the nodes corresponding to the first operator and the nodes corresponding to the second operator are connected to obtain an edge to generate a first structure graph corresponding to the target request, wherein the direction of the edge is from the second operator to the first operator, and the value of the edge is the first time.
4. The method of claim 3, wherein, After generating the first structure diagram corresponding to the target request, the following can also be done: Determine the first target node in the first structural graph, wherein the first operator corresponding to the first target node is of the first type; In the first structural graph, at least one candidate edge is identified that connects to the first target node, wherein the direction of the candidate edge points towards the first target node; For each candidate edge, a first time interval is compared, and the candidate edge with the largest value at the first time interval is determined as the target edge. The other node connected to the target edge is designated as the second target node; Based on the second target node, return to perform the operation of determining candidate edges until the operator type corresponding to the determined target node is the second type, and modify the values of all the target edges to preset values to obtain the updated first structure graph.
5. The method of claim 1, wherein, After generating the first structure diagram corresponding to the target request, the method further includes: If the first structural diagram contains nodes and / or edges of a preset type, delete the nodes and / or edges of the preset type to obtain the second structural diagram; The second structure diagram is associated with the first structure diagram and stored in the first database.
6. The method of claim 1, wherein, The method further includes: Upon receiving a business request, the second identifier information is retrieved from the first cache.
7. The method of claim 6, wherein, Also includes: If the current time reaches the first preset time, retrieve the currently configured second identifier information from the second database; Clear the data in the second cache, store the second identification information in the second cache, and enable the second cache, modifying it to the first cache, wherein the second cache is in a closed state at the current time.
8. The method as described in any one of claims 1-7, wherein, Also includes: Receive a first query instruction sent by a user, wherein the first query instruction contains third identification information; The third identification information is matched with the first identification information associated with each of the first structural diagrams in the first database to obtain the target structural diagram associated with the third identification information, and then sent to the user for display.
9. The method as described in claims 1-7, wherein, Also includes: When the current time reaches the second preset time, all the first operators contained in the first database are statistically analyzed to obtain the current number of calls for each first operator and at least one second time corresponding to the first operator; Based on the at least one second time and the proportional threshold, the current time quantile value of the first operator is obtained; The current time, the identifier of each of the first operators, the number of calls, and the time consumption percentile are associated and stored in a third database.
10. A request processing apparatus, comprising: The first determining module is used to determine the first identification information corresponding to the currently received service request; The second determining module is used to determine the service request as a target request when the first identification information matches the preset second identification information; The generation module is used to generate a first structure diagram corresponding to the target request based on multiple first operators invoked during the execution of the target request and the first data corresponding to each first operator. The storage module is used to associate the first identification information with the first structure diagram and store it in the first database.
11. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the request processing method according to any one of claims 1-9.
12. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, in, The computer instructions are used to cause the computer to perform the request processing method according to any one of claims 1-9.
13. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the steps of the request processing method according to any one of claims 1-9.
Citation Information
Patent Citations
Resource processing method and device, electronic equipment and storage medium
CN115795208A
Information display method and device, electronic equipment and storage medium
CN116955856A
Service-based data processing method and device, equipment and medium
CN117194027A