Data processing method and apparatus

By using directed acyclic graphs to represent and optimize microservice dependencies in a microservice architecture, the problem of microservice call waiting time is solved, an efficient data processing flow is achieved, and business processing efficiency is improved.

CN116996556BActive Publication Date: 2026-07-07MASHANG CONSUMER FINANCE CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
MASHANG CONSUMER FINANCE CO LTD
Filing Date
2022-04-26
Publication Date
2026-07-07

AI Technical Summary

Technical Problem

In a microservice architecture, due to the dependencies between different layers, each microservice call must wait until all microservices in the previous layer have finished calling before it can proceed, resulting in low data processing efficiency. Especially when the business complexity is high, a slow call speed of any microservice in any layer will affect the overall business processing efficiency.

Method used

The target microservice and its dependencies are represented by a directed acyclic graph. By optimizing the directed acyclic graph for invocation, the service output parameters of the microservice that has been invoked are optimized using context information to avoid repeated invocation and achieve efficient invocation of the target microservice.

Benefits of technology

By optimizing calls using a directed acyclic graph (DAG), waiting time in hierarchical calls is eliminated, processing resources are maximized, the number of microservice calls is reduced, and data processing efficiency is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116996556B_ABST
    Figure CN116996556B_ABST
Patent Text Reader

Abstract

The application discloses a data processing method and device, which is used for improving the efficiency of data processing. The method comprises the following steps: in response to a service request of a target service, obtaining a directed acyclic graph of the target service and target service out parameters of the target service, the directed acyclic graph comprising nodes corresponding to target microservices and directed edges between the nodes, the directed edges representing the dependency relationship between the connected nodes, the target microservices being microservices required for processing the target service in a service pool; optimizing the directed acyclic graph based on context information, the context information comprising out parameter values of service out parameters of the microservices in the service pool that have been called; calling the target microservices based on the optimized directed acyclic graph, obtaining the out parameter values of the service out parameters corresponding to the target microservices, and writing the out parameter values of the service out parameters into the context information; and returning response data corresponding to the service request based on the context information and the target service out parameters.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a data processing method and apparatus. Background Technology

[0002] Microservices, as an architectural solution for building applications, offer significant advantages over traditional monolithic applications and Service-Oriented Architecture (SOA) in handling complex business architectures and improving scalability and maintainability, effectively addressing the complexity issues arising from business growth. Despite these advantages, as business complexity increases, completing a single business request often requires coordination among dozens or even hundreds of services.

[0003] The current mainstream business processing solution is to categorize the microservices required to implement the business based on their service types. Each type of microservice belongs to a specific layer for invocation. After all microservices in each layer have been invoked, the next layer's microservices are invoked. After all microservices in all layers have been invoked, the output parameters of each layer's services are assembled to complete the business request transaction. However, due to the dependencies between different layers, each layer's microservice invocation can only proceed after all microservices in the previous layer have been invoked. If any microservice in any layer is slow to invoke, it will affect the overall data processing efficiency. Summary of the Invention

[0004] The purpose of this application is to provide a data processing method and apparatus to improve the efficiency of data processing.

[0005] To achieve the above objectives, the embodiments of this application adopt the following technical solutions:

[0006] In a first aspect, embodiments of this application provide a data processing method, including:

[0007] In response to a business request from a target business, obtain the directed acyclic graph of the target business and the target service output parameters of the target business;

[0008] The directed acyclic graph is optimized based on context information, which includes the output parameter values ​​of the microservices that have been invoked in the service pool.

[0009] The target microservice is invoked based on the optimized directed acyclic graph to obtain the service output parameter result corresponding to the target microservice, and the output parameter value of the service output parameter is written into the context information.

[0010] Based on the context information and the output parameters of the target service, return the response data corresponding to the business request;

[0011] The directed acyclic graph includes the nodes corresponding to the target microservice and the directed edges between the nodes. The directed edges represent the dependencies between the connected nodes. The target microservice is the microservice in the service pool required to process the target business.

[0012] Secondly, embodiments of this application provide a data processing apparatus, including:

[0013] The first acquisition module is used to acquire the directed acyclic graph of the target business and the target service output parameters of the target business in response to the business request of the target business.

[0014] The optimization module is used to optimize the directed acyclic graph based on context information, which includes the output parameter values ​​of the microservices that have been invoked in the service pool.

[0015] The calling module is used to call the target microservice based on the optimized directed acyclic graph, obtain the output parameter value of the service output parameter corresponding to the target microservice, and write the output parameter value of the service output parameter corresponding to the target microservice into the context information.

[0016] The response module is used to return response data corresponding to the business request based on the context information and the output parameters of the target service;

[0017] The directed acyclic graph includes the nodes corresponding to the target microservice and the directed edges between the nodes. The directed edges represent the dependencies between the connected nodes. The target microservice is the microservice in the service pool required to process the target business.

[0018] Thirdly, embodiments of this application provide an electronic device, including:

[0019] processor;

[0020] Memory used to store the processor's executable instructions;

[0021] The processor is configured to execute the instructions to implement the method as described in the first aspect.

[0022] Fourthly, embodiments of this application provide a computer-readable storage medium that, when instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to perform the method described in the first aspect.

[0023] The above-described technical solutions adopted in the embodiments of this application can achieve the following beneficial effects:

[0024] By representing the target microservices required for processing the target business and the dependencies between them in the form of a directed acyclic graph (DAG), each node in the DAG corresponds to a target microservice, and the directed edges between nodes represent the dependencies between target microservices. This is equivalent to treating each target microservice as an independent unit. Invoking the target microservices required for processing the target business based on the DAG ensures that after each target microservice is invoked, the downstream target microservices to be invoked can be immediately analyzed. This eliminates the waiting time in hierarchical invocation schemes, maximizes the utilization of processing resources, and is beneficial for improving efficiency. High business processing efficiency; on this basis, the service output parameters of the microservices that have been called in the service pool are written into the context information. Before calling the target microservice required by the target business based on the directed acyclic graph, the directed acyclic graph is optimized based on the service output parameters of the microservices that have been called in the context information. Based on the context information and the target service output parameters of the target business, the business request is responded to. This can avoid the target microservice that has already been called and whose service output parameters have been obtained being called repeatedly, thereby reducing the number of calls to the target microservice, reducing the consumption of processing resources, and also helping to improve data processing efficiency. Attached Figure Description

[0025] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0026] Figure 1 This is a flowchart illustrating a data processing method based on hierarchical service calls.

[0027] Figure 2 A flowchart illustrating a data processing method provided in one embodiment of this application;

[0028] Figure 3 A flowchart illustrating a method for constructing a directed acyclic graph according to an embodiment of this application;

