Service risk determination method and apparatus, and storage medium and electronic device

By obtaining and analyzing the data source relationship diagram, we determine the data source matching the flow computing task to locate business risks, and solve the problem that it is difficult to accurately locate business risks when the flow computing task is executed abnormally, achieving high-precision business risk positioning.

WO2025081616A1PCT designated stage expired Publication Date: 2025-04-24CHINA TELECOM BESTPAY CO LTD

Patent Information

Application Number
PCT/CN2023/138987
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-10-19
Filing Date
2023-12-15
Publication Date
2025-04-24

AI Technical Summary

Technical Problem

When there are problems with the execution of stream computing tasks, it is difficult for the existing technology to accurately locate business risks, and it is greatly affected by manual professional capabilities, and there is a lack of effective solutions.

Method used

By obtaining the data source relationship diagram of the target service, determine the data source matching the flow calculation task, and locate the business risks based on the data source. The data source relationship graph consists of nodes and directed edges. The nodes represent the data source, and directed edges represent the data flow relationship between the data sources.

Benefits of technology

When the flow calculation task is executed abnormally, the business risks of target services are accurately determined based on the data flow relationship between data sources, and the positioning accuracy and efficiency are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023138987_24042025_PF_FP_ABST
    Figure CN2023138987_24042025_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in the present invention are a service risk determination method and apparatus, and a storage medium and an electronic device. The method comprises: acquiring a data source relationship graph of a target service, wherein the data source relationship graph consists of nodes and directed edges, one node represents one data source associated with the target service, each directed edge represents a data flow relationship between data sources, the data flow relationship is determined by means of a stream computing task under the target service, and the stream computing task is used for processing data in a data source; and during the execution of the target service, when the execution of a stream computing task is abnormal, determining from the data source relationship graph data sources matching the stream computing task, and positioning a service risk of the target service on the basis of the data sources matching the stream computing task. The present invention solves the technical problem in the related art of it being difficult to position a service risk when a problem occurs in the execution of a stream computing task of a service.
Need to check novelty before this filing date? Find Prior Art

Description

Business risk determination method, device, storage medium and electronic device Technical Field

[0001] The present invention relates to the field of stream data computing, and in particular to a method, device, storage medium and electronic device for determining business risks. Background Art

[0002] A stream computing task is a real-time data processing task that processes and analyzes continuously generated data streams in real time. In a complex business system, dozens or even hundreds of stream computing tasks are running, processing business data within the system to ensure normal business operations. Currently, when problems arise during the execution of stream computing tasks, the only option is to manually identify business risks. However, this method is significantly limited by human expertise, making it difficult to accurately identify business risks.

[0003] To address the above-mentioned problems, no effective solutions have been proposed so far.

[0004] Summary of the Invention

[0005] The embodiments of the present invention provide a method, device, storage medium and electronic device for determining business risks, so as to at least solve the technical problem in related technologies that it is difficult to locate business risks when problems arise in the execution of business flow computing tasks.

[0006] According to one aspect of an embodiment of the present invention, a method for determining business risks is provided, comprising: obtaining a data source relationship graph of a target business, wherein the data source relationship graph consists of nodes and directed edges, a node represents a data source associated with the target business, and a directed edge represents a data flow relationship between data sources, the data flow relationship being determined by a stream computing task under the target business, and the stream computing task being used to process data in the data source; in the process of executing the target business, if the stream computing task is executed abnormally, determining the data source that matches the stream computing task from the data source relationship graph, and locating the business risk of the target business based on the data source that matches the stream computing task.

[0007] Furthermore, the method for determining business risks also includes: obtaining multiple task execution statements, wherein different task execution statements are used to describe different stream computing tasks under the target business; for each task execution statement, determining the input data source and output data source matched by the task execution statement based on the statement content of the task execution statement; constructing a data source relationship graph based on the input data source, output data source matched by each task execution statement and the stream computing task matched by the task execution statement, wherein a directed edge points from the input data source to the output data source, and there is a corresponding relationship between the directed edge and the stream computing task.

