Request message processing method and apparatus, computer device, and readable storage medium
By using a knowledge graph model to process request messages, the problem of needing to write complex orchestration functions at the terminal is solved, and efficient and accurate request message processing is achieved.
Patent Information
- Application Number
- CN202211213953.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-30
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2042-09-30
AI Technical Summary
In existing technologies, when a terminal processes request messages with a large number of dependencies, it needs to pre-write a large number of complex orchestration functions, which results in poor reusability of the orchestration functions and reduces the efficiency of request message processing.
By using a knowledge graph model, the model path of the request message is obtained, and the request message is processed through the model path. The nodes and functions on the model path are used to calculate the results, reducing the dependence on complex orchestration functions.
It achieves reusability based on the knowledge graph model, improves the efficiency of request message processing, and ensures the accuracy and efficiency of the calculation results.
Smart Images

Figure CN115480941B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a request message processing method, apparatus, computer device, and readable storage medium. Background Technology
[0002] In the financial sector, there are many scenarios involving statistical analysis and regulatory data reporting, which require the rapid calculation of a large number of indicators. Furthermore, there are various complex dependencies between these indicators, with each subsequent calculation often depending on the results of the preceding steps.
[0003] However, the inventors discovered that when current terminals process request messages with a large number of dependencies, they need to write a large number of complex orchestration functions in advance as operation rules. This not only leads to poor reusability of the orchestration functions, but also greatly reduces the efficiency of request message processing. Summary of the Invention
[0004] The request message processing method, apparatus, computer device, and readable storage medium provided in this application are intended to solve the problem that when a current terminal performs operations on request messages with a large number of dependencies, it is necessary to pre-write a large number of complex orchestration functions as operation rules, which not only leads to poor reusability of orchestration functions but also greatly reduces the efficiency of request message operation and processing.
[0005] Firstly, this application provides a request message processing method, including:
[0006] The system receives a request message sent by a terminal and obtains the model path corresponding to the request message from a preset knowledge graph model. The knowledge graph model is a graph model with at least one model path, and at least one model node with operation rules is set on the model path.
[0007] The request message is processed through the model path to obtain the result, and the result is returned to the terminal.
[0008] In the above scheme, obtaining the model path corresponding to the request message from the preset knowledge graph model includes:
[0009] Extract the demand information from the request message, and obtain the orchestration index corresponding to the demand information from the knowledge graph model;
[0010] Extract the request parameters from the request message, and obtain the basic indicators corresponding to the request parameters from the knowledge graph model;
[0011] The connection from the base node of the base indicator corresponding to the request parameter to the orchestration node of the orchestration indicator corresponding to the demand information is set as the model path corresponding to the request message.
[0012] In the above scheme, the step of performing calculations on the request message through the model path and obtaining the calculation result includes:
[0013] If it is determined that there are no intermediate nodes on the model path, the request parameters in the request message are entered into the basic node located on the model path as the basic index of the basic node; the orchestration function in the orchestration node on the model path is called to calculate the basic index, and the orchestration index of the orchestration node is obtained. The obtained orchestration index is used as the calculation result.
[0014] If it is determined that there are intermediate nodes on the model path, then the basic nodes, intermediate nodes and orchestration nodes are sorted according to the priority of the basic nodes, the priority of the intermediate nodes and the priority of the orchestration nodes on the model path to obtain the running order;
[0015] The request parameters in the request message are entered into the base node located at the first position in the running order, as the base index of the base node;
[0016] The intermediate functions in the intermediate nodes on the model path are called sequentially according to the running order to calculate the basic index of the basic node located before the called intermediate node and / or the intermediate index of the intermediate node, so as to obtain the intermediate index of the called intermediate node.
[0017] Call the orchestration function in the orchestration node located at the end of the running sequence to calculate the basic index in the basic node and / or the intermediate index in the intermediate node connected to the orchestration node on the model path, obtain the orchestration index of the orchestration node, and use the obtained orchestration index as the calculation result.
[0018] In the above scheme, before the request message sent by the receiving terminal, the method further includes:
[0019] Obtain at least one basic indicator and at least one arrangement rule, obtain the basic indicator corresponding to the independent variable data in the arrangement rule, arrange the basic indicator corresponding to the independent variable data to obtain an arrangement function, and the arrangement function is used to be calculated to obtain the arrangement indicator in the arrangement rule.
[0020] The priority of the orchestration index is determined according to the priority of the basic index in the orchestration function, and the basic nodes corresponding to the basic index and the orchestration nodes corresponding to the orchestration index are constructed. According to the priority of the basic index and the priority of the orchestration index, a knowledge graph model containing the basic nodes and the orchestration nodes, as well as the model path connecting the basic nodes and the orchestration nodes, is created, wherein the orchestration function is recorded in the orchestration node.
[0021] In the above scheme, the step of arranging the basic indicators corresponding to the independent variable data to obtain the arrangement function includes:
[0022] If it is determined that there are no intermediate indicators in the arrangement rules, then the arrangement indicators in the arrangement rules are extracted, and the arrangement indicators are used as the dependent variable to arrange the basic indicators corresponding to the independent variable data to obtain the arrangement function.
[0023] If it is determined that the arrangement rule contains an intermediate indicator, then the intermediate independent variable data corresponding to the intermediate indicator is obtained from the basic indicators corresponding to the independent variable data, and the intermediate independent variable data is arranged to obtain an intermediate function, which is used to calculate the intermediate indicator; and
[0024] The arrangement function is obtained by arranging the intermediate function, or by arranging the basic indicators corresponding to the independent variable data and the intermediate function.
[0025] In the above scheme, the step of determining the priority of the orchestration indicators based on the priority of the basic indicators in the orchestration function further includes:
[0026] If it is determined that the orchestration function corresponding to the orchestration index does not have an intermediate function, then the priority of the orchestration index is constructed according to the priority of the basic index in the orchestration function, wherein the priority of the orchestration index is lower than the priority of the basic index.
[0027] If it is determined that there is an intermediate function in the orchestration function corresponding to the orchestration index, then the priority of the intermediate index is constructed according to the priority of the basic index in the intermediate function, wherein the priority of the intermediate index is lower than the priority of the basic index in the intermediate function.
[0028] If it is determined that the orchestration function contains only intermediate functions, then the priority of the orchestration index is constructed according to the priority of the intermediate index, wherein the priority of the orchestration index is lower than the priority of the intermediate index.
[0029] If it is determined that the orchestration function contains intermediate functions and basic data, then the priority of the orchestration indicator is constructed according to the priority of the intermediate indicator and the priority of the basic indicator corresponding to the independent variable data, wherein the priority of the orchestration indicator is lower than the priority of the intermediate indicator and lower than the priority of the basic indicator corresponding to the independent variable data.
[0030] In the above scheme, the step of creating a knowledge graph model that includes the basic nodes and the orchestration nodes, as well as model paths connecting the basic nodes and the orchestration nodes, based on the priority of the basic indicators and the priority of the orchestration indicators, includes:
[0031] If it is determined that there is no intermediate function in the orchestration function, the priority of the basic indicator is entered into the basic node, and the priority of the orchestration indicator is entered into the orchestration node. A connection is made between the basic node and the orchestration node to obtain a model path representing the path from the basic indicator to the orchestration indicator.
[0032] If it is determined that there is an intermediate function in the orchestration function, then an intermediate node corresponding to the intermediate function is constructed, the priority of the intermediate index corresponding to the intermediate function is obtained, and the basic node corresponding to the basic index in the intermediate function is identified, wherein the intermediate node records the intermediate function.
[0033] The priority of the intermediate indicator is entered in the intermediate node, and the priority of the basic indicator is entered in the basic node corresponding to the basic indicator in the intermediate function. A first side is obtained by connecting the intermediate node and the basic node. The priority of the orchestration indicator is entered in the orchestration node, and a second side is obtained by connecting the orchestration node and the intermediate node.
[0034] If it is determined that the orchestration function contains only intermediate functions, then the first edge and the second edge are integrated to obtain a model path representing the path from the basic index to the orchestration index;
[0035] If it is determined that the orchestration function has intermediate functions and basic indicators, then a third edge is obtained by connecting the basic node corresponding to the basic indicator in the orchestration function to the orchestration node. The first edge, the second edge and the third edge are integrated to obtain the model path representing the path from the basic indicator to the orchestration indicator.
[0036] Secondly, this application provides a request message processing apparatus, comprising:
[0037] The path recognition module is used to receive a request message sent by the terminal and obtain the model path corresponding to the request message from a preset knowledge graph model. The knowledge graph model is a graph model with at least one model path and at least one model node with operation rules is set on the model path.
[0038] The request calculation module is used to perform calculations on the request message through the model path and obtain the calculation result, and return the calculation result to the terminal.
[0039] Thirdly, this application provides a computer device, including: a processor and a memory communicatively connected to the processor;
[0040] The memory stores computer-executed instructions;
[0041] The processor executes the computer execution instructions stored in the memory to implement the above-described request message processing method.
[0042] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the above-described request message processing method.
[0043] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the above-described request message processing method.
[0044] The request message processing method, apparatus, computer device, and readable storage medium provided in this application can calculate the request message sent by the terminal and obtain the corresponding calculation result through the model path in the knowledge graph model. This achieves the technical effect of reusability based on the knowledge graph model, fast calculation of a large number of request messages and accurate acquisition of the corresponding calculation result, and improves the efficiency of request message processing. Attached Figure Description
[0045] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0046] Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of this application;
[0047] Figure 2 A flowchart of Embodiment 1 of a request message processing method provided in this application;
[0048] Figure 3 A flowchart of Embodiment 2 of a request message processing method provided in this application;
[0049] Figure 4 This is a schematic diagram of a program module for a request message processing device provided by the present invention;
[0050] Figure 5 This is a schematic diagram of the hardware structure of the computer device in the computer device of the present invention.
[0051] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0052] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0053] Please see Figure 1 The specific application scenario of this application is as follows:
[0054] Server 2, which runs a request message processing method, receives a request message sent by terminal 3, obtains the model path corresponding to the request message from knowledge graph model 4, performs a calculation on the request message through the model path and obtains the calculation result, and returns the calculation result to terminal 3.
[0055] The data transmission method provided in this application is intended to solve the above-mentioned technical problems of the prior art.
[0056] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will be described below with reference to the accompanying drawings.
[0057] Example 1:
[0058] Please see Figure 2 This application provides a request message processing method, including:
[0059] S101: Receive a request message sent by the terminal, and obtain the model path corresponding to the request message from the preset knowledge graph model, wherein the knowledge graph model is a graph model with at least one model path, and at least one model node with operation rules is set on the model path.
[0060] In this step, the orchestration node corresponding to the requirement information in the request message sent by the terminal is taken as the endpoint, and the basic node corresponding to the request parameters in the request message sent by the terminal is taken as the starting point, to obtain the model path from the starting point to the endpoint in the knowledge graph model.
[0061] In a preferred embodiment, obtaining the model path corresponding to the request message from a preset knowledge graph model includes:
[0062] S11: Extract the demand information from the request message and obtain the orchestration index corresponding to the demand information from the knowledge graph model;
[0063] S12: Extract the request parameters of the request message and obtain the basic indicators corresponding to the request parameters from the knowledge graph model;
[0064] S13: The connection from the base node of the base indicator corresponding to the request parameter to the orchestration node of the orchestration indicator corresponding to the demand information is set as the model path corresponding to the request message.
[0065] For example, the requirement information in the request message is the name of the orchestration indicator required by the terminal, and the request parameter in the request message is the basic indicator specified by the terminal for obtaining the orchestration indicator corresponding to the requirement information.
[0066] For example: Suppose the request message contains the sum of squares, and the request parameters are a and b. Then, the orchestration metric C for obtaining the average value has the orchestration function c = + Furthermore, the connection between basic node a and basic node b and orchestration node c is set as the model path.
[0067] S102: Perform calculations on the request message through the model path and obtain the calculation result, then return the calculation result to the terminal.
[0068] In this step, the request parameters in the request message are calculated through the model path, so that the intermediate node or orchestration node located in the next position among two adjacent nodes on the model path uses the basic index of the basic node located in the previous position and / or the intermediate index of the intermediate node as the input parameters of the intermediate function of the intermediate node or the orchestration function of the orchestration node located in the next position, and runs the intermediate function to obtain the intermediate index, or runs the orchestration function to obtain the orchestration index.
[0069] This application can calculate the request messages sent by the terminal and obtain the corresponding calculation results simply by using the model paths in the pre-built knowledge graph model. It achieves the technical effect of reusability based on the knowledge graph model, quickly calculating a large number of request messages and accurately obtaining the corresponding calculation results. Therefore, it solves the problems in the prior art, which require the terminal to edit complex orchestration functions according to its needs, resulting in poor reusability of the orchestration functions and greatly reducing the efficiency of request message processing. Furthermore, since the orchestration functions are edited by each terminal according to its needs, it is easy for errors to occur due to the limited level of terminal users, resulting in low accuracy of the calculation results of request messages.
[0070] In a preferred embodiment, the step of performing calculations on the request message through the model path and obtaining the calculation result includes:
[0071] S21: If it is determined that there are no intermediate nodes on the model path, the request parameters in the request message are entered into the basic node located on the model path as the basic index of the basic node; the orchestration function in the orchestration node on the model path is called to calculate the basic index, and the orchestration index of the orchestration node is obtained. The obtained orchestration index is used as the calculation result.
[0072] S22: If it is determined that there are intermediate nodes on the model path, then the basic nodes, intermediate nodes and orchestration nodes are sorted according to the priority of the basic nodes, the priority of the intermediate nodes and the priority of the orchestration nodes on the model path to obtain the running order;
[0073] S23: Enter the request parameters in the request message into the basic node located at the first position in the running order, so as to serve as the basic indicator of the basic node;
[0074] S24: In accordance with the running order, call the intermediate functions in the intermediate nodes on the model path in sequence, calculate the basic index of the basic node located one position before the called intermediate node and / or the intermediate index of the intermediate node, and obtain the intermediate index of the called intermediate node.
[0075] S25: Call the orchestration function in the orchestration node located at the end of the running sequence, calculate the basic index in the basic node connected to the orchestration node on the model path and / or the intermediate index in the intermediate node, obtain the orchestration index of the orchestration node, and use the obtained orchestration index as the calculation result.
[0076] For example, the orchestration node e = (f(a) + f(b) + f(c)) / f(d), where c = f(a) + f(b) and d = f(a) + f(c). a and b are basic indicators with priorities of 0. Therefore, c is an intermediate indicator between a and b and d with a priority of 1. d is an intermediate indicator between a and c and e with a priority of 2. e is an orchestration indicator, located at the end of the execution order, with a priority of 3.
[0077] Therefore, the basic metrics a and b with priority 0 are first appended with the request parameters in the request message. The intermediate metric c with priority 1 is calculated based on the basic metrics a and b. The intermediate metric d with priority 2 is calculated based on the basic metrics a and the intermediate metric c. The orchestration metric e with priority 3 is calculated based on the basic metrics a and b, as well as the intermediate metrics c and d. The orchestration metric e is then used as the result of the model path's operation on the request message.
[0078] Example 2:
[0079] Please see Figure 3 This application provides a request message processing method, including:
[0080] S201: Obtain at least one basic indicator and at least one arrangement rule; obtain the basic indicator corresponding to the independent variable data in the arrangement rule; arrange the basic indicator corresponding to the independent variable data to obtain an arrangement function; the arrangement function is used to be calculated to obtain the arrangement indicator in the arrangement rule.
[0081] In this step, basic indicators are acquired to achieve the technical effect of configuring basic indicators according to the developer's needs. Orchestration rules are acquired to achieve the basic indicators are orchestrated according to the actual use of the application scenario and to obtain orchestration indicators that meet the application scenario requirements. An orchestration function is also used to calculate the orchestration indicators.
[0082] Specifically, the orchestration index in the orchestration rule represents the final calculation goal of the orchestration rule, the independent variable data in the orchestration rule represents the basic index required to obtain the orchestration index, and the orchestration rule also records the calculation process of obtaining the orchestration index based on the independent variable data. Loading the basic index corresponding to the independent variable data into the calculation process will yield the orchestration function.
[0083] In a preferred embodiment, the step of arranging the basic indicators corresponding to the independent variable data to obtain the arrangement function includes:
[0084] S31: If it is determined that there are no intermediate indicators in the arrangement rules, then the arrangement indicators in the arrangement rules are extracted, and the arrangement function is obtained by arranging the basic indicators corresponding to the independent variable data with the arrangement indicators as the dependent variable.
[0085] In this step, intermediate indicators refer to the intermediate state indicators obtained by calculating the basic indicators corresponding to the independent variable data in order to obtain the arrangement indicators. The intermediate state indicators are then used to obtain the transitional indicators of the required arrangement indicators. If there are no intermediate indicators in the arrangement rules, it means that the arrangement indicators in the arrangement rules can be obtained by directly arranging the basic indicators according to the calculation process defined in the arrangement rules.
[0086] S32: If it is determined that the arrangement rule contains an intermediate index, then the intermediate independent variable data corresponding to the intermediate index is obtained from the basic index corresponding to the independent variable data, and the intermediate independent variable data is arranged to obtain an intermediate function, which is used to calculate the intermediate index; and
[0087] The arrangement function is obtained by arranging the intermediate function, or by arranging the basic indicators corresponding to the independent variable data and the intermediate function.
[0088] In this step, if the arrangement rules contain intermediate indicators, it means that the basic indicators need to be arranged to obtain intermediate functions for obtaining intermediate indicators, and the intermediate functions need to be arranged again to obtain the arrangement function for obtaining the arrangement indicators. In this way, the complex arrangement function can be calculated, so that the arrangement function can adapt to the data indicator requirements of more complex application scenarios.
[0089] In this embodiment, the basic indicators are arranged using a formula editor to obtain intermediate functions and arrangement functions. The formula editor is based on the Python open-source framework and provides basic operational units such as addition, subtraction, multiplication, division, exponentiation, root extraction, exponentiation, and logarithms. It supports drag-and-drop customization of mathematical formulas and allows for the definition of logical relationships between multiple variables. For example ( + ) c / This formula can be decomposed into + 、( + ) c、( + ) c / The formula definition process involves three steps: selecting operators and variables one by one using the formula editor. Except for individual variables that require manual input, all other variables are defined through the formula editor. For example... = + , = c=( + ) c. = / = c / =( + ) c / Multiple formulas may have dependencies between them. When there are a large number of formulas that need to be edited and defined, using a formula editor will make it easier to select the required indicators and reuse the formula logic, without having to define them separately each time, which greatly saves work costs.
[0090] For example, the basic metrics are a and b, with priorities of 0, which is the highest priority.
[0091] If the orchestration index c does not have intermediate indices, the orchestration function constructed by the orchestration rules is c = f(a) + f(b).
[0092] If the orchestration index d has an intermediate index c, the orchestration function constructed by the orchestration rules is d=f(a)+f(c) and c=f(a)+f(b).
[0093] If the orchestration index e has intermediate indices c and d, the orchestration function constructed through the orchestration rules is e=(f(a)+f(b)+f(c)) / f(d), with intermediate functions c=f(a)+f(b) and d=f(a)+f(c). The intermediate function d=f(a)+f(c) also contains the intermediate function c=f(a)+f(b), which realizes the technical effect of nesting multiple intermediate functions and obtaining the orchestration function, thus expanding the scope of application scenarios.
[0094] S202: Determine the priority of the orchestration index based on the priority of the basic index in the orchestration function, and construct basic nodes corresponding to the basic index and orchestration nodes corresponding to the orchestration index. Based on the priority of the basic index and the priority of the orchestration index, create a knowledge graph model containing the basic nodes and the orchestration nodes, as well as model paths connecting the basic nodes and the orchestration nodes, wherein the orchestration node records the orchestration function.
[0095] In this step, the priority of the orchestration indicators is determined according to the priority of the basic indicators in the orchestration function to ensure that subsequent basic nodes, intermediate nodes, and orchestration nodes can be called in an orderly manner according to the priority. By constructing basic nodes corresponding to the basic indicators and orchestration nodes corresponding to the orchestration indicators, and creating a knowledge graph model containing the basic nodes and orchestration nodes, as well as the model paths connecting the basic nodes and orchestration nodes, a computer model that can be called at any time and can be reused is obtained. That is, the knowledge graph model ensures the computational efficiency and reliability of obtaining orchestration indicators based on basic indicators.
[0096] A knowledge graph is a series of different graphs that display the development process and structural relationships of knowledge. It uses visualization technology to describe knowledge resources and their carriers, and to mine, analyze, construct, draw and display computer models of knowledge and the relationships between them.
[0097] In a preferred embodiment, determining the priority of the orchestration indicators based on the priority of the basic indicators in the orchestration function further includes:
[0098] S41: If it is determined that the orchestration function corresponding to the orchestration index does not have an intermediate function, then the priority of the orchestration index is constructed according to the priority of the basic index in the orchestration function, wherein the priority of the orchestration index is lower than the priority of the basic index.
[0099] S42: If it is determined that there is an intermediate function in the orchestration function corresponding to the orchestration index, then the priority of the intermediate index is constructed according to the priority of the basic index in the intermediate function, wherein the priority of the intermediate index is lower than the priority of the basic index in the intermediate function.
[0100] S43: If it is determined that the orchestration function only has intermediate functions, then the priority of the orchestration index is constructed according to the priority of the intermediate index, wherein the priority of the orchestration index is lower than the priority of the intermediate index.
[0101] S44: If it is determined that the orchestration function has intermediate functions and basic data, then the priority of the orchestration indicator is constructed according to the priority of the intermediate indicator and the priority of the basic indicator corresponding to the independent variable data, wherein the priority of the orchestration indicator is lower than the priority of the intermediate indicator and lower than the priority of the basic indicator corresponding to the independent variable data.
[0102] For example, the priorities of basic indicators a and b are 0, which is the highest priority.
[0103] If the orchestration index c does not have intermediate indices, the orchestration function constructed by the orchestration rules is c=f(a)+f(b), and the priority of the orchestration index c is set to max[a,b]+1=0+1=1.
[0104] If the orchestration index d has an intermediate index c, the orchestration function constructed by the orchestration rules is d=f(a)+f(c) and c=f(a)+f(b). The priority of the orchestration index d is set to max[a,c]+1=1+1=2.
[0105] If the orchestration index e has intermediate indices c and d, the orchestration function constructed by the orchestration rules is e=(f(a)+f(b)+f(c)) / f(d), the intermediate function c=f(a)+f(b), and the intermediate function d=f(a)+f(c). Among them, the intermediate function d=f(a)+f(c) also has the intermediate function c=f(a)+f(b). The priority of the orchestration index e is set to max[a,b,c,d]+1=2+1=3.
[0106] In a preferred embodiment, the step of creating a knowledge graph model that includes the basic nodes and the orchestration nodes, and model paths connecting the basic nodes and the orchestration nodes, based on the priority of the basic indicators and the priority of the orchestration indicators, includes:
[0107] S45: If it is determined that there is no intermediate function in the orchestration function, the priority of the basic index is entered into the basic node, and the priority of the orchestration index is entered into the orchestration node. A connection is made between the basic node and the orchestration node to obtain a model path representing the path from the basic index to the orchestration index.
[0108] S46: If it is determined that there is an intermediate function in the arrangement function, then construct an intermediate node corresponding to the intermediate function, obtain the priority of the intermediate index corresponding to the intermediate function, and identify the basic node corresponding to the basic index in the intermediate function, wherein the intermediate node records the intermediate function.
[0109] S47: Enter the priority of the intermediate indicator in the intermediate node, and enter the priority of the basic indicator in the basic node corresponding to the basic indicator in the intermediate function; connect the intermediate node and the basic node to obtain the first side; enter the priority of the arrangement indicator in the arrangement node, and connect the arrangement node and the intermediate node to obtain the second side.
[0110] S48: If it is determined that the orchestration function only has intermediate functions, then the first edge and the second edge are integrated to obtain a model path representing the path from the basic index to the orchestration index.
[0111] S49: If it is determined that the orchestration function has intermediate functions and basic indicators, then a third edge is obtained by connecting the basic node corresponding to the basic indicator in the orchestration function to the orchestration node, and the first edge, the second edge and the third edge are integrated to obtain the model path representing the path from the basic indicator to the orchestration indicator.
[0112] In this embodiment, by constructing a knowledge graph model with a first edge, a second edge, a third edge, and basic nodes, intermediate nodes, and orchestration nodes, not only is the efficiency and convenience of obtaining orchestration indicators improved, but the knowledge graph model can also be adjusted by adjusting the basic indicators and priorities in the basic nodes, and / or the intermediate indicators, intermediate functions and priorities in the intermediate nodes, and / or the orchestration indicators, orchestration functions and priorities in the orchestration nodes, so that the terminal can easily obtain the adjusted orchestration indicators.
[0113] S203: Receive a request message sent by the terminal, and obtain the model path corresponding to the request message from the preset knowledge graph model, wherein the knowledge graph model is a graph model with at least one model path, and at least one model node with operation rules is set on the model path.
[0114] This step is the same as S101 in Example 1.
[0115] S204: Perform calculations on the request message through the model path and obtain the calculation result, then return the calculation result to the terminal.
[0116] This step is the same as S102 in Example 1.
[0117] The collection, storage, use, processing, transmission, provision, and disclosure of financial data or user data involved in the technical solution of this application all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0118] Example 3:
[0119] Please see Figure 4 This application provides a request message processing apparatus 1, comprising:
[0120] The path identification module 13 is used to receive a request message sent by the terminal and obtain the model path corresponding to the request message from a preset knowledge graph model, wherein the knowledge graph model is a graph model with at least one model path and at least one model node with operation rules is set on the model path.
[0121] The request calculation module 14 is used to perform calculations on the request message through the model path and obtain the calculation result, and return the calculation result to the terminal.
[0122] Optionally, the request message processing device 1 further includes:
[0123] The indicator arrangement module 11 is used to obtain at least one basic indicator and at least one arrangement rule, obtain the basic indicator corresponding to the independent variable data in the arrangement rule, arrange the basic indicator corresponding to the independent variable data to obtain an arrangement function, and the arrangement function is used to be calculated to obtain the arrangement indicator in the arrangement rule.
[0124] The model building module 12 is used to determine the priority of the orchestration index according to the priority of the basic index in the orchestration function, and to construct basic nodes corresponding to the basic index and orchestration nodes corresponding to the orchestration index. Based on the priority of the basic index and the priority of the orchestration index, a knowledge graph model is created that includes the basic nodes and the orchestration nodes, as well as model paths connecting the basic nodes and the orchestration nodes, wherein the orchestration nodes record the orchestration function.
[0125] Example 4:
[0126] To achieve the above objectives, this application also provides a computer device 5, including: a processor and a memory communicatively connected to the processor; the memory stores computer execution instructions;
[0127] The processor executes the computer execution instructions stored in the memory to implement the above-described request message processing method. The components of the request message processing device can be distributed across different computer devices. The computer device 5 can be a smartphone, tablet, laptop, desktop computer, rack server, blade server, tower server, or cabinet server (including standalone servers or server clusters composed of multiple application servers), etc. The computer device in this embodiment includes, but is not limited to, a memory 51 and a processor 52 that can communicate with each other via a system bus. Figure 5 As shown. It should be noted that, Figure 5Only computer devices with components are shown; however, it should be understood that it is not required to implement all the components shown, and more or fewer components may be implemented instead. In this embodiment, memory 51 (i.e., readable storage medium) includes flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, memory 51 may be an internal storage unit of the computer device, such as the hard disk or memory of the computer device. In other embodiments, memory 51 may also be an external storage device of the computer device, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., provided on the computer device. Of course, memory 51 may also include both internal storage units and external storage devices of the computer device. In this embodiment, memory 51 is typically used to store the operating system and various application software installed on the computer device, such as the program code of the request message processing device in Embodiment 3. In addition, memory 51 can also be used to temporarily store various types of data that have been output or will be output. Processor 52, in some embodiments, can be a central processing unit (CPU), controller, microcontroller, microprocessor, or other data processing chip. This processor 52 is typically used to control the overall operation of the computer device. In this embodiment, processor 52 is used to run program code stored in memory 51 or process data, for example, to run a request message processing device to implement the request message processing method of the above embodiments.
[0128] The integrated modules implemented as software functional modules described above can be stored in a computer-readable storage medium. These software functional modules, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods described in the various embodiments of this application. It should be understood that the processor may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in this application can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules in the processor. The memory may include high-speed RAM, and may also include non-volatile memory (NVM), such as at least one disk storage device, and may also be a USB flash drive, external hard drive, read-only memory, disk, or optical disk, etc.
[0129] To achieve the above objectives, this application also provides a computer-readable storage medium, such as flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, server, App application store, etc., which stores computer-executable instructions, and the program implements the corresponding function when executed by processor 52. The computer-readable storage medium of this embodiment is used to store computer-executable instructions for implementing the request message processing method, and when executed by processor 52, it implements the request message processing method of the above embodiment.
[0130] The aforementioned storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.
[0131] An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Alternatively, the storage medium can be an integral part of the processor. Both the processor and the storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and storage medium can exist as discrete components in an electronic device or host device.
[0132] This application provides a computer program product, including a computer program that, when executed by a processor, implements the above-described request message processing method.
[0133] It should be noted that, in this document, 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. Unless otherwise specified, 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 that element.
[0134] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0135] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A request message processing method, characterized in that, include: The system receives a request message sent by a terminal and obtains the model path corresponding to the request message from a preset knowledge graph model. The knowledge graph model is a graph model with at least one model path, and at least one model node with operation rules is set on the model path. The request message is processed through the model path to obtain the result, and the result is returned to the terminal. The step of obtaining the model path corresponding to the request message from the preset knowledge graph model includes: extracting the requirement information from the request message; obtaining the orchestration index corresponding to the requirement information from the knowledge graph model; extracting the request parameters from the request message; obtaining the basic index corresponding to the request parameters from the knowledge graph model; and setting the connection from the basic node of the basic index corresponding to the request parameters to the orchestration node of the orchestration index corresponding to the requirement information as the model path corresponding to the request message. The step of performing calculations on the request message through the model path and obtaining the calculation result includes: If it is determined that there are no intermediate nodes on the model path, the request parameters in the request message are entered into the basic node located on the model path as the basic index of the basic node; the orchestration function in the orchestration node on the model path is called to calculate the basic index, and the orchestration index of the orchestration node is obtained. The obtained orchestration index is used as the calculation result. If it is determined that there are intermediate nodes on the model path, then the basic nodes, intermediate nodes and orchestration nodes are sorted according to the priority of the basic nodes, the priority of the intermediate nodes and the priority of the orchestration nodes on the model path to obtain the running order; The request parameters in the request message are entered into the base node at the first position in the running order as the base index of the base node; the intermediate functions in the intermediate nodes on the model path are called sequentially according to the running order to calculate the base index of the base node preceding the called intermediate node and / or the intermediate index of the intermediate node, thus obtaining the intermediate index of the called intermediate node; the orchestration function in the orchestration node at the last position in the running order is called to calculate the base index of the base node connected to the orchestration node on the model path and / or the intermediate index of the intermediate node, thus obtaining the orchestration index of the orchestration node, and the obtained orchestration index is used as the calculation result.
2. The request message processing method according to claim 1, characterized in that, Before the request message sent by the receiving terminal, the method further includes: Obtain at least one basic indicator and at least one arrangement rule, obtain the basic indicator corresponding to the independent variable data in the arrangement rule, arrange the basic indicator corresponding to the independent variable data to obtain an arrangement function, and the arrangement function is used to be calculated to obtain the arrangement indicator in the arrangement rule. The priority of the orchestration index is determined according to the priority of the basic index in the orchestration function, and the basic nodes corresponding to the basic index and the orchestration nodes corresponding to the orchestration index are constructed. According to the priority of the basic index and the priority of the orchestration index, a knowledge graph model containing the basic nodes and the orchestration nodes, as well as the model path connecting the basic nodes and the orchestration nodes, is created, wherein the orchestration function is recorded in the orchestration node.
3. The request message processing method according to claim 2, characterized in that, The arrangement of the basic indicators corresponding to the independent variable data to obtain the arrangement function includes: If it is determined that there are no intermediate indicators in the arrangement rules, then the arrangement indicators in the arrangement rules are extracted, and the arrangement indicators are used as the dependent variable to arrange the basic indicators corresponding to the independent variable data to obtain the arrangement function. If it is determined that the arrangement rule contains an intermediate indicator, then the intermediate independent variable data corresponding to the intermediate indicator is obtained from the basic indicators corresponding to the independent variable data, and the intermediate independent variable data is arranged to obtain an intermediate function, which is used to calculate the intermediate indicator; and The arrangement function is obtained by arranging the intermediate function, or by arranging the basic indicators corresponding to the independent variable data and the intermediate function.
4. The request message processing method according to claim 2, characterized in that, The step of determining the priority of the orchestration indicators based on the priority of the basic indicators in the orchestration function further includes: If it is determined that the orchestration function corresponding to the orchestration index does not have an intermediate function, then the priority of the orchestration index is constructed according to the priority of the basic index in the orchestration function, wherein the priority of the orchestration index is lower than the priority of the basic index. If it is determined that there is an intermediate function in the orchestration function corresponding to the orchestration index, then the priority of the intermediate index is constructed according to the priority of the basic index in the intermediate function, wherein the priority of the intermediate index is lower than the priority of the basic index in the intermediate function. If it is determined that the orchestration function contains only intermediate functions, then the priority of the orchestration index is constructed according to the priority of the intermediate index, wherein the priority of the orchestration index is lower than the priority of the intermediate index. If it is determined that the orchestration function contains intermediate functions and basic data, then the priority of the orchestration indicator is constructed according to the priority of the intermediate indicator and the priority of the basic indicator corresponding to the independent variable data, wherein the priority of the orchestration indicator is lower than the priority of the intermediate indicator and lower than the priority of the basic indicator corresponding to the independent variable data.
5. The request message processing method according to claim 2, characterized in that, The step of creating a knowledge graph model based on the priority of the basic indicators and the priority of the orchestration indicators, including the basic nodes and the orchestration nodes, and the model paths connecting the basic nodes and the orchestration nodes, includes: If it is determined that there is no intermediate function in the orchestration function, the priority of the basic indicator is entered into the basic node, and the priority of the orchestration indicator is entered into the orchestration node. A connection is made between the basic node and the orchestration node to obtain a model path representing the path from the basic indicator to the orchestration indicator. If it is determined that there is an intermediate function in the orchestration function, then an intermediate node corresponding to the intermediate function is constructed, the priority of the intermediate index corresponding to the intermediate function is obtained, and the basic node corresponding to the basic index in the intermediate function is identified, wherein the intermediate node records the intermediate function. The priority of the intermediate indicator is entered in the intermediate node, and the priority of the basic indicator is entered in the basic node corresponding to the basic indicator in the intermediate function. A first side is obtained by connecting the intermediate node and the basic node. The priority of the orchestration indicator is entered in the orchestration node, and a second side is obtained by connecting the orchestration node and the intermediate node. If it is determined that the orchestration function contains only intermediate functions, then the first edge and the second edge are integrated to obtain a model path representing the path from the basic index to the orchestration index; If it is determined that the orchestration function has intermediate functions and basic indicators, then a third edge is obtained by connecting the basic node corresponding to the basic indicator in the orchestration function to the orchestration node. The first edge, the second edge and the third edge are integrated to obtain the model path representing the path from the basic indicator to the orchestration indicator.
6. A request message processing apparatus, characterized in that, include: The path recognition module is used to receive a request message sent by the terminal and obtain the model path corresponding to the request message from a preset knowledge graph model. The knowledge graph model is a graph model with at least one model path and at least one model node with operation rules is set on the model path. The request calculation module is used to perform calculations on the request message through the model path and obtain the calculation result, and return the calculation result to the terminal; The path identification module is specifically used for: extracting demand information from the request message, obtaining orchestration indicators corresponding to the demand information from the knowledge graph model; extracting request parameters from the request message, obtaining basic indicators corresponding to the request parameters from the knowledge graph model; and setting the connection from the basic node of the basic indicator corresponding to the request parameter to the orchestration node of the orchestration indicator corresponding to the demand information as the model path corresponding to the request message. The request calculation module is specifically used for: if it is determined that there is no intermediate node on the model path, then entering the request parameters in the request message into the basic node located on the model path as the basic index of the basic node; calling the orchestration function in the orchestration node on the model path to calculate the basic index, obtaining the orchestration index of the orchestration node, and using the obtained orchestration index as the calculation result; If it is determined that there are intermediate nodes on the model path, then the basic nodes, intermediate nodes and orchestration nodes are sorted according to the priority of the basic nodes, the priority of the intermediate nodes and the priority of the orchestration nodes on the model path to obtain the running order; The request parameters in the request message are entered into the base node at the first position in the running order as the base index of the base node; the intermediate functions in the intermediate nodes on the model path are called sequentially according to the running order to calculate the base index of the base node preceding the called intermediate node and / or the intermediate index of the intermediate node, thus obtaining the intermediate index of the called intermediate node; the orchestration function in the orchestration node at the last position in the running order is called to calculate the base index of the base node connected to the orchestration node on the model path and / or the intermediate index of the intermediate node, thus obtaining the orchestration index of the orchestration node, and the obtained orchestration index is used as the calculation result.
7. A computer device, characterized in that, include: A processor and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the request message processing method as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the request message processing method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Path learning planning system based on knowledge graph and target ontology
CN110737776A
Path processing method and device, storage medium and electronic equipment
CN115048529A