[0029] Figure 4 A schematic diagram illustrating the dependencies between microservices as provided in one embodiment of this application;

[0030] Figure 5 A schematic diagram of a directed acyclic graph of a target service provided for one embodiment of this application;

[0031] Figure 6 A flowchart illustrating an optimization method for a directed acyclic graph provided in one embodiment of this application;

[0032] Figure 7A schematic diagram of a microservice invocation process based on a directed acyclic graph is provided as an embodiment of this application;

[0033] Figure 8 A schematic diagram illustrating an exception call handling method provided in one embodiment of this application;

[0034] Figure 9 A schematic diagram illustrating an application scenario to which a data processing method is applicable, provided as an embodiment of this application;

[0035] Figure 10 A flowchart illustrating a data processing method provided for another embodiment of this application;

[0036] Figure 11 A schematic diagram of the structure of a data processing apparatus provided in one embodiment of this application;

[0037] Figure 12 This is a schematic diagram of the structure of an electronic device provided in one embodiment of this application. Detailed Implementation

[0038] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0039] The terms "first," "second," etc., used in this specification and claims are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein. Furthermore, in this specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0040] Explanation of some concepts:

[0041] SOA: Service-Oriented Architecture. It allows for the distributed deployment, composition, and use of loosely coupled, coarse-grained application components over a network, based on demand.

[0042] ESB: Enterprise Service Bus, refers to the product of combining traditional middleware technology with technologies such as XML and Web services. ESB provides the most basic connection hub in the network and is an essential element in building the nervous system of an enterprise.

[0043] Microservices: A software development technique, a variant of SOA architecture, that advocates dividing a single application into a set of small services that coordinate and cooperate with each other to provide end-user value.

[0044] DAG: Directed Acyclic Graph, refers to a directed acyclic graph without loops. If there is a non-directed acyclic graph where a path from point A to B via point C returns to A, forming a cycle, changing the direction of the edge from C to A to A to C transforms it into a directed acyclic graph. The number of spanning trees in a directed acyclic graph is equal to the product of the in-degrees of the nodes with non-zero in-degrees.

[0045] As mentioned earlier, with increasing business complexity, completing a single business request often requires coordination and processing between dozens or even hundreds of services. Taking financial risk control as an example, assessing a user's credit risk often requires calling thousands of different types of microservices, such as microservices involving internal data sources, external data sources, variables, and model calculations. Typically, processing a risk control transaction involves first calling internal microservices to obtain basic user information, blacklists, and other internal data; then, calling external microservices to access external data sources, such as authorized credit information, credit scores, and phone number location; next, calling variable microservices and basic model microservices to pass the obtained internal and external information to the corresponding variables or basic models for processing; finally, calling the fusion model microservice to pass the processed results to the fusion model for fusion processing, and so on. Thus, the final call to the fusion model microservice often depends on the service parameter results of the numerous preceding microservices.

[0046] The current mainstream business processing solution is to categorize the microservices required for business processing based on their service types. Each type of microservice belongs to a specific layer for invocation. After all microservices in each layer have been invoked, the next layer's microservices are invoked. After all microservices in all layers have been invoked, the output parameters of each layer's services are assembled to complete the business request transaction. However, due to the dependencies between different layers, each layer's microservice invocation can only proceed after all microservices in the previous layer have been invoked. If any microservice in any layer is slow to invoke, it will affect the overall business processing efficiency.

[0047] For example, a mainstream business processing approach is to group microservices involving internal data sources, microservices involving external data sources, microservices involving variables, and microservices involving models into separate layers, such as... Figure 1 As shown, internal services A and B belong to layer 1, external services A and B belong to layer 2, variable service A belongs to layer 3, model services A and B belong to layer 4, and model services C and D belong to layer 5. Suppose that internal service B in layer 1 times out. Since microservices in layer 2 depend on the call results of microservices in layer 1, and microservices in layers 3 through 4 indirectly depend on the call results of microservices in layer 1, the microservices in layer 2 and the microservices in layers 3 through 5 must wait for the call to internal service B in layer 1 to complete before they can be invoked. This slows down the invocation speed of microservices in downstream layers of layer 1, ultimately affecting the overall business processing efficiency.

[0048] In view of this, the embodiments of this application aim to propose a data processing scheme. This scheme represents the target microservices required for processing the target business and the dependencies between these microservices in the form of a directed acyclic graph (DAG). Each node in the DAG corresponds to a target microservice, and the directed edges between nodes represent the dependencies between these microservices, effectively treating each target microservice as an independent unit. Based on the DAG, the target microservices required for processing the target business are invoked. This ensures that after each target microservice is invoked, the downstream target microservices to be invoked can be immediately analyzed, thereby eliminating the waiting time in hierarchical invocation schemes and maximizing efficiency. Optimizing the utilization of processing resources is beneficial to improving business processing efficiency. On this basis, the service output parameters of the microservices that have been called in the service pool are written into the context information. Before calling the target microservice required by the target business based on the directed acyclic graph, the directed acyclic graph is optimized based on the service output parameters of the microservices that have been called in the context information. Based on the context information and the target service output parameters of the target business, the business request is responded to. This can avoid the target microservice that has already been called and whose service output parameters have been obtained being called repeatedly, thereby reducing the number of calls to the target microservice, reducing the consumption of processing resources, and also improving data processing efficiency.

[0049] It should be understood that the data processing methods provided in the embodiments of this application can all be executed by electronic devices or software installed in electronic devices, specifically by terminal devices or server devices.

[0050] The technical solutions provided by the various embodiments of this application are described in detail below with reference to the accompanying drawings.

[0051] Please refer to Figure 2The following is a flowchart illustrating a data processing method according to an embodiment of this application. The method may include the following steps:

[0052] S202, in response to the business request of the target business, obtain the directed acyclic graph of the target business and the target service output parameters of the target business.

[0053] The directed acyclic graph corresponding to the target business includes the nodes corresponding to the target microservices and the directed edges between the nodes. The directed edges represent the dependencies between the connected nodes. The target microservices are the microservices in the service pool required to process the target business. It can be understood that the dependencies between different nodes are the dependencies between the target microservices corresponding to different nodes. For example, if node A depends on node B, then the target microservice corresponding to node A depends on the target microservice corresponding to node B.

[0054] Each service has corresponding requirement configuration information. The requirement configuration information for a target service refers to the pre-configured information reflecting the service requirements of that target service. Specifically, the requirement configuration information for a target service may include target service output parameters, which represent the parameters required to process the output of the target service. Optionally, the requirement configuration information for a target service may also include target service input parameters, which represent the parameters required to process the input of the target service.