[0008] Furthermore, the method for determining business risks also includes: determining at least one data source matched by the task execution statement based on the statement content of the task execution statement; for each data source matched by the task execution statement, determining the data source type of the data source based on the statement content of the task execution statement, wherein the data source type is an input data source or an output data source.

[0009] Furthermore, the method for determining business risks also includes: finding at least one piece of data source information from the task execution statement; for each piece of data source information, determining the data source type of the data source that matches the data source information based on the connection parameters in the data source information; parsing the information other than the connection parameters in the data source information based on the parsing method of data source type matching to obtain the identifier and storage address of the data source that matches the data source information; determining the data source that matches the data source information based on the identifier and storage address of the data source that matches the data source information; and determining the data source that matches all data source information as the data source that matches the task execution statement.

[0010] Furthermore, the method for determining business risk also includes: finding at least one piece of data processing information from the task execution statement; and determining the data source type of the data source based on the data processing statement in the data processing information and the correspondence between the data processing statement and the data source.

[0011] Furthermore, the method for determining business risks also includes: finding the temporary identifier recorded in the data source information from each data source information; determining the correspondence between the data processing statement and the data source based on the correspondence between the data processing statement and the temporary identifier, the data source information to which the temporary identifier belongs, and the matching relationship between the data source information and the data source.

[0012] Furthermore, the method for determining business risk also includes: if the data processing statement is a query statement, determining the data source corresponding to the data processing statement as the input data source; if the data processing statement is an insert statement or an update statement, determining the data source corresponding to the data processing statement as the output data source.

[0013] According to another aspect of an embodiment of the present invention, a device for determining business risks is also provided, including: a first acquisition module, used to obtain a data source relationship graph of a target business, wherein the data source relationship graph consists of nodes and directed edges, a node represents a data source associated with the target business, and a directed edge represents a data flow relationship between data sources, and the data flow relationship is determined by a stream computing task under the target business, and the stream computing task is used to process data in the data source; a processing module, used to determine the data source matching the stream computing task from the data source relationship graph in the event of an abnormal execution of the stream computing task during the execution of the target business, and locate the business risk of the target business based on the data source matching the stream computing task.

[0014] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored. The computer program is configured to execute the above-mentioned method for determining business risk when running.

[0015] According to another aspect of an embodiment of the present invention, an electronic device is also provided, which includes one or more processors; a memory for storing one or more programs, which enables the one or more processors to run the programs when the one or more programs are executed by the one or more processors, wherein the programs are configured to execute the above-mentioned method for determining business risks during operation.

[0016] In an embodiment of the present invention, when a stream computing task executes abnormally, the business risk of the target business is located based on the data flow relationship between data sources. By obtaining the data source relationship graph of the target business, the data source matching the stream computing task is determined from the data source relationship graph during the execution of the target business, and the business risk of the target business is located based on the data source matching the stream computing task. The data source relationship graph is composed of nodes and directed edges. A node represents a data source associated with the target business, and a directed edge represents the data flow relationship between data sources. The data flow relationship is determined by the stream computing task under the target business, and the stream computing task is used to process data in the data source.

[0017] In the above process, by obtaining the data source relationship diagram of the target business, the data flow relationship between the data sources under the target business is effectively determined, that is, the processing relationship between the stream computing task and the data source is effectively determined. Furthermore, in the process of executing the target business, by determining the data source matching the stream computing task from the data source relationship diagram when the stream computing task is executed abnormally, the data source that may cause the stream computing task abnormality and the data source affected by the stream computing task abnormality are effectively determined, so that when the business risk of the target business is located based on the data source matching the stream computing task, the business risk can be accurately located.

[0018] It can be seen that the solution provided by this application achieves the purpose of locating the business risks of the target business based on the data flow relationship between data sources when the stream computing task is executed abnormally, thereby achieving the technical effect of accurately locating business risks, and further solving the technical problem of difficulty in locating business risks when problems arise in the execution of the stream computing tasks of the business in related technologies. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0020] FIG1 is a schematic diagram of an optional method for determining business risk according to an embodiment of the present invention;

[0021] FIG2 is a schematic diagram of an optional data source relationship diagram according to an embodiment of the present invention;