[0055] For example, for risk control and anti-fraud services, the target service input parameters may include authorized historical credit data of the target entity, and the target service output parameters may include risk control results indicating whether fraudulent activities exist. Similarly, for product recommendation services, the target service input parameters may include authorized geographic location and historical consumption records of the user to be recommended, and the target service output parameters may include product-related information of the recommended products. Furthermore, for credit limit assessment services, the target service input parameters may include authorized credit data of the user to be assessed, and the target service output parameters may include the credit limit assessed for the user.

[0056] In this embodiment, the directed acyclic graph corresponding to the target service can be constructed in any appropriate way. The specific construction method can be selected according to actual needs, and this embodiment does not limit it. In an optional implementation, in order to quickly establish a directed acyclic graph that can accurately reflect the dependencies between target microservices, a directed acyclic graph corresponding to the target service can be constructed based on the requirement configuration information of the target service and the service configuration information of the microservices in the service pool. The service pool includes multiple pre-developed and configured microservices. Different microservices are used to implement different functions. The coordination and cooperation between different microservices can handle the corresponding business. The service configuration information of the microservices may include, but is not limited to, the metadata and access policies of the microservices. Specifically, the metadata of the microservices may include, but is not limited to, the service input parameters, service output parameters, call address, and call method of the microservices. The access policies of the microservices may include, but are not limited to, the call timeout, the number of retries, the preset initial values ​​of the service input parameters, the preset initial values ​​of the service output parameters, the circuit breaker policy, and the degradation policy.

[0057] Specifically, such as Figure 3 As shown, prior to S202 above, the data processing method of this application embodiment further includes a method for constructing a directed acyclic graph, which includes the following steps:

[0058] S302, based on the requirement configuration information of the target business and the service configuration information of the microservices in the service pool, determine the target microservices required to process the target business and the dependencies between the target microservices from the service pool.

[0059] Optionally, considering that the service output parameter of a target microservice is either the target service output parameter of the target business or the service input parameter of another target microservice, in order to ensure the accuracy of the dependency relationship between target microservices required to process the target business, the following process can be repeated until all target microservices required to process the target business are obtained: Based on the service output parameters of microservices in the service pool, the microservices in the service pool that have target service output parameters are identified as the target microservices required to process the target business; further, these target microservices are used as the second starting target microservices; if the service output parameter of a microservice in the service pool belongs to the service input parameter of the second starting target microservice, then this microservice is identified as the second endpoint target microservice on which the second starting target microservice depends; and this second endpoint target microservice is used as the new second starting target microservice.

[0060] It should be noted that in practical applications, there may be multiple microservices selected from the service pool to obtain the output parameters of the target service. In this case, all of these selected microservices can be identified as target microservices required to process the target business. For each target microservice, the target microservice can be used as the second starting target microservice. The second endpoint target microservice on which the target microservice depends can be obtained through the above operations.

[0061] For example, such as Figure 4 As shown, the target service output parameters of the target business include service output parameter L, microservice output parameter P, and service output parameter Q. The service output parameter of microservice Y is service output parameter L, and the service output parameters of microservice Z include service output parameter P and service output parameter Q. Therefore, microservice Y and microservice Z can be identified as the target microservices required to process the target business. Furthermore, microservice Y and microservice Z are respectively taken as the second starting target microservices. The service output parameter X of microservice X is found from the service pool. It is not only used for the service input parameter J of microservice Y, but also for the service input parameter O of microservice Z. Thus, it can be determined that microservice Y depends on microservice X, and microservice Z also depends on microservice Y. That is, the target microservices required to process the target business include microservice X, microservice Y, and microservice Z, where microservice Y depends on microservice X, and microservice Z depends on microservice Y.

[0062] Optionally, to quickly obtain the target microservices required for processing the target business and the dependencies between them, and to avoid the above process from getting stuck in an infinite loop and affecting subsequent business processing, before using the currently determined target microservice as the second starting target microservice, S302 may further include: determining that the service input parameters of the second starting target microservice are not target service input parameters before determining whether the service output parameters of each microservice in the service pool belong to the service input parameters of the second starting target microservice; if the service input parameters of the second starting target microservice belong to the target service input parameters, it indicates that the target microservices required for processing the target business have been obtained, and the subsequent operations such as determining whether the service output parameters of the microservices in the service pool belong to the service input parameters of the second starting target microservice are stopped.

[0063] For example, still using Figure 4 For example, after determining that microservice X, which both microservice Y and microservice Z depend on, if the service input parameter A of microservice X belongs to the target service input parameter of the target business, then the recursive query operation is stopped; otherwise, microservice X is used as the new second starting target microservice, and the above process is repeated until the service input parameter of the determined target microservice belongs to the target service input parameter of the target business.

[0064] Understandably, in the above solution, it is only necessary to pre-configure the target service output parameters of the target business, pre-configure the service output parameters and service input parameters of each microservice, and save the microservices to the service pool. Then, through recursive query, all target microservices that process the target business and the dependencies between these target microservices can be automatically obtained. This is simple, efficient, and requires no manual intervention, thereby eliminating errors introduced by manual intervention and saving labor costs.

[0065] S304. Based on the target microservices required to process the target business and the dependencies between the target microservices, construct the directed acyclic graph corresponding to the target business.

[0066] To clearly and intuitively reflect the dependencies between target microservices required to process the target business, so that these target microservices can be accurately invoked in sequence during business processing, the above S304 can be specifically implemented as follows: based on each target microservice required to process the target business, construct the node corresponding to the target microservice; based on the dependencies between target microservices, construct directed edges between the nodes corresponding to mutually dependent target microservices.

[0067] For example, the target microservices required to process the target business include microservices A, B, C, E, F, O, P, and Q. Microservice F depends on microservices E and Q; microservice E depends on microservices B and C; microservices B and C both depend on microservice A; microservice Q depends on microservices C and P; and microservice P depends on microservice Q. This implementation method can be used to construct a system as follows: Figure 5 The diagram shows a directed acyclic graph.

[0068] Understandably, by adding pre-developed and configured microservices to the service pool, each microservice becomes an independent unit that can be managed uniformly, enabling one-time access and multiple uses. This avoids repeated access to microservices and reduces the consumption of processing resources. When constructing the directed acyclic graph (DAG) corresponding to the target business, it is only necessary to pre-configure the target service output parameters and other service configuration information based on the business requirements of the target business. Based on the target business's configuration information and the service input and output parameters of the microservices in the service pool, the target microservices required to process the target business and the dependencies between them can be determined. Then, based on these dependencies, the DAG corresponding to the target business can be automatically constructed. This approach is not only simple and efficient, requiring no manual intervention, thus eliminating errors introduced by manual intervention and saving labor costs, but also ensures that the resulting DAG clearly and intuitively reflects the dependencies between the target microservices required to process the target business. This facilitates faster and more convenient microservice calls during subsequent business processing, thereby improving business processing efficiency.

[0069] In practical applications, after constructing the directed acyclic graph (DAG) corresponding to the target business, the DAG and requirement configuration information can be packaged into a business data file for the target business. This business data file is then placed on the business execution end, such as the business server used to execute the target business. When the business execution end receives a business request from the business party for the target business, it loads the business data file into memory and parses it to obtain the DAG and requirement configuration information corresponding to the target business. Of course, the service configuration information of the target microservices required to process the target business can also be packaged and integrated into the business data file. The business execution end can then parse this business data file to obtain the service configuration information of the target microservices needed to process the target business, allowing for better business processing by combining the service configuration information of the target microservices.

[0070] S204 optimizes directed acyclic graphs based on contextual information.

[0071] In this embodiment of the application, the context information includes the output parameter values ​​of the service output parameters of the microservices that have been invoked in the service pool.

[0072] Considering that the output parameters of the microservices already invoked in the service pool can be directly used by other microservices that depend on them, to avoid repeated invocation of the invoked microservices during business processing, thereby reducing scheduling resources and improving business processing efficiency, in one optional implementation, the directed acyclic graph corresponding to the target business can be optimized based on the output parameters of the invoked microservices in the context information. Specifically, S104 above can be implemented as follows: if the context information contains the output parameters of the target microservices corresponding to each node in the directed acyclic graph, then the other nodes that the node depends on are pruned to obtain the optimized directed acyclic graph.

[0073] For example, such as Figure 6 As shown, the query context information already contains the service output parameter values ​​of the target microservice corresponding to node E in the original directed acyclic graph, indicating that the target microservice corresponding to node E has been called. Therefore, nodes B and C, which node E directly depends on, as well as nodes A, which each of nodes B and C depends on (i.e., nodes that node E indirectly depends on), can be pruned to obtain the optimized directed acyclic graph shown on the right.

[0074] This application embodiment illustrates one specific implementation of S204 described above. It should be understood that S204 can also be implemented in other ways, and this application embodiment does not limit this implementation.

[0075] S206, based on the optimized directed acyclic graph, the target microservice is invoked to obtain the output parameter values ​​of the corresponding service output parameters of the target microservice, and the output parameter values ​​of the service output parameters of the target microservice are written into the context information.

[0076] After obtaining the optimized directed acyclic graph, the target microservices required to process the target business can be called sequentially based on the dependency relationships between the target microservices corresponding to the nodes indicated by the directed acyclic graph, and the output parameter values ​​of the service output parameters corresponding to each target microservice can be obtained.

[0077] By writing the output parameter values ​​of the target microservice that has been called into the context information, the output parameter values ​​of the target microservice can be reused by other businesses without having to call the target microservice repeatedly during data processing. This achieves multiple reuses from a single successful call, thereby greatly reducing the number of microservice calls, reducing the consumption of processing resources, and reducing the access cost of external data sources.

[0078] For example, such as Figure 7 As shown, in the processing of business 1, based on the directed acyclic network corresponding to business 1... Figure 1After making a microservice call, the output parameter values ​​of microservices A through F can be obtained and written into the context information. For business 2, since processing business 2 also requires microservice D, and the output parameter values ​​of microservice D already exist in the context information, it is not necessary to call microservice D again during the processing of business 2. Instead, only microservices O, P, and Q are called, and the obtained output parameter values ​​are written into the context information. For business 3, since processing business 3 also requires microservices D and Q, and the output parameter values ​​of microservices D and Q already exist in the context information, it is not necessary to call microservices D and O again during the processing of business 3. Instead, only microservices X, Y, and Z are called, and the obtained output parameter values ​​are written into the context information.

[0079] To accurately and efficiently invoke the target microservice, in one optional implementation, S106 can be specifically implemented as follows: Repeat the following process until the target microservice required for processing the target business is invoked: From the optimized directed acyclic graph, select a node whose in-degree satisfies the preset invocation condition as the first starting node, and select the nodes in the optimized directed acyclic graph that depend on the first starting node as the first ending node; Invoke the first starting target microservice, obtain the output parameter values ​​of the service output parameters of the first starting target microservice and write them into the context information, wherein the first starting target microservice is the target microservice corresponding to the first starting node; After successfully invoking the first starting target microservice, update the in-degree of the first ending node. In the directed acyclic graph, the in-degree of a node refers to the sum of the number of times the node is the endpoint of a directed edge. The preset scheduling condition can be set according to actual needs, for example, an in-degree of 0; this embodiment does not limit this.

[0080] For example, with Figure 6 Taking the optimized directed acyclic graph as an example, assuming the preset scheduling conditions include an in-degree of 0, node O can be used as the first starting node. The target microservice corresponding to node O is called to obtain the output parameter value of the target microservice and write the output parameter value into the context information. Then, the in-degree of node P, which depends on node O, is decremented by 1, and the in-degree of node P becomes 0. Similarly, node P is used as the new first starting node, and the above process is repeated until the target microservice corresponding to node F is called.

[0081] It is understandable that microservice calls are made based on the in-degree of each node in the directed acyclic graph. This way, after the target microservice call for each node is completed, the downstream target microservice to be called can be analyzed immediately. This can save the waiting time in the hierarchical calling scheme, maximize the utilization of processing resources, and help improve business processing efficiency.

[0082] In another optional implementation, considering that the process of calling the target microservice may encounter call exceptions, in order to minimize the impact of individual microservice call exceptions on the overall business processing efficiency, the above-mentioned S206 may further include: before updating the in-degree of the first endpoint node, if the call of the first starting target microservice fails, then obtain the type of the service input parameter of the first endpoint target microservice, wherein the type of the service input parameter includes necessary service input parameters and unnecessary service input parameters, and the first endpoint target microservice is the target microservice corresponding to the first endpoint node; based on the type of the service input parameter of the first endpoint target microservice, determine whether the service output parameter of the first starting target microservice is a necessary service input parameter of the first endpoint target microservice; if so, then stop updating the in-degree of the first endpoint node; correspondingly, if the service output parameter of the first starting target microservice is not a necessary service input parameter of the first endpoint target microservice, then continue the subsequent operations.

[0083] It should be noted that in practical applications, there may be multiple first endpoint nodes that depend on the first starting node. In this case, after the first starting target microservice is called, the in-degree of each first endpoint node can be updated separately.