[0022] FIG3 is a schematic diagram of an optional device for determining business risk according to an embodiment of the present invention;

[0023] FIG4 is a schematic diagram of an optional electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0024] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.

[0025] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0026] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data for analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties.

[0027] Example 1

[0028] According to an embodiment of the present invention, an embodiment of a method for determining business risk is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0029] FIG1 is a schematic diagram of an optional method for determining business risk according to an embodiment of the present invention. As shown in FIG1 , the method includes the following steps:

[0030] Step S101: Obtain a data source relationship graph of the target business, where the data source relationship graph consists of nodes and directed edges. A node represents a data source associated with the target business, and a directed edge represents the data flow relationship between data sources. The data flow relationship is determined by the stream computing task under the target business, and the stream computing task is used to process the data in the data source.

[0031] Optionally, electronic devices, application systems, servers, and other devices can be used as the execution subject of this application. In this embodiment, the target processing system is used as the execution subject. Optionally, the stream computing task in this embodiment can be a stream computing task processed by a Flink cluster, that is, a Flink stream computing task. Apache Flink is a distributed processing engine and framework for stateful computing on bounded and unbounded data streams, and provides SQL support. Stream computing tasks can be submitted by writing FlinkSQL.

[0032] The data source relationship diagram of the target business can be pre-constructed by the target processing system. In the process of constructing the data source relationship diagram, the target processing system can analyze the stream computing tasks under the target business to determine the input data source and output data source of each stream computing task, thereby determining the data flow relationship between the data sources based on the input data source and output data source of each stream computing task, and then constructing the data source relationship diagram. For example, there is a directed edge from node A to node B in the data source relationship diagram. This directed edge can be used to represent that the data in the data source corresponding to node B is determined based on the data in the data source corresponding to node A. The data source can refer to a data table or other data carrier.

[0033] Step S102: During the execution of the target business, if the stream computing task is executed abnormally, the data source matching the stream computing task is determined from the data source relationship graph, and the business risk of the target business is located based on the data source matching the stream computing task.

[0034] Optionally, during the execution of the target business, that is, during the execution of the stream computing task under the target business, if there is an exception in the execution of the stream computing task, the target processing system can determine the data source that matches the stream computing task from the data source relationship diagram. For example, the data source that matches the stream computing task can refer to the input data source and output data source matched by the stream computing task.

[0035] Furthermore, for example, if the data source matched by a stream computing task contains user transaction data, it can be determined that transaction events in the target business present business risks. Similarly, if the data source matched by a stream computing task contains user information, it can be determined that events in the target business that require user information present business risks. This allows for accurate identification of business risks in the target business.

[0036] Based on the scheme defined in steps S101 to S102 above, it can be seen that in an embodiment of the present invention, when a stream computing task is executed abnormally, the business risk of the target business is located based on the data flow relationship between data sources. By obtaining the data source relationship graph of the target business, during the execution of the target business, when the stream computing task is executed abnormally, the data source matching the stream computing task is determined from the data source relationship graph, and the business risk of the target business is located based on the data source matching the stream computing task. The data source relationship graph is composed of nodes and directed edges. A node represents a data source associated with the target business, and a directed edge represents the data flow relationship between data sources. The data flow relationship is determined by the stream computing task under the target business, and the stream computing task is used to process data in the data source.

[0037] It is easy to notice that in the above process, by obtaining the data source relationship diagram of the target business, the data flow relationship between the data sources under the target business is effectively determined, that is, the processing relationship between the stream computing task and the data source is effectively determined. Furthermore, in the process of executing the target business, by determining the data source matching the stream computing task from the data source relationship diagram when the stream computing task is executed abnormally, the data source that may cause the stream computing task abnormality and the data source affected by the stream computing task abnormality are effectively determined, so that when the business risk of the target business is located based on the data source matching the stream computing task, the business risk can be accurately located.

[0038] It can be seen that the solution provided by this application achieves the purpose of locating the business risks of the target business based on the data flow relationship between data sources when the stream computing task is executed abnormally, thereby achieving the technical effect of accurately locating business risks, and further solving the technical problem of difficulty in locating business risks when problems arise in the execution of the stream computing tasks of the business in related technologies.

[0039] In an optional embodiment, the target processing system can generate a data source relationship graph in the following manner: obtain multiple task execution statements, where different task execution statements are used to describe different stream computing tasks under the target business; for each task execution statement, determine the input data source and output data source matched by the task execution statement based on the statement content of the task execution statement; based on the input data source, output data source matched by each task execution statement and the stream computing task matched by the task execution statement, construct a data source relationship graph, where directed edges point from the input data source to the output data source, and there is a corresponding relationship between the directed edges and the stream computing tasks.

[0040] Optionally, in this embodiment, the business system submits a task execution statement to the Flink cluster, and then the Flink cluster executes the stream computing task described therein according to the task execution statement, where the task execution statement can be a FlinkSQL statement.

[0041] The target processing system can obtain multiple task execution statements under the target business, and then for each task execution statement, determine the input data source and output data source that the task execution statement matches based on the statement content of the task execution statement. Among them, the multiple task execution statements can be the task execution statements being executed under the target business, or all task execution statements under the target business, and according to actual application requirements, task execution statements in other execution states under the target business can be selected as the task execution statements that need to be obtained. The input data source can be understood as the data source where the data processing object of the target processing system is located, and the output data source can be understood as the data source where the data processed by the target processing system should be written. In addition, a task execution statement can match at least one input data source and at least one output data source, and depending on the application scenario, in certain cases, a task execution statement can only match at least one input data source but not the output data source. For example, the task execution statement is used to indicate that the processed data is directly fed back to the user, and there is no output data source at this time.

[0042] Furthermore, the target processing system can construct a data source relationship graph based on the input data sources, output data sources and stream computing tasks matched by each task execution statement. In this embodiment, a directed edge from node A to node B in the data source relationship graph can be used to represent that the data in the data source corresponding to node B is determined based on the data in the data source corresponding to node A, wherein the data source corresponding to node A is the input data source, and the data source corresponding to node B is the output data source. It should be noted that the input data source and the output data source are relative to a specific stream computing task, that is, for different stream computing tasks, a data source may be an input data source or an output data source. In addition, the directed edges correspond to the stream computing tasks one-to-one. For example, if the data source corresponding to node A and the data source corresponding to node B are the input data source and the output data source respectively matched by a task execution statement, then there is a corresponding relationship between the directed edge between the data source corresponding to node A and the data source corresponding to node B and the stream computing task matched by the task execution statement.

[0043] For example, the input data source and output data source matched by a task execution statement can be shown in Table 1:

[0044] Table 1

[0045] In Table 1, the target business is BIZ_A, the stream computing task matched by the task execution statement is TASK_A, data sources 1 and 5 are the input data sources matched by the task execution statement, and data source 3 is the output data source matched by the task execution statement.

[0046] Furthermore, the input data source and output data source for each task execution statement matching under the target business can be shown in Table 2:

[0047] Table 2

[0048] In Table 2, there are three stream computing tasks under the target business: TASK_A, TASK_B, and TASK_C, that is, there are three task execution statements.

[0049] Furthermore, based on the content shown in Table 2, the target processing system can construct a data source relationship diagram as shown in Figure 2. As shown in Figure 2, in Figure 2, table No. 1 (i.e., 1(kafka TOPIC_A)) and table No. 5 (i.e., 5(mysql T_MY_COUNT)) point to table No. 2 (i.e., 2(kafka TOPIC_B)) via the TASK_A stream computing task, table No. 2 points to table No. 3 (i.e., 3(es ES_INDEX_*)) via the TASK_B stream computing task, and table No. 2 and table No. 1 point to table No. 6 (i.e., 6(redis REDIS_KEY_A)) and table No. 7 (i.e., 7(doris DORIS_T_A)) via the TASK_C stream computing task.

[0050] It can be seen that by setting a directed edge from the input data source to the output data source and setting a corresponding relationship between the directed edge and the stream computing task, the data flow relationship between the data sources under the target business is effectively determined.