[0084] For example, such as Figure 8 As shown, in the event of an abnormal call to the target microservice corresponding to node C (hereinafter referred to as target microservice C), if the service output parameter of target microservice C is a necessary service input parameter of the target microservice corresponding to node E (hereinafter referred to as target microservice E), then the in-degree of node E is stopped from being updated to stop calling target microservice E. Since the service output parameter of target microservice E is a necessary service input parameter of the target microservice corresponding to node F (hereinafter referred to as target microservice F), target microservice F cannot be called if target microservice E cannot be called. If the service output parameter of target microservice C is a non-necessary service input parameter of the target microservice corresponding to node Q (hereinafter referred to as target microservice Q), then the in-degree of node Q is updated so that subsequent calls to target microservice Q can be executed normally.

[0085] Understandably, some service output parameters of target microservices are not essential input parameters for downstream target microservices. For example, the service output parameters of internal microservices may only improve the accuracy of the service output parameters of downstream external microservices, but they do not play a decisive role in the final business processing result. If the current approach of repeatedly attempting to call is used when such target microservices experience service failures, it will slow down the overall business processing speed, resulting in more harm than good. In view of this, in the above implementation, when calling target microservices based on the optimized directed acyclic graph, the decision to continue calling the downstream target microservice is made based on whether the service output parameters of the target microservice that is currently experiencing a call failure are essential input parameters for the downstream target microservice. Compared with the current approach of repeatedly attempting to call, this approach can minimize the impact of individual microservice call failures on the overall business processing efficiency.

[0086] In another preferred implementation, to avoid impacting the entire business process by calling microservices that frequently experience abnormal calls, during the process of calling the target microservice, circuit breaking can be performed on the target microservice that frequently experiences abnormal calls according to the circuit breaking policy configured in advance. The circuit breaking policy may include preset circuit breaking conditions and corresponding circuit breaking operations.

[0087] Specifically, S206 may further include: obtaining the historical call records of the first initial target microservice before calling it; if the historical call records of the first initial target microservice meet the preset circuit breaker conditions, then pausing the call to the first initial target microservice. The preset circuit breaker conditions can be set according to actual needs. Different target microservices may correspond to the same preset circuit breaker conditions, or different target microservices may correspond to different preset circuit breaker conditions. This embodiment does not limit this.

[0088] For example, the historical call records of a microservice may include the number of historical calls to the microservice and the execution result of each call. The preset circuit breaker condition may include the percentage of abnormal calls in the historical call count exceeding a preset percentage threshold. If, based on the historical call records of the first starting target microservice, it is determined that the percentage of abnormal calls to the first starting target microservice in the historical call count exceeds the preset percentage threshold, then calls to the first starting target microservice can be suspended until the first starting target microservice recovers to a level where the preset circuit breaker condition is no longer met, at which point calls to the first starting target microservice can be restarted.

[0089] In another preferred implementation, to avoid impacting the entire business process by calling microservices that frequently experience abnormal calls, the target microservice can be downgraded according to a pre-configured degradation strategy. The degradation strategy can include preset degradation conditions and corresponding degradation operations.

[0090] Specifically, S206 may further include: before invoking the first initial target microservice, obtaining the historical call records of the first initial target microservice; if the historical call records of the first initial target microservice meet preset degradation conditions, then based on the degradation strategy corresponding to the first initial target microservice, pausing the invocation of the first initial target microservice and executing the invocation degradation processing corresponding to the first initial target microservice. The invocation degradation processing includes at least one of the following: invoking a backup microservice in the service pool corresponding to the first initial target microservice, and using the preset initial output parameter value of the service output parameter of the first initial target microservice as the input parameter value of the service input parameter of the first endpoint target microservice, wherein the first endpoint target microservice is the target microservice corresponding to the aforementioned first endpoint node.

[0091] For example, the historical call records of a microservice may include the number of historical calls to the microservice, the execution result of each call, etc., and the preset degradation conditions may include the proportion of abnormal calls in the historical call count exceeding a preset percentage threshold. If, based on the historical call records of the first starting target microservice, it is determined that the proportion of abnormal calls to the first starting target microservice in the historical call count exceeds the preset percentage threshold, then the call to the first starting target microservice can be suspended, and the call can be switched to the backup microservice corresponding to the first starting target microservice in the service pool, until the first starting target microservice recovers to the point where the preset degradation conditions are no longer met, and then the call can be switched back to the first starting target microservice. Furthermore, if the first starting target microservice is not configured with a corresponding backup microservice, then the preset initial output parameter value of the service output parameter of the first starting target microservice is directly used as the service input parameter of the first endpoint target microservice.

[0092] Of course, in other optional implementations, to avoid affecting the entire data processing process by calling microservices that frequently experience abnormal calls, access strategies such as timeout, retry count, preset initial output parameter values ​​for service output parameters, and preset initial output parameter values ​​for service input parameters can be configured for each target microservice. During the process of calling the target microservice, the target microservice that frequently experiences abnormal calls can also be processed according to the above access strategies configured for the target microservice. The degradation strategy can include preset processing conditions and corresponding processing operations.

[0093] For example, if the call time of the first starting target microservice exceeds the timeout time of the first starting target microservice, the first starting target microservice can be downgraded according to the above-mentioned downgrade strategy; if the downgrade fails, the preset initial output parameter value of the service output parameter of the first starting target microservice is directly used as the input parameter value of the service input parameter of the first ending target microservice; if no preset initial output parameter value of the service output parameter of the first starting target microservice is configured, the preset initial input parameter value of the service input parameter of the first ending target microservice is directly used when calling the first ending target microservice.

[0094] For example, considering that some microservices may recover after retrying due to network jitter, if the first target microservice call fails, the first target microservice will be called again until the retry limit for the first target microservice is reached.

[0095] This application embodiment illustrates one specific implementation of S206 described above. It should be understood that S206 can also be implemented in other ways, and this application embodiment does not limit this implementation.

[0096] S208 returns the response data corresponding to the business request based on context information and the target service parameters of the target business.

[0097] Specifically, based on the target service output parameters of the target business, the output parameter values ​​of the target service can be found from the context information, and the found output parameter values ​​can be assembled into the final response data and returned to the business party.

[0098] The data processing method provided in this application represents the target microservices required for processing the target business and the dependencies between these target microservices in the form of a directed acyclic graph (DAG). Each node in the DAG corresponds to a target microservice, and the directed edges between nodes represent the dependencies between the target microservices, effectively treating each target microservice as an independent unit. Based on the DAG, the method calls the target microservices required for processing the target business. This allows for immediate analysis of the downstream target microservices to be called after each target microservice is called, thereby eliminating the waiting time in hierarchical calling schemes and maximizing processing efficiency. Optimizing resource allocation helps improve business processing efficiency. Furthermore, by writing the service output parameters of already invoked microservices in the service pool into the context information, and before invoking the target microservice required by the target business based on the directed acyclic graph (DAG), the DAG is optimized based on the service output parameters of already invoked microservices in the context information. The business request is then responded to based on the context information and the target service output parameters of the target business. This avoids the repeated invocation of target microservices that have already been invoked and whose service output parameters have been obtained, thereby reducing the number of calls to the target microservice, reducing the consumption of processing resources, and also improving data processing efficiency.