[0051] In an optional embodiment, in the process of determining the input data source and output data source matched by the task execution statement based on the statement content of the task execution statement, the target processing system can determine at least one data source matched by the task execution statement based on the statement content of the task execution statement, thereby determining the data source type of the data source for each data source matched by the task execution statement based on the statement content of the task execution statement, wherein the data source type is an input data source or an output data source.

[0052] Optionally, each task execution statement includes at least one piece of data source information and at least one piece of data processing information, where the data processing information is used to describe how the data in the data source is processed. The target processing system may determine at least one data source that matches the task execution statement based on the data source information in the task execution statement, and may determine the data source type of the data source based on the data processing information in the task execution statement.

[0053] It should be noted that by determining the input data source and output data source that match the task execution statement based on the statement content of the task execution statement, accurate determination of the input data source and output data source is achieved, and the acquisition of additional data is avoided, thereby improving processing efficiency.

[0054] In an optional embodiment, in the process of determining at least one data source that matches a task execution statement based on the statement content of the task execution statement, the target processing system can find at least one data source information from the task execution statement, and then for each data source information, determine the data source type of the data source that matches the data source information based on the connection parameters in the data source information, and then parse the information in the data source information except the connection parameters based on the parsing method of the data source type matching to obtain the identifier and storage address of the data source that matches the data source information, and determine the data source that matches the data source information based on the identifier and storage address of the data source that matches the data source information, thereby determining the data source that matches all data source information as the data source that matches the task execution statement.

[0055] Optionally, the target processing system can locate at least one piece of data source information based on a key field in the task execution statement. The key field can be "CREATETABLE." Furthermore, after locating the data source information, for each piece of data source information, the target processing system can determine the keyword following "CREATETABLE" as a temporary identifier for the data source in the Flink cluster and determine the data source type that matches the data source information based on the connection parameters in the data source information. For example, the fields corresponding to the connection parameters can be "connector," "driver," and so on. Furthermore, the target processing system has preset parsing methods for matching various data source types. Based on the parsing method that matches the determined data source type, the target processing system can parse the information in the data source information, excluding the connection parameters, to locate the identifier and storage address of the data source that matches the data source information based on the corresponding fields. For example, the corresponding fields can be "url," "table-name," "properties.bootstrap.servers," and so on. The data source identifier refers to the actual identifier of the data source in the database.

[0056] Optionally, the data source type can be MySQL, Kafka, ES, etc. For example, when the data source type is MySQL, an optional task execution statement can be as follows:

[0057] When connector = jdbc and driver = com.mysql.jdbc.Driver, the data source type is determined to be MySQL. The target processing system can then parse the data source using the MySQL matching method to obtain the data source's storage address as 192.168.1.1, the database name as database, and the data source identifier as T_MY_COUNT.

[0058] When the data source type is Kafka, an optional task execution statement can be as follows:

[0059] When connector = kafka, the data source type is determined to be Kafka. The target processing system then uses the Kafka matching parsing method to determine the data source's storage address is 192.168.1.1:9092, the data source identifier is TOPIC_A, and the default database name defined by Kafka is default.

[0060] When the data source type is ES, an optional task execution statement can be as follows:

[0061] At that time

[0062] When connector = elasticsearch-7, the data source type is determined to be ES. The target processing system can then use ES's matching parsing method to parse the data source to obtain the storage addresses of 192.168.1.1:9200 and 192.168.1.2:9200, the data source identifier is TOPIC_B_*, and the default database name defined by ES is default.

[0063] Furthermore, the target processing system stores the identifier of the data source, the matching relationship between the storage address and the data source. An optional matching relationship is shown in Table 3:

[0064] Table 3

[0065] As shown in Table 3, the data source matched by the task execution statement with the data source type set to MySQL is data source 5, which matches the temporary identifier MYSQL_SOURCE. The data source matched by the task execution statement with the data source type set to Kafka is data source 1, which matches the temporary identifier LOG. The data source matched by the task execution statement with the data source type set to ES is data source 4, which matches the temporary identifier ES_SINK.

[0066] It should be noted that by parsing the data source information according to the parsing method of data source type matching, the information content of the data source information describing different types of data sources can be effectively obtained, thereby accurately determining the data source matching the task execution statement.