[0099] In a practical application scenario, the data processing method provided in this application embodiment allows developers to configure information reflecting the business requirements of the target business based on the business needs of the target business. This information may include, but is not limited to, the target service output parameters and target service input parameters of the target business. After setting the development and service configuration information for microservices, the microservices are stored in a service pool for subsequent use, thus completing the microservice integration. Next, the administrator constructs a directed acyclic graph (DAG) corresponding to the target business based on the target business's requirement configuration information and the service configuration information of the microservices in the service pool, and publishes it to the business server. The business server then responds to business requests for the target business based on the DAG corresponding to the target business. The data processing method provided in this application embodiment will be described below in conjunction with this practical application scenario. Figure 9 As shown, this application scenario includes a client, a management server, a business server, and a service pool.

[0100] The client application can display a user interface for developers to integrate microservices. For example... Figure 10As shown, developers can create microservices capable of handling different functions and configure corresponding service information for each microservice. This service configuration information may include, but is not limited to, microservice metadata and access policies. Specifically, microservice metadata may include, but is not limited to, service input parameters, service output parameters, call address, and call method. Access policies may include, but are not limited to, call timeout, retries, preset initial input parameter values, preset initial output parameter values, circuit breaker policies, and degradation policies. Developers can then store each microservice and its configuration information in a service pool via a client for later use, thus completing service integration.

[0101] It should be noted that in practical applications, microservices in the service pool can be categorized into internal microservices, external microservices, variable microservices, and model microservices, depending on the data source. They can also be categorized into HTTP microservices, RPC microservices, MySQL microservices, and Hbbase microservices, depending on the data access method. Considering the specific characteristics of some data access methods, the service configuration information for microservices can also include special processing and parameter conversion strategies for each microservice. For example, calls to external microservices may require corresponding authentication key settings, or the service output parameters of external microservices may be converted from the "A,B,C" format to a list format [A,B,C].

[0102] like Figure 10 As shown, during service orchestration, business users can provide the management server with the target service's requirement configuration information through the client. This requirement configuration information may include, but is not limited to, the target service's input parameters and output parameters. Based on the target service's requirement configuration information and the service configuration information of the microservices in the service pool, the management server can determine the target microservices required to process the target service and the dependencies between them. Based on these requirements and dependencies, it constructs a directed acyclic graph (DAG) corresponding to the target service. Then, the pipeline server packages the DAG, requirement configuration information, and service configuration information of the target microservices together to generate the target service's business data file and sends it to the business server, thus completing the microservice orchestration. Furthermore, the management server can send the target service's DAG to the client for display to developers. This allows developers to perform data analysis, business operation and maintenance, and call modifications based on the visualized DAG, with each modification traceable and the lineage between different microservices clearly visible.

[0103] like Figure 10As shown, when a target business operation needs to be executed, the business party can send a business request for the target business to the business server through the client. The business server responds to this request by loading the target business data file into memory and parsing it to obtain the directed acyclic graph (DAG) and requirement configuration information of the target business. It can also parse the service configuration information of the target microservice required to process the target business. Further, the business server optimizes the DAG based on the output parameter values ​​of the called microservices recorded in the context information. Then, based on the optimized DAG, it calls the target microservice to obtain the output parameter values ​​of the corresponding service parameters and writes these values ​​into the context information. Finally, based on the context information and the target service output parameters of the target business, it returns the response data corresponding to the business request to the business party. This completes the microservice call and the processing of the target business.

[0104] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0105] In addition, with the above Figure 2 Corresponding to the data processing method shown, this application also provides a data processing apparatus. Figure 11 A schematic diagram of the structure of a data processing apparatus 1100 provided for one embodiment of this application is provided. The apparatus includes:

[0106] The first acquisition module 1110 is used to acquire the directed acyclic graph of the target service and the target service output parameters of the target service in response to the service request of the target service.

[0107] Optimization module 1120 is used to optimize the directed acyclic graph based on context information, wherein the context information includes the output parameter values ​​of the service output parameters of the microservices that have been called in the service pool.

[0108] The module 1130 is used to call the target microservice based on the optimized directed acyclic graph, obtain the output parameter value of the service output parameter corresponding to the target microservice, and write the output parameter value of the service output parameter corresponding to the target microservice into the context information.

[0109] Response module 1140 is used to return response data corresponding to the business request to the business party based on the context information and the target service output parameters;

[0110] The directed acyclic graph includes the nodes corresponding to the target microservice and the directed edges between the nodes. The directed edges represent the dependencies between the connected nodes. The target microservice is the microservice in the service pool required to process the target business.

[0111] The data processing apparatus provided in this application represents the target microservices required for processing the target business and the dependencies between these target microservices in the form of a directed acyclic graph (DAG). Each node in the DAG corresponds to a target microservice, and the directed edges between nodes represent the dependencies between the target microservices, effectively treating each target microservice as an independent unit. By invoking the target microservices required for processing the target business based on the DAG, the downstream target microservices to be invoked can be immediately analyzed after each target microservice is invoked. This eliminates the waiting time in hierarchical invocation schemes and maximizes the utilization of processing power. Optimizing resource allocation helps improve business processing efficiency. Furthermore, by writing the service output parameters of already invoked microservices in the service pool into the context information, and before invoking the target microservice required by the target business based on the directed acyclic graph (DAG), the DAG is optimized based on the service output parameters of already invoked microservices in the context information. The business request is then responded to based on the context information and the target service output parameters of the target business. This avoids the repeated invocation of target microservices that have already been invoked and whose service output parameters have been obtained, thereby reducing the number of calls to the target microservice, reducing the consumption of processing resources, and also improving data processing efficiency.

[0112] Optionally, the optimization module includes:

[0113] The optimization submodule is used to determine if the context information contains service output parameter values ​​for the target microservice corresponding to each node in the directed acyclic graph.

[0114] Then, the other nodes that the node depends on are pruned to obtain the optimized directed acyclic graph.

[0115] Optionally, the calling module is specifically used for:

[0116] Repeat the following process until all target microservice calls required to process the target business are completed:

[0117] From the optimized directed acyclic graph, select the node whose in-degree satisfies the preset calling condition as the first starting node, and select the node in the optimized directed acyclic graph that depends on the first starting node as the first ending node.

[0118] Invoke the first starting target microservice and obtain the output parameter values ​​of the service output parameters of the first starting target microservice, wherein the first starting target microservice is the target microservice corresponding to the first starting node;

[0119] After successfully invoking the first starting target microservice, update the in-degree of the first endpoint node.

[0120] Optionally, the calling module is further configured to:

[0121] Before updating the in-degree of the first endpoint node, if the first starting target microservice call fails, the type of the service input parameter of the first endpoint target microservice is obtained. The type of the service input parameter includes necessary service input parameters and unnecessary service input parameters. The first endpoint target microservice is the target microservice corresponding to the first endpoint node.

[0122] Based on the type of the service input parameters of the first endpoint target microservice, determine whether the service output parameters of the first starting target microservice are necessary service input parameters of the first endpoint target microservice.

[0123] If the service output parameter of the first starting target microservice is a necessary service input parameter of the first ending target microservice, then stop updating the in-degree of the first ending node.

[0124] Optionally, the calling module is further configured to:

[0125] Before invoking the first initial target microservice, obtain the historical call records of the first initial target microservice;

[0126] If the historical call record meets the preset circuit breaker conditions, then the call to the first initial target microservice will be suspended.

[0127] Optionally, the calling module is further configured to:

[0128] Before invoking the first initial target microservice, obtain the historical call records of the first initial target microservice;

[0129] If the historical call record meets the preset degradation conditions, then based on the degradation strategy corresponding to the first starting target microservice, the call to the first starting target microservice is suspended, and the call degradation processing corresponding to the first starting target microservice is executed. The call degradation processing includes at least one of the following processes: calling the backup microservice in the service pool corresponding to the first starting target microservice, and using the preset initial output parameter value of the service output parameter of the first starting target microservice as the input parameter value of the service input parameter of the first endpoint target microservice, wherein the first endpoint target microservice is the target microservice corresponding to the first endpoint node.

[0130] Optionally, the device further includes:

[0131] The first determining module is used to determine, before the first obtaining module responds to the business request of the target business and obtains the directed acyclic graph corresponding to the target business and the target service output parameters of the target business, the target microservices required to process the target business and the dependencies between the target microservices from the service pool based on the requirement configuration information of the target business and the service configuration information of the microservices in the service pool.

[0132] The construction module is used to construct the target microservices required by the target business and the dependencies, and to construct the directed acyclic graph corresponding to the target business;

[0133] The requirement configuration information includes the target service output parameters of the target business, the service configuration information of the microservice includes the service input parameters and service output parameters of the microservice, and the dependency relationship is the dependency relationship between the target microservices.

[0134] Optionally, the first determining module is specifically used for:

[0135] Repeat the following process until the target microservices required to process the target business have been obtained:

[0136] Based on the service output parameters of the microservices in the service pool, the microservices in the service pool that have the target service output parameters are identified as the target microservices required to process the target business.

[0137] Use the currently identified target microservice as the second starting target microservice;

[0138] If the service output parameter of a microservice in the service pool belongs to the service input parameter of the second starting target microservice, then the microservice is determined as the second endpoint target microservice on which the second starting target microservice depends; and the second endpoint target microservice is used as the new second starting target microservice.

[0139] Optionally, the requirement configuration information further includes the target service input parameters of the target service, and the first determining module is further configured to:

[0140] Before using the currently determined target microservice as the second starting target microservice, it is determined that the service input parameters of the second starting target microservice do not belong to the target service input parameters.

[0141] Optionally, the construction submodule constructs a directed acyclic graph corresponding to the target business based on the target microservices required to implement the target business and the dependencies between the target microservices, including:

[0142] Based on the target microservices required to process the target business, construct the nodes corresponding to the target microservices;

[0143] Based on the aforementioned dependency relationship, directed edges are constructed between nodes corresponding to mutually dependent target microservices.

[0144] Obviously, the data processing apparatus in this application embodiment can be used as described above. Figure 2 The data processing method shown is the execution entity, thus enabling the data processing method to perform... Figure 2 The functions implemented are the same, so they will not be explained again here.

[0145] Figure 12 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. Please refer to it. Figure 12 At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and memory. The memory may include main memory, such as high-speed random-access memory (RAM), or non-volatile memory, such as at least one disk drive. Of course, the electronic device may also include other hardware required for other business operations.

[0146] The processor, network interface, and memory can be interconnected via an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. This bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 12 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.

[0147] Memory is used to store programs. Specifically, programs may include program code, which includes computer operation instructions. Memory may include main memory and non-volatile memory, and provides instructions and data to the processor.

[0148] The processor reads the corresponding computer program from non-volatile memory into main memory and then runs it, forming a data processing device at the logical level. The processor executes the program stored in memory and specifically performs the following operations:

[0149] In response to a business request from a target business, obtain the directed acyclic graph of the target business and the target service output parameters of the target business;

[0150] The directed acyclic graph is optimized based on context information, which includes the output parameter values ​​of the microservices that have been invoked in the service pool.

[0151] The target microservice is invoked based on the optimized directed acyclic graph to obtain the service output parameter result corresponding to the target microservice, and the output parameter value of the service output parameter is written into the context information.

[0152] Based on the context information and the output parameters of the target service, return the response data corresponding to the business request;

[0153] The directed acyclic graph includes the nodes corresponding to the target microservice and the directed edges between the nodes. The directed edges represent the dependencies between the connected nodes. The target microservice is the microservice in the service pool required to process the target business.

[0154] The above is as stated in this application. Figure 2The methods executed by the data processing apparatus disclosed in the illustrated embodiments can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.

[0155] The electronic device can also perform Figure 2 The method, and implement the data processing device in Figure 2 The functions of the embodiments shown are not described in detail here.

[0156] Of course, in addition to software implementation, the electronic device of this application does not exclude other implementation methods, such as logic devices or a combination of hardware and software, etc. In other words, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0157] This application also proposes a computer-readable storage medium that stores one or more programs, the programs including instructions that, when executed by a portable electronic device including multiple applications, enable the portable electronic device to perform... Figure 2 The method of the illustrated embodiment is specifically used to perform the following operations:

[0158] In response to a business request from a target business, obtain the directed acyclic graph of the target business and the target service output parameters of the target business;

[0159] The directed acyclic graph is optimized based on context information, which includes the output parameter values ​​of the microservices that have been invoked in the service pool.

[0160] The target microservice is invoked based on the optimized directed acyclic graph to obtain the service output parameter result corresponding to the target microservice, and the output parameter value of the service output parameter is written into the context information.

[0161] Based on the context information and the output parameters of the target service, return the response data corresponding to the business request;