[0067] In an optional embodiment, in the process of determining the data source type of a data source based on the statement content of a task execution statement, the target processing system can find at least one piece of data processing information from the task execution statement, and thereby determine the data source type of the data source based on the data processing statement in the data processing information and the correspondence between the data processing statement and the data source.

[0068] Optionally, data processing statements include, but are not limited to, query statements, insert statements, and update statements. Query statements may include SELECT, JOIN, and other statements, insert statements may include INSERT INTO statements, and update statements may include UPDATE statements. The target processing system may determine a correspondence between the data processing statements and the data source based on the task execution statement, and then determine the data source type of the data source based on the correspondence between the data processing statements and the data source type.

[0069] It should be noted that by determining the data source type according to the data processing statement, the data source type is accurately determined, and the acquisition of additional data is avoided, thereby improving processing efficiency.

[0070] In an optional embodiment, the data processing information records the correspondence between the data processing statement and the temporary identifier of the data source, wherein, before determining the data source type of the data source based on the data processing statement in the data processing information and the correspondence between the data processing statement and the data source, the target processing system can find the temporary identifier recorded in the data source information from each data source information, and thereby determine the correspondence between the data processing statement and the data source based on the correspondence between the data processing statement and the temporary identifier, the data source information to which the temporary identifier belongs, and the matching relationship between the data source information and the data source.

[0071] Optionally, the target processing system can determine the matching relationship between the temporary identifier and the data source based on the data source information to which the temporary identifier belongs and the matching relationship between the data source information and the data source. For example, the above-mentioned data source No. 5 matches the temporary identifier MYSQL_SOURCE, the data source No. 1 matches the temporary identifier LOG, and the data source No. 4 matches the temporary identifier ES_SINK.

[0072] Furthermore, the target processing system can determine the correspondence between the data processing statement and the temporary identifier of the data source from the data processing information. For example, an optional data processing information is as follows:

[0073] In this data processing statement, the INSERT INTO statement matches the temporary identifier ES_SINK, the SELECT statement matches the temporary identifier LOG, and the INNER JOIN statement matches the temporary identifier MYSQL_SOURCE.

[0074] Furthermore, the target processing system can determine the correspondence between data processing statements and data sources based on the correspondence between data processing statements and temporary identifiers, and the matching relationship between temporary identifiers and data sources. For example, for the above data processing information, the INSERT INTO statement corresponds to data source 4, the SELECT statement corresponds to data source 1, and the INNER JOIN statement corresponds to data source 5.

[0075] It should be noted that, through the above process, the correspondence between the data processing statements and the data sources is accurately determined.

[0076] In an optional embodiment, in the process of determining the data source type of the data source based on the data processing statements in the data processing information and the correspondence between the data processing statements and the data sources, if the data processing statement is a query statement, the data source corresponding to the data processing statement is determined to be the input data source; if the data processing statement is an insert statement or an update statement, the data source corresponding to the data processing statement is determined to be the output data source.

[0077] For example, if the data processing statement is a SELECT, JOIN or other statement, the data source corresponding to the data processing statement is determined to be the input data source; if the data processing statement is an INSERT INTO, UPDATE or other statement, the data source corresponding to the data processing statement is determined to be the output data source.

[0078] It should be noted that by determining the data source type of the data source according to the type of the data processing statement, effective determination of the data source type is achieved.

[0079] It can be seen that the solution provided by this application achieves the purpose of locating the business risks of the target business based on the data flow relationship between data sources when the stream computing task is executed abnormally, thereby achieving the technical effect of accurately locating business risks, and further solving the technical problem of difficulty in locating business risks when problems arise in the execution of the stream computing tasks of the business in related technologies.

[0080] Example 2

[0081] According to an embodiment of the present invention, an embodiment of a device for determining business risk is provided. FIG3 is a schematic diagram of an optional device for determining business risk according to an embodiment of the present invention. As shown in FIG3 , the device includes:

[0082] The first acquisition module 301 is used to obtain a data source relationship graph of the target business. The data source relationship graph consists of nodes and directed edges. A node represents a data source associated with the target business, and a directed edge represents the data flow relationship between data sources. The data flow relationship is determined by the stream computing task under the target business. The stream computing task is used to process data in the data source.

[0083] The processing module 302 is used to determine the data source that matches the stream computing task from the data source relationship diagram when the stream computing task is executed abnormally during the execution of the target business, and locate the business risk of the target business based on the data source that matches the stream computing task.

[0084] It should be noted that the above-mentioned first acquisition module 301 and processing module 302 correspond to steps S101 to S102 in the above-mentioned embodiment. The examples and application scenarios implemented by the two modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above-mentioned embodiment 1.

[0085] Optionally, the business risk determination device also includes: a second acquisition module, used to obtain multiple task execution statements, wherein different task execution statements are used to describe different stream computing tasks under the target business; a first determination module, used to determine, for each task execution statement, the input data source and output data source matched by the task execution statement according to the statement content of the task execution statement; a construction module, used to construct a data source relationship graph based on the input data source, output data source matched by each task execution statement and the stream computing task matched by the task execution statement, wherein a directed edge points from the input data source to the output data source, and there is a corresponding relationship between the directed edge and the stream computing task.

[0086] Optionally, the first determination module also includes: a first determination sub-module, used to determine at least one data source matching the task execution statement based on the statement content of the task execution statement; a second determination sub-module, used to determine the data source type of the data source for each data source matching the task execution statement based on the statement content of the task execution statement, wherein the data source type is an input data source or an output data source.

[0087] Optionally, the first determination submodule also includes: a first search unit, used to find at least one data source information from the task execution statement; a first determination unit, used to determine, for each piece of data source information, the data source type of the data source matched by the data source information based on the connection parameters in the data source information; a parsing unit, used to parse the information other than the connection parameters in the data source information according to the parsing method of data source type matching, to obtain the identifier and storage address of the data source matched by the data source information; a second determination unit, used to determine the data source matched by the data source information based on the identifier and storage address of the data source matched by the data source information; and a third determination unit, used to determine the data sources matched by all data source information as the data sources matched by the task execution statement.

[0088] Optionally, the second determination submodule also includes: a second search unit, used to find at least one piece of data processing information from the task execution statement; a fourth determination unit, used to determine the data source type of the data source based on the data processing statement in the data processing information and the correspondence between the data processing statement and the data source.

[0089] Optionally, the business risk determination device also includes: a search module, used to find the temporary identifier recorded in the data source information from each data source information; a second determination module, used to determine the correspondence between the data processing statement and the data source based on the correspondence between the data processing statement and the temporary identifier, the data source information to which the temporary identifier belongs, and the matching relationship between the data source information and the data source.

[0090] Optionally, the fourth determination unit includes: a first determination submodule, used to determine that the data source corresponding to the data processing statement is an input data source if the data processing statement is a query statement; and a second determination submodule, used to determine that the data source corresponding to the data processing statement is an output data source if the data processing statement is an insert statement or an update statement.

[0091] Example 3

[0092] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is further provided, in which a computer program is stored. The computer program is configured to execute the above-mentioned method for determining business risk when running.

[0093] Example 4

[0094] According to another aspect of an embodiment of the present invention, an electronic device is further provided, wherein Figure 4 is a schematic diagram of an optional electronic device according to an embodiment of the present invention. As shown in Figure 4, the electronic device includes one or more processors; a memory for storing one or more programs, which, when the one or more programs are executed by one or more processors, enables the one or more processors to run the programs, wherein the programs are configured to execute the above-mentioned method for determining business risks during operation.

[0095] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages or disadvantages of the embodiments.

[0096] In the above embodiments of the present invention, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0097] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only exemplary. For example, the division of units can be a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0098] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple units. Some or all of the units may be selected to achieve the purpose of the present embodiment according to actual needs.

[0099] In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0100] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk, etc. Various media that can store program codes.

[0101] The above are only preferred embodiments of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A method for determining business risk, characterized in that: include: Obtain a data source relationship graph of the target business, wherein the data source relationship graph is composed of nodes and directed edges, a node represents a data source associated with the target business, the directed edge represents a data flow relationship between the data sources, the data flow relationship is determined by a stream computing task under the target business, and the stream computing task is used to process data in the data source; In the process of executing the target business, if the stream computing task is executed abnormally, the data source matching the stream computing task is determined from the data source relationship graph, and the business risk of the target business is located according to the data source matching the stream computing task.