[0162] The directed acyclic graph includes the nodes corresponding to the target microservice and the directed edges between the nodes. The directed edges represent the dependencies between the connected nodes. The target microservice is the microservice in the service pool required to process the target business.

[0163] In summary, the above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.

[0164] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, a computer can be, for example, a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.

[0165] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0166] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0167] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.

Claims

1. A data processing method, characterized in that, include: In response to a business request from a target business, obtain the directed acyclic graph of the target business and the target service output parameters of the target business; The directed acyclic graph is optimized based on context information, which includes the output parameter values ​​of the microservices that have been invoked in the service pool. The target microservice is invoked based on the optimized directed acyclic graph to obtain the output parameter values ​​of the service output parameters corresponding to the target microservice, and the output parameter values ​​of the service output parameters are written into the context information. Based on the context information and the output parameters of the target service, return the response data corresponding to the business request; The directed acyclic graph includes the nodes corresponding to the target microservice and the directed edges between the nodes. The directed edges represent the dependencies between the connected nodes. The target microservice is the microservice in the service pool required to process the target business.

2. The method according to claim 1, characterized in that, The optimization of the directed acyclic graph based on context information includes: If the context information contains the service output parameter values ​​of the target microservice corresponding to each node in the directed acyclic graph, Then, the other nodes that the node depends on are pruned to obtain the optimized directed acyclic graph.

3. The method according to claim 1, characterized in that, The process of invoking the target microservice based on the optimized directed acyclic graph to obtain the output parameter values ​​of the service output parameters corresponding to the target microservice includes: Repeat the following process until all target microservice calls required to process the target business are completed: From the optimized directed acyclic graph, select the node whose in-degree satisfies the preset calling condition as the first starting node, and select the node in the optimized directed acyclic graph that depends on the first starting node as the first ending node. Invoke the first starting target microservice and obtain the output parameter values ​​of the service output parameters of the first starting target microservice, wherein the first starting target microservice is the target microservice corresponding to the first starting node; After successfully invoking the first starting target microservice, update the in-degree of the first endpoint node.

4. The method according to claim 3, characterized in that, The step of invoking the target microservice based on the optimized directed acyclic graph to obtain the output parameter values ​​of the service output parameters corresponding to the target microservice also includes: Before updating the in-degree of the first endpoint node, if the first starting target microservice call is abnormal, the type of the service input parameter of the first endpoint target microservice is obtained, wherein the type of the service input parameter includes necessary service input parameters and unnecessary service input parameters, and the first endpoint target microservice is the target microservice corresponding to the first endpoint node. Based on the type of the service input parameters of the first endpoint target microservice, determine whether the service output parameters of the first starting target microservice are necessary service input parameters of the first endpoint target microservice. If so, then stop updating the in-degree of the first endpoint node.

5. The method according to claim 3, characterized in that, The step of invoking the target microservice based on the optimized directed acyclic graph to obtain the output parameter values ​​of the service output parameters corresponding to the target microservice also includes: Before invoking the first initial target microservice, obtain the historical call records of the first initial target microservice; If the historical call record meets the preset circuit breaker conditions, then the call to the first initial target microservice will be suspended.

6. The method according to claim 3, characterized in that, The step of invoking the target microservice based on the optimized directed acyclic graph to obtain the output parameter values ​​of the service output parameters corresponding to the target microservice also includes: Before invoking the first initial target microservice, obtain the historical call records of the first initial target microservice; If the historical call record meets the preset degradation conditions, then based on the degradation strategy corresponding to the first starting target microservice, the call to the first starting target microservice is suspended, and the call degradation processing corresponding to the first starting target microservice is executed. The call degradation processing includes at least one of the following processes: calling the backup microservice in the service pool corresponding to the first starting target microservice, and using the preset initial output parameter value of the service output parameter of the first starting target microservice as the input parameter value of the service input parameter of the first endpoint target microservice, wherein the first endpoint target microservice is the target microservice corresponding to the first endpoint node.

7. The method according to claim 1, characterized in that, Before obtaining the directed acyclic graph corresponding to the target service and the target service output parameters in response to the service request of the target service, the method further includes: Based on the requirement configuration information of the target business and the service configuration information of the microservices in the service pool, the target microservices required to process the target business and the dependencies between the target microservices are determined from the service pool. Based on the target microservice and the dependency relationship, construct a directed acyclic graph corresponding to the target business; The requirement configuration information includes the target service output parameters of the target business, the service configuration information of the microservice includes the service input parameters and service output parameters of the microservice, and the dependency relationship is the dependency relationship between the target microservices.

8. The method according to claim 7, characterized in that, The step of determining the target microservices required to process the target business and the dependencies between the target microservices from the service pool, based on the requirement configuration information of the target business and the service configuration information of the microservices in the service pool, includes: Repeat the following process until the target microservices required to process the target business have been obtained: Based on the service output parameters of the microservices in the service pool, the microservices in the service pool that have the target service output parameters are identified as the target microservices required to process the target business. Use the currently identified target microservice as the second starting target microservice; If the service output parameter of a microservice in the service pool belongs to the service input parameter of the second starting target microservice, then the microservice is determined as the second endpoint target microservice on which the second starting target microservice depends. The second endpoint target microservice is used as the new second starting target microservice.

9. The method according to claim 8, characterized in that, The requirement configuration information also includes the target service input parameters of the target business. Before using the currently determined target microservice as the second starting target microservice, the method further includes: It is determined that the service input parameters of the second initial target microservice do not belong to the target service input parameters.

10. The method according to claim 7, characterized in that, The step of constructing a directed acyclic graph corresponding to the target business based on the target microservice and the dependencies includes: Based on the target microservices required to process the target business, construct the nodes corresponding to the target microservices; Based on the aforementioned dependency relationship, directed edges are constructed between nodes corresponding to mutually dependent target microservices.

11. A data processing apparatus, characterized in that, include: The first acquisition module is used to acquire the directed acyclic graph of the target business and the target service output parameters of the target business in response to the business request of the target business. The optimization module is used to optimize the directed acyclic graph based on context information, which includes the output parameter values ​​of the microservices that have been invoked in the service pool. The calling module is used to call the target microservice based on the optimized directed acyclic graph, obtain the output parameter value of the service output parameter corresponding to the target microservice, and write the output parameter value of the service output parameter corresponding to the target microservice into the context information. The response module is used to return response data corresponding to the business request based on the context information and the output parameters of the target service; The directed acyclic graph includes the nodes corresponding to the target microservice and the directed edges between the nodes. The directed edges represent the dependencies between the connected nodes. The target microservice is the microservice in the service pool required to process the target business.

12. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the method as described in any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that, When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device is able to perform the method as described in any one of claims 1 to 10.