2. The method according to claim 1, characterized in that The data source relationship diagram is generated in the following way: Acquire multiple task execution statements, where different task execution statements are used to describe different stream computing tasks under the target business; For each task execution statement, determining the input data source and the output data source that match the task execution statement according to the statement content of the task execution statement; The data source relationship graph is constructed according to the input data source and output data source matched by each task execution statement and the stream computing task matched by the task execution statement, wherein the directed edge points from the input data source to the output data source, and there is a corresponding relationship between the directed edge and the stream computing task.

3. The method according to claim 2, characterized in that Determining the input data source and the output data source matched by the task execution statement according to the statement content of the task execution statement includes: Determine at least one data source that matches the task execution statement according to the statement content of the task execution statement; For each data source matched by the task execution statement, the data source type of the data source is determined according to the statement content of the task execution statement, wherein the data source type is the input data source or the output data source.

4. The method according to claim 3, characterized in that Determining at least one data source matched by the task execution statement according to the statement content of the task execution statement includes: Find at least one piece of data source information from the task execution statement; For each piece of data source information, determining a data source type of a data source matched by the data source information according to connection parameters in the data source information; According to the parsing method of the data source type matching, the information in the data source information except the connection parameters is parsed to obtain the identifier and storage address of the data source matching the data source information; Determine the data source that matches the data source information according to the identifier and storage address of the data source that matches the data source information; The data sources whose data source information matches are determined as the data sources that match the task execution statement.

5. The method according to claim 3, characterized in that: Determining the data source type of the data source according to the statement content of the task execution statement includes: Find at least one piece of data processing information from the task execution statement; The data source type of the data source is determined according to the data processing statements in the data processing information and the corresponding relationship between the data processing statements and the data source.

6. The method according to claim 5, characterized in that The data processing information records a correspondence between the data processing statement and a temporary identifier of the data source, wherein before determining the data source type of the data source according to the data processing statement in the data processing information and the correspondence between the data processing statement and the data source, the method further includes: Find the temporary identifier recorded in the data source information from each data source information; The correspondence between the data processing statement and the temporary identifier is determined according to the correspondence between the data processing statement and the temporary identifier, the data source information to which the temporary identifier belongs, and the matching relationship between the data source information and the data source.

7. The method according to claim 5, characterized in that Determining the data source type of the data source according to the data processing statements in the data processing information and the corresponding relationship between the data processing statements and the data source includes: If the data processing statement is a query statement, determining that the data source corresponding to the data processing statement is the input data source; If the data processing statement is an insert statement or an update statement, it is determined that the data source corresponding to the data processing statement is the output data source.

8. A device for determining business risk, characterized in that: include: A first acquisition module is used to acquire a data source relationship graph of a target business, wherein the data source relationship graph is composed of nodes and directed edges, a node represents a data source associated with the target business, the directed edge represents a data flow relationship between the data sources, the data flow relationship is determined by a stream computing task under the target business, and the stream computing task is used to process data in the data source; A processing module is used to determine the data source matched by the stream computing task from the data source relationship diagram when the stream computing task is executed abnormally during the execution of the target business, and locate the business risk of the target business based on the data source matched by the stream computing task.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the method for determining business risk described in any one of claims 1 to 7 when running.

10. An electronic device, characterized in that: The electronic device includes one or more processors; A memory for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to run the programs, wherein the program is configured to execute the method for determining the business risk described in any one of claims 1 to 7 when running.

Citation Information

Patent Citations

  • Stream computing method, device and system

    CN107678790A

  • Fault root cause diagnosis method and device based on multilayer directed graph

    CN110493025A

  • Method and device for identifying risk problem in batch job dependency relationship

    CN113886839A

  • Data processing method, system and equipment based on Flink flow batch integration and medium

    CN116701430A

  • Data association query method and apparatus, device, and storage medium

    US20230259509A1

Cited By

  • Stream processing method and system based on graph structure and SQL (Structured Query Language) statement

    CN120849417A