Data processing method, electronic device and storage medium

文档序号:1963711 发布日期:2021-12-14 浏览:19次 中文

阅读说明:本技术 数据处理方法、电子设备及存储介质 (Data processing method, electronic device and storage medium ) 是由 安继贤 李晶 晋晓峰 盛勤 于 2021-09-29 设计创作,主要内容包括:本发明公开了一种数据处理方法、电子设备及存储介质,数据处理方法包括:从第一业务相关的业务系统对应的业务数据表中,获取所述第一业务对应的第一数据关系表中每个字段对应的第一字段值和第二字段值;所述第一数据关系表表征第一业务对应的入参字段在每个相关的业务系统对应的业务数据表中对应的字段;第一字段值和第二字段值分别为业务系统响应所述第一业务的第一处理请求前后的字段值;基于所述第一数据关系表中每个字段对应的第一字段值和第二字段值,确定出字段值发生变更的第一字段;输出关于所述第一业务的第一信息,所述第一信息表征入参字段在所述第一数据关系表中对应的所有第一字段、以及每个第一字段对应的第一字段值和第二字段值。(The invention discloses a data processing method, an electronic device and a storage medium, wherein the data processing method comprises the following steps: acquiring a first field value and a second field value corresponding to each field in a first data relation table corresponding to a first service from a service data table corresponding to a service system related to the first service; the first data relation table represents a field corresponding to a parameter entry field corresponding to a first service in a service data table corresponding to each related service system; the first field value and the second field value are field values before and after a first processing request of a service system responding to the first service respectively; determining a first field with a changed field value based on a first field value and a second field value corresponding to each field in the first data relation table; and outputting first information about the first service, wherein the first information represents all first fields corresponding to the reference fields in the first data relation table, and a first field value and a second field value corresponding to each first field.)

1. A data processing method, comprising:

acquiring a first field value and a second field value corresponding to each field in a first data relation table corresponding to a first service from a service data table corresponding to a service system related to the first service; the first data relation table represents a field corresponding to a parameter entry field corresponding to a first service in a service data table corresponding to each related service system; the first field value and the second field value are field values before and after a first processing request of a service system responding to the first service respectively;

determining a first field with a changed field value based on a first field value and a second field value corresponding to each field in the first data relation table;

and outputting first information about the first service, wherein the first information represents all first fields corresponding to the reference fields in the first data relation table, and a first field value and a second field value corresponding to each first field.

2. The method of claim 1, further comprising:

and outputting the service logic corresponding to the first service based on the input parameter in the first processing request and the first information.

3. The method according to claim 1 or 2, wherein in building the first data relationship table, the method comprises:

acquiring a Structured Query Language (SQL) statement executed by a business system in the process of executing a test case corresponding to a first business from the business system related to the first business;

determining a second field relevant to the test case and a corresponding field value in each business data table corresponding to each business system by analyzing all the obtained SQL sentences;

determining each group of fields with the same field value based on the parameter fields and the corresponding field values in the test case and the determined fields and the corresponding field values; each group of fields comprises a parameter field and a second field;

and constructing a first data relation table based on each group of determined fields.

4. The method according to claim 3, wherein when the second field and the corresponding field value related to the test case in each business data table corresponding to each business system are determined by analyzing all the obtained SQL statements, the method includes:

cutting the SQL sentence according to the blank space to obtain a first array;

determining a statement type corresponding to the SQL statement based on a first string in the first array and a set character string corresponding to the set statement type;

and extracting the identification of the business data table, the field corresponding to the statement type and the field value from the first array based on the determined statement type and the corresponding set analysis strategy.

5. The method of claim 4, wherein extracting the identifier of the business data table, the field corresponding to the corresponding statement type, and the field value from the first array comprises:

extracting the identifier of the business data table from the first array based on the determined statement type and the corresponding first set analysis strategy;

and extracting fields and corresponding field values contained in the business data table from the first array based on the determined statement types and the corresponding second set analysis strategies.

6. The method of claim 5, wherein extracting the identification of the service data table from the first array comprises one of:

determining the word string corresponding to the set index value in the first array as the identifier of the business data table under the condition that the SQL statement is an insert statement, an update statement or a delete statement;

and under the condition that the SQL statement is the query statement, determining a first string in the first array after the first set string as the identifier of the business data table.

7. The method according to claim 5, wherein the extracting the fields and the corresponding field values included in the service data table from the first array comprises:

under the condition that the SQL statement is an insert statement, determining multiple groups of fields and field values based on a first group of strings and a second group of strings which are connected by adopting a second set string in the first array;

under the condition that the SQL statement is an updating statement, determining at least two groups of fields and field values from the first array based on the equal sign in the first array and the position of the third set string;

and under the condition that the SQL statement is a deletion statement or a query statement, determining a group of fields and field values representing the execution condition based on the position of the equal sign in the first array.

8. An electronic device, comprising:

an obtaining unit, configured to obtain, from a service data table corresponding to a service system related to a first service, a first field value and a second field value corresponding to each field in a first data relationship table corresponding to the first service; the first data relation table represents a field corresponding to a parameter entry field corresponding to a first service in a service data table corresponding to each related service system; the first field value and the second field value are field values before and after a first processing request of a service system responding to the first service respectively;

the determining unit is used for determining a first field with a changed field value based on a first field value and a second field value corresponding to each field in the first data relation table;

and the output unit is used for outputting first information about the first service, wherein the first information represents all first fields corresponding to the reference fields in the first data relation table, and a first field value and a second field value corresponding to each first field.

9. An electronic device, comprising: a processor and a memory for storing a computer program capable of running on the processor,

wherein the processor is adapted to perform the steps of the method of any one of claims 1 to 7 when running the computer program.

10. A storage medium having a computer program stored thereon, the computer program, when being executed by a processor, realizing the steps of the method of any one of claims 1 to 7.

Technical Field

The present invention relates to the field of computer technologies, and in particular, to a data processing method, an electronic device, and a storage medium.

Background

With the development of computer technology, more and more technologies, such as Blockchain (Blockchain), big data, distributed, etc., are applied in the financial field, and the traditional financial industry is gradually shifting to financial technology, however, the financial technology also puts higher demands on the technologies due to the requirements of security and real-time performance of the financial industry. In the field of financial science and technology, developers arrange relevant information of a data table related to a corresponding service from source codes corresponding to the service related to the big data application in the process of developing the big data application. However, there is a problem that the sorted data is missing or erroneous.

Disclosure of Invention

In view of this, embodiments of the present invention provide a data processing method, an electronic device, and a storage medium, so as to solve the technical problem of omission or error of the sorted data in the related art.

In order to achieve the purpose, the technical scheme of the invention is realized as follows:

the embodiment of the invention provides a data processing method, which comprises the following steps:

acquiring a first field value and a second field value corresponding to each field in a first data relation table corresponding to a first service from a service data table corresponding to a service system related to the first service; the first data relation table represents a field corresponding to a parameter entry field corresponding to a first service in a service data table corresponding to each related service system; the first field value and the second field value are field values before and after a first processing request of a service system responding to the first service respectively;

determining a first field with a changed field value based on a first field value and a second field value corresponding to each field in the first data relation table;

and outputting first information about the first service, wherein the first information represents all first fields corresponding to the reference fields in the first data relation table, and a first field value and a second field value corresponding to each first field.

In the above scheme, the method further comprises:

and outputting the service logic corresponding to the first service based on the input parameter in the first processing request and the first information.

In the above scheme, when constructing the first data relationship table, the method includes:

acquiring SQL sentences executed by a business system in the process of executing a test case corresponding to a first business from the business system related to the first business;

determining a second field relevant to the test case and a corresponding field value in each business data table corresponding to each business system by analyzing all the obtained SQL sentences;

determining each group of fields with the same field value based on the parameter fields and the corresponding field values in the test case and the determined fields and the corresponding field values; each group of fields comprises a parameter field and a second field;

and constructing a first data relation table based on each group of determined fields.

In the above solution, when the second field and the corresponding field value related to the test case in each service data table corresponding to each service system are determined by analyzing all the obtained SQL statements, the method includes:

cutting the SQL sentence according to the blank space to obtain a first array;

determining a statement type corresponding to the SQL statement based on a first string in the first array and a set character string corresponding to the set statement type;

and extracting the identification of the business data table, the field corresponding to the statement type and the field value from the first array based on the determined statement type and the corresponding set analysis strategy.

In the above scheme, the extracting the identifier of the service data table, the field corresponding to the statement type, and the field value from the first array includes:

extracting the identifier of the business data table from the first array based on the determined statement type and the corresponding first set analysis strategy;

and extracting fields and corresponding field values contained in the business data table from the first array based on the determined statement types and the corresponding second set analysis strategies.

In the foregoing scheme, the extracting the identifier of the service data table from the first array includes one of:

determining the word string corresponding to the set index value in the first array as the identifier of the business data table under the condition that the SQL statement is an insert statement, an update statement or a delete statement;

and under the condition that the SQL statement is the query statement, determining a first string in the first array after the first set string as the identifier of the business data table.

In the above scheme, the extracting fields and corresponding field values included in the service data table from the first array includes:

under the condition that the SQL statement is an insert statement, determining multiple groups of fields and field values based on a first group of strings and a second group of strings which are connected by adopting a second set string in the first array;

under the condition that the SQL statement is an updating statement, determining at least two groups of fields and field values from the first array based on the equal sign in the first array and the position of the third set string;

and under the condition that the SQL statement is a deletion statement or a query statement, determining a group of fields and field values representing the execution condition based on the position of the equal sign in the first array.

An embodiment of the present invention further provides an electronic device, including:

an obtaining unit, configured to obtain, from a service data table corresponding to a service system related to a first service, a first field value and a second field value corresponding to each field in a first data relationship table corresponding to the first service; the first data relation table represents a field corresponding to a parameter entry field corresponding to a first service in a service data table corresponding to each related service system; the first field value and the second field value are field values before and after a first processing request of a service system responding to the first service respectively;

the determining unit is used for determining a first field with a changed field value based on a first field value and a second field value corresponding to each field in the first data relation table;

and the output unit is used for outputting first information about the first service, wherein the first information represents all first fields corresponding to the reference fields in the first data relation table, and a first field value and a second field value corresponding to each first field.

An embodiment of the present invention further provides an electronic device, including: a processor and a memory for storing a computer program capable of running on the processor,

wherein the processor is configured to execute the steps of the data processing method when the computer program is executed.

An embodiment of the present invention further provides a storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the data processing method.

In the embodiment of the invention, a first field value and a second field value corresponding to each field in a first data relation table corresponding to a first service are obtained from a service data table corresponding to a service system related to the first service; determining a first field with a changed field value based on a first field value and a second field value corresponding to each field in the first data relation table; and outputting first information about the first service, wherein the first information represents all first fields corresponding to the reference fields in the first data relation table, and a first field value and a second field value corresponding to each first field. The first data relation table represents a field corresponding to a parameter entry field corresponding to a first service in a service data table corresponding to each related service system; the first field value and the second field value are field values before and after a first processing request of the service system responding to the first service respectively. Therefore, the first information output by the electronic equipment can reflect the business data table related to the first business, the related fields in the business data table and the data change relation of the fields, the related information of the business data table related to the business is determined without manually analyzing the business source codes, and the efficiency and the accuracy of obtaining the data related to the first business can be improved.

Drawings

Fig. 1 is a schematic flow chart illustrating an implementation of a data processing method according to an embodiment of the present invention;

fig. 2 is a schematic flow chart illustrating an implementation of constructing a first data relationship table in the data processing method according to the embodiment of the present invention;

fig. 3 is a schematic diagram of acquiring an SQL statement executed by a business system according to an embodiment of the present invention;

fig. 4 is a schematic diagram of an implementation flow for determining fields and field values in a first data relationship table according to an embodiment of the present invention;

FIG. 5 is a flowchart illustrating an implementation of determining fields and field values in a first data relationship table according to another embodiment of the present invention;

FIG. 6 is a diagram illustrating a first data relationship diagram according to an embodiment of the present invention;

FIG. 7 is a diagram illustrating a second data relationship diagram according to an embodiment of the present invention;

FIG. 8 is a schematic diagram of an implementation flow of a data processing method according to an embodiment of the present invention;

FIG. 9 is a diagram illustrating a data processing method according to an embodiment of the present invention;

fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present invention;

fig. 11 is a schematic diagram of a hardware component structure of an electronic device according to another embodiment of the present invention.

Detailed Description

In the related art, during the process of developing a big data application, or during the process of compiling a test case of a big data application, a developer needs to know the processing process of a business related to the big data application, for example, a related business data table, a field related in the business data table, data processing logic, and the like. Since these information are not usually recorded in the actual development requirement document or test requirement document, the developer or tester needs to communicate with the service developer to sort out the related information of the data table related to the corresponding service, such as the name of the service data table, the field information related to the corresponding service in the service data table, and the field in which the data is changed, from the source code corresponding to the service related to the big data application. However, there is a problem that the sorted data is missing or erroneous.

Based on this, an embodiment of the present invention provides a data processing method, where a first field value and a second field value corresponding to each field in a first data relationship table corresponding to a first service are obtained from a service data table corresponding to a service system related to the first service; determining a first field with a changed field value based on a first field value and a second field value corresponding to each field in the first data relation table; and outputting first information about the first service, wherein the first information represents all first fields corresponding to the reference fields in the first data relation table, and a first field value and a second field value corresponding to each first field. The first data relation table represents a field corresponding to a parameter entry field corresponding to a first service in a service data table corresponding to each related service system; the first field value and the second field value are field values before and after a first processing request of the service system responding to the first service respectively. Therefore, the first information output by the electronic equipment can reflect the business data table related to the first business, the related fields in the business data table and the data change relation of the fields, the related information of the business data table related to the business is determined without manually analyzing the business source codes, and the efficiency and the accuracy of obtaining the data related to the first business can be improved.

In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

Fig. 1 is a schematic diagram of an implementation process of a data processing method according to an embodiment of the present invention, where an execution subject of the process is an electronic device such as a terminal and a server. As shown in fig. 1, the data processing method includes:

step 101: acquiring a first field value and a second field value corresponding to each field in a first data relation table corresponding to a first service from a service data table corresponding to a service system related to the first service; the first data relation table represents a field corresponding to a parameter entry field corresponding to a first service in a service data table corresponding to each related service system; the first field value and the second field value are field values before and after a first processing request of the service system responding to the first service respectively.

Before sending a first processing request of a first service to a service system related to the first service, acquiring a first data relation table corresponding to the first service; the first data relation table represents the corresponding field of the parameter-entering field corresponding to the first service in the service data table corresponding to each related service system. The entry field refers to a field corresponding to an input parameter of the first service.

Under the condition that a first data relation table corresponding to a first service is obtained and before a first processing request of the first service is sent to a service system related to the first service, the electronic equipment searches all service data tables related to the first service from a database based on the identification of the service data table contained in the first data relation table; and determining a first field value of a field corresponding to the parameter entry field corresponding to the first service in the corresponding service data table from each searched service data table based on the fields contained in the first data relation table.

The electronic equipment sends a first processing request of a first service to a service system related to the first service under the condition that all first field values are obtained, and determines a second field value of a field corresponding to a parameter field corresponding to the first service in a corresponding service data table based on a first data relation table after the service system related to the first service successfully responds to the first processing request. Wherein, a service system corresponds to at least one service data table. The first processing request comprises an entry field and a corresponding field value of the first service. For example, in the case of a first business representation transfer, the first entry field is the name of the transfer person, and the field value of the first entry field is the queen; the second parameter field is a account number of the account number, and the field value of the second parameter field is a string of numbers representing the account number; the third input field is the name of the payee, and the field value of the third input field is plumes; the fourth parameter field is a payee account, and the field value of the fourth parameter field is a string of numbers representing the account; the fifth field is a transfer amount, and the field value of the fifth field is a specific amount.

In actual application, the electronic device constructs a corresponding Structured Query Language (SQL) statement based on the entry field and the corresponding field value included in the first processing request; and inquiring a second field value of a field corresponding to the parameter-entering field corresponding to the first service in the corresponding service data table from the service data table based on the constructed SQL statement and the first data relation table.

It should be noted that the number of the service systems related to the first service may be one, or may be at least two; the at least two business systems may be independent or integrated. When at least two business systems exist independently, all related business systems cooperate to process a first business, and the electronic equipment sends a first processing request of the first business to the business system which starts the processing flow of the first business.

It should be noted that the first data relation table is obtained based on a Structured Query Language (SQL) statement executed by calling a related function in the database driver during the process of processing the first service by the service system related to the first service. It should be noted that the first data relationship table may be constructed by an electronic device executing the data processing method, or may be constructed by another electronic device.

The SQL sentences executed by the business system are extracted by the set tracking sentences inserted in the source codes driven by the database in the business system. And setting the tracking statement to be used for extracting the SQL statement executed by the corresponding business system in the process of processing the first business, and setting the tracking statement to be Java byte codes. In practical applications, a set trace statement is inserted before an execution statement of a database function, for example, in a database driver of a mySQL database, the database statement is executed mainly by three functions, namely, execute query and execute update, in the com.

In some embodiments, before sending a first processing request of a first service to a service system related to the first service, an electronic device constructs a first data relationship table corresponding to the first service; as shown in fig. 2, in constructing the first data relationship table, the method includes:

step 201: and acquiring SQL sentences executed by the business system in the process of executing the test case corresponding to the first business from the business system related to the first business.

Here, the electronic device sends a corresponding test instruction to the service system related to the first service based on the test case corresponding to the first service, and acquires, from the service system related to the first service, an SQL statement executed by the service system in the process of executing the received test instruction. Wherein the content of the first and second substances,

the SQL statements executed by the service system may be actively reported to the electronic device sending the test instruction by the device running the service system, or may be requested to the service system by the electronic device.

The test case is used for testing the function related to the first service in the service system. The test case comprises information such as case identification, service scene, case parameters and the like. The service scenario characterizes the service type, e.g. transfer. The use case identifier is used for the business system to output the use case identifier and the corresponding SQL statement in an associated mode. The use case parameters include input parameters and output parameters. The test command includes at least an input parameter. Taking account transfer as an example, the input parameters include: account name of the transfer person, account number of the transfer person, name of the payee, account number of the payee, transfer amount and the like.

The test instruction carries a case identifier. In practical application, the use case identifier carried by the test instruction is set according to a communication Protocol type, for example, when the communication Protocol is a hypertext Transfer Protocol (HTTP), the use case identifier (testcase id) may be: 1005.

as shown in fig. 3, in practical application, a user triggers the electronic device to run a test case corresponding to a first service, and the electronic device sends a test instruction to a service system related to the first service based on the test case, where the test instruction carries a case identifier. And the equipment corresponding to the business system extracts the case identification at the system inlet of the business system, captures the SQL operation executed by the business system in the process of executing the test instruction related to the test case, and associates and outputs the extracted case identification and all SQL sentences corresponding to the SQL operation. The electronic equipment acquires a use case identifier and an SQL (structured query language) statement which are output in a device correlation mode and correspond to the service system; and based on the case identification, the related parameters of the test case and the SQL statement are stored in an associated manner, so that the related parameters corresponding to the same test case and the SQL statement are stored in an associated manner. The SQL operation on the business data table mainly comprises the following steps: query, delete, insert, modify, etc.

Step 202: and determining a second field relevant to the test case and a corresponding field value in each business data table corresponding to each business system by analyzing all the obtained SQL sentences.

Under the condition that all SQL sentences executed by each service system related to the first service are obtained, the electronic equipment analyzes each obtained SQL sentence to obtain a second field related to the test case and a corresponding field value in each service data table corresponding to each service system. The SQL statement comprises the name or identification of the business data table, the field and the corresponding field value.

In order to improve the efficiency and accuracy of parsing the SQL statements and thus improve the accuracy of the data in the first data relation table, each SQL statement is parsed according to the flow shown in fig. 4. As shown in fig. 4, in some embodiments, when the second field and the corresponding field value related to the test case in each business data table corresponding to each business system are determined by analyzing all obtained SQL statements, the method includes:

step 401: and cutting the SQL statement according to the blank space to obtain a first array.

Here, the electronic device cuts the SQL statement according to the space included in the SQL statement, and obtains a first array. Each SQL statement corresponds to a first array; the first array includes a plurality of word strings (or referred to as word segmentations), and may further include punctuation marks, such as parentheses, commas, and the like. The cut string may be composed of a single character string or two character strings connected by a set connector. Each string includes at least one character. For example, the first array corresponding to the insert sentence does not include an equal sign, but includes a bracket and a comma; the update statement, the delete statement and the query statement all include at least one equal sign, and do not include brackets.

Step 402: and determining the statement type corresponding to the SQL statement based on the first string in the first array and the set character string corresponding to the set statement type.

Here, considering that in practical applications, the first string in the SQL statement represents the statement type to which the SQL statement belongs, the first string in the first array is compared with the setting strings corresponding to the set statement types, and the set statement type corresponding to the setting string matching the first string is determined as the statement type to which the SQL statement belongs. The setting string is a set character string.

The set statement types comprise an insertion statement, an update statement, a deletion statement and a query statement. For example, the setting string corresponding to the insert statement is insert, the setting string corresponding to the update statement is update, the setting string corresponding to the delete statement is delete, and the setting string corresponding to the query statement is select.

Step 403: and extracting the identification of the business data table, the field corresponding to the statement type and the field value from the first array based on the determined statement type and the corresponding set analysis strategy.

The set statement type corresponds to the set analysis strategy one by one, and the set analysis strategy represents and analyzes the corresponding method for setting the statement type.

Here, the electronic device determines a set analysis policy corresponding to a statement type to which the SQL statement belongs based on a set correspondence relationship between the set statement type and the set analysis policy, and extracts the identifier of the service data table, the field corresponding to the corresponding statement type, and the field value from the first array corresponding to the SQL statement according to the determined set analysis policy.

It should be noted that, because the insert statement usually has no execution condition, and the update statement, the delete statement, and the query statement usually have execution conditions, the corresponding fields of the insert statement are all conventional fields that have no execution condition; the corresponding fields of the update statement, the delete statement and the query statement comprise condition fields for representing execution conditions.

In the scheme, the electronic equipment analyzes the SQL statement according to the statement type, so that the identification of the business data table contained in the SQL statement, the field corresponding to the statement type and the field value are determined, and the analysis efficiency and accuracy of the SQL statement can be improved.

In consideration of the different characteristics of the SQL statements of different statement types, the methods for parsing the SQL statements of different statement types are also different. In order to improve the accuracy of the parsing result of the SQL statement, as shown in fig. 5, in some embodiments, the extracting the identifier of the business data table, the field corresponding to the statement type, and the field value from the first array includes:

step 501: and extracting the identifier of the business data table from the first array based on the determined statement type and the corresponding first set analysis strategy.

The electronic equipment determines a method for analyzing the identifier of the business data table based on a first set analysis strategy corresponding to the statement type to which the SQL statement belongs; and extracting the identifier of the business data table from the first array according to the determined method for analyzing the identifier of the business data table.

Each type of the setting statement corresponds to a first setting analysis strategy and a second setting analysis strategy. The first set analysis strategy represents a method for analyzing the identification of the business data table, and the second set analysis strategy represents a method for analyzing the field and the field value in the business data table. The first set parsing policy is set according to a distribution characteristic of the identifier of the service data table in the corresponding statement type, for example, according to a position of the identifier of the service data table in the SQL statement of the corresponding statement type, or according to a string adjacent to the identifier of the service data table in the SQL statement. And setting the second set analysis strategy based on the distribution characteristics of the fields and the field values in the SQL statement of the corresponding statement type.

It should be noted that the first setting analysis policies corresponding to different setting statement types may be the same or different.

For example, in the insertion statement insert _ tbl _ test (field1, field 2.., field) valid (xx, xx, xx... xxx), the third string corresponds to the identity of the service data table; in the update statement update table tbl _ xx set fieldx xx, the third string corresponds to the identifier of the service data table; in the delete statement tbl _ xx where field xx is xx, the third string corresponds to the id of the business data table, and in the query statement select field1 and field2 from tbl _ xx where field1 is xx, the id of the business data table is located after from, so the first set analysis policies corresponding to the insert statement, the update statement, and the delete statement are all the same, and the first set analysis policy corresponding to the query statement is different from the first set analysis policies corresponding to the insert statement, the update statement, and the delete statement.

In consideration of the fact that the distribution characteristics of the identifiers of the business data tables in the SQL statements of different statement types are different, the method for extracting the identifiers of the business data tables in the SQL statements of different statement types is also the same. In order to extract the identification of the service data table more quickly and accurately, in some embodiments, the extracting the identification of the service data table from the first array includes one of:

determining the word string corresponding to the set index value in the first array as the identifier of the business data table under the condition that the SQL statement is an insert statement, an update statement or a delete statement;

and under the condition that the SQL statement is the query statement, determining a first string in the first array after the first set string as the identifier of the business data table.

Here, when the SQL statement is an insert statement, an update statement, or a delete statement, the electronic device extracts a string corresponding to the set index value from the first array, where the string corresponding to the set index value is an identifier of the service data table; wherein, the set index value represents the arrangement sequence number of the string in the first array. In actual application, the index value is set to 3 in consideration that the identifier of the service data table is arranged in the third place in the insert statement, the update statement, and the delete statement.

Considering that the identifier of the business data table in the query statement is located after from, in the case that the SQL statement is the query statement, the first string in the first array after the first set string is determined as the identifier of the business data table, and the first set string is from.

Step 502: and extracting fields and corresponding field values contained in the business data table from the first array based on the determined statement types and the corresponding second set analysis strategies.

Here, the electronic device determines a method for analyzing the field and the field value based on a second set analysis policy corresponding to the statement type to which the SQL statement belongs, and extracts all the fields and the corresponding field values from the first array according to the determined method for analyzing the field and the field values.

Considering that the distribution characteristics of fields and field values in SQL sentences of different sentence types are different, aiming at different sentence types, different analysis strategies are adopted to extract the fields and the field values in the SQL sentences, so that the accuracy of the analyzed fields and the field values is faster and more accurate. In some embodiments, the extracting, from the first array, the fields and the corresponding field values included in the service data table includes:

under the condition that the SQL statement is an insert statement, determining multiple groups of fields and field values based on a first group of strings and a second group of strings which are connected by adopting a second set string in the first array;

under the condition that the SQL statement is an updating statement, determining at least two groups of fields and field values from the first array based on the equal sign in the first array and the position of the third set string; wherein the first set of fields and field values characterize an execution condition of the update statement;

and under the condition that the SQL statement is a deletion statement or a query statement, determining a group of fields and field values representing the execution condition based on the position of the equal sign in the first array.

Wherein the second setting string is valus and the third setting string is where.

Here, considering that a field in the insert statement is located in parentheses before valus and a field value is located in parentheses after valus, in the case where the SQL statement is the insert statement, the electronic device may identify a second set string, for example, valus, from the first array, determine all strings in the first parentheses before the second set string in the first array as a first string, each string in the first string being a field; determining all the strings in the second parentheses after the second set string in the first array as a second group of strings, each string in the second group of strings being a field value; and determining a field value corresponding to each field based on the arrangement sequence number corresponding to each word string in the first group of word strings and the second group of word strings to obtain a plurality of groups of fields and field values. Wherein the first and second brackets each include a left bracket and a right bracket. Fields and field values at the same sort order number are a group. For example, the first string of the second string is the field value corresponding to the first string of the first string.

In actual application, the inserted statement has no execution condition, and under the condition that the SQL statement is the inserted statement, each field and the corresponding field value are determined from the first array in the following manner:

traversing a first array corresponding to an inserted statement, removing left brackets, commas and right brackets, extracting fields one by one until values are met, and stopping extracting the fields, wherein each string in the brackets corresponds to one field;

continuously traversing the first array corresponding to the inserted statement, removing left brackets, commas and right brackets behind values, extracting field values one by one, and ending the traversal; wherein, each string in the brackets corresponds to a field value;

according to the arrangement sequence, the fields and the field values are corresponding to obtain a plurality of groups of fields and field values of a first type, wherein the fields and the field values of the first type are expressed as follows: fild [0], Fild [1], Fild [2] and valve [2 ]. The first type of field is a regular field and there is no execution condition.

Considering that the update statement characterizes the case that the execution condition after the where is satisfied, the update operation is performed on the corresponding data table based on the set of fields and field values before the where, i.e., the set of fields and field values after the where is the execution condition of the set of fields and field values before the where, therefore, the third string is set as the where. In the case that the SQL statement is an update statement, identifying a third set string in the first array; determining two word strings connected by a first equal number in the first array as a group of fields of a second type and field values; determining two word strings connected by a second equal sign in the first array as a group of fields of a second type and field values; wherein the first index is located before the third predetermined string, and the second index is located after the third predetermined string; the set of fields and field values corresponding to the second equal sign characterize the execution condition of the update statement. In practical application, a set of fields and field values corresponding to the second equal sign may be placed in each set of fields and field values corresponding to all the first equal signs, so as to distinguish execution conditions.

In actual application, when the SQL statement is an update statement, at least two groups of fields and field values are determined from the first array in the following manner:

traversing a first array corresponding to the update statement, removing sets and commas in the first array, and extracting fields and Field values one by one, namely, taking a string before an equal sign as a Field, and taking a string after the equal sign as a Field value corresponding to the Field before the equal sign to form a group of Field and Field value pairs of a first type, for example, Field [0] value0 and Field [1] value1, until a where is encountered;

continuously traversing the first array corresponding to the update statement, removing commas, and extracting the condition fields and the corresponding field values one by one, wherein the word strings positioned behind the where and before the equal sign are taken as the condition fields, the word strings positioned behind the equal sign are taken as the field values corresponding to the condition fields before the equal sign, a group of second type fields and field values are obtained, and the traversal is finished; the field of the second type is a condition field, and the field of the second type and the corresponding field value are execution conditions of the update statement. The condition field and corresponding field values are expressed as: con _ Field [0] Con _ value0, Con _ Field [1] Con _ value 1.

Considering that in the deleted statement and the query statement, the field after the where and the corresponding field value are the execution conditions of the corresponding SQL statement, only the condition field and the corresponding field value are extracted for the deleted statement and the query statement, and the field after the where and the corresponding field value are connected by the equal sign, therefore, in the case that the SQL statement is the deleted statement or the query statement, the string before the equal sign in the first array is determined as the field, the string after the equal sign is determined as the field value corresponding to the field before the equal sign, and a group of fields and field values representing the execution conditions is obtained, that is, a group of fields and field values of the second type is obtained.

In actual application, when the SQL statement is a delete statement, traversing a first array corresponding to the delete statement, removing a where string and an and string, using a string before the equal sign as a Field, and using a string after the equal sign as a Field value corresponding to a Field before the equal sign, to form a set of Field and Field value pairs of a second type, for example, Con _ Field [0] ═ Con _ value 0; and finishing the traversal.

In actual application, when an SQL statement is a query statement, a first array corresponding to the query statement is traversed, when where is encountered, fields are extracted one by one, and when an equal sign is traversed, a Field before the equal sign and a Field value after the equal sign are matched to form a set of condition fields and Field values, for example, a Field Con _ Field [0] ═ Con _ value 0; and finishing the traversal.

In practical application, after the step 501 and the step 502 are executed, the identifier of each service data table, the field information of the first type and the field information of the second type included in the service data table may be output in a table form, as shown in the following table:

name of service data table table_name
Field information of a first type Field0:value0、field1:value1…
Second type field information con_Field0:con_value0、con_field1:con_value1…

Step 203: determining each group of fields with the same field value based on the parameter fields and the corresponding field values in the test case and the determined fields and the corresponding field values; each set of fields includes a parameter field and a second field.

Here, the electronic device compares the field value corresponding to the entry field in the test case with the field value corresponding to the parsed field, so as to determine each group of fields with the same field value, where each group of fields includes the entry field and the second field.

For example, the entry fields and corresponding field values included in the test case include:

from _ name: the small king;

from_card_no:XX123456xx11。

parameters obtained by analyzing the SQL statement comprise:

Tbl_1

name is Xiaowang;

car_no:XX123456xx11。

each group of fields with the same determined field value comprises:

From_name->Tbl_1:Name;

from_card_no->Tbl_1:car_no。

step 204: and constructing a first data relation table based on each group of determined fields.

And constructing a first data relation table based on the determined parameter field and the second field in each group of fields, the identifier of the service data table to which the second field belongs in each group of fields and the identifier of the service system corresponding to the service data table.

In actual application, the first data relationship diagram shown in fig. 6 may be output based on the relevant information of the test case and the constructed first data relationship table. In fig. 6, the name, phone number, and parameter fields are all use case parameters of the test case; the system A and the system B are both business systems in the first data relation table; there is a correspondence relationship between the contents of the arrow connections in fig. 6.

Step 102: and determining a first field with a changed field value based on the first field value and the second field value corresponding to each field in the first data relation table.

Here, the electronic device compares a first field value and a second field value corresponding to each field in the first data relationship table, and determines a first field with a changed field value. When a first field value and a second field value corresponding to the same field are the same, the field value representing the field is not changed; when the first field value and the second field value corresponding to the same field are different, the field value representing the field is changed.

Step 103: and outputting first information about the first service, wherein the first information represents all first fields corresponding to the reference fields in the first data relation table, and a first field value and a second field value corresponding to each first field.

Here, the electronic device outputs first information corresponding to the first service based on the first field in which the field value is changed, the entry field corresponding to the first field, the first field value and the second field value corresponding to the first field, and the service data table to which the first field belongs. That is, the first information includes the data change relationship of the first field corresponding to the entry field.

In actual application, a second data relationship diagram as shown in fig. 7 may be output, and the first fields in which the field values in fig. 7 are changed include field1 and field2 in table 1 in system a, field2 in table 2 in system a, field2 in table 1 in system B, and field1 in table 2 in system B. Wherein the content of the first and second substances,

in system a, the first field value of field1 in table 1 is X, and the corresponding second field value is Y, i.e., the field value of this field is changed from X to Y.

The first field value of field2 in table 1 in system a is C, and the corresponding second field value is G.

The first field value of field2 in table 2 in system a is E, and the corresponding second field value is F.

In system B, the first field value of field2 in table 1 is a, and the corresponding second field value is B.

The first field value of field1 in table 2 in system B is H, and the corresponding second field value is J.

Considering that when the service system processes the first service according to the service logic corresponding to the first service, the field value of the relevant field in the corresponding service data table may change, that is, the data change relationship of the relevant field in the service data table may reflect the service logic corresponding to the first service. The related personnel can deduce the business logic corresponding to the first business based on the first information output by the electronic equipment.

For example, taking account transfer as an example, before account transfer, the account information of the queen and the plum in the account table (business data table) is as follows:

after the King transfers 100 Yuan to the plum, the account table data is as follows:

name (I) Account number Amount of money
King of small XX01 X-100
Plum XX02 Y+100

Under the condition of transferring money, a first field relevant to transferring money is money, a first field value of a first field corresponding to the King is X, and a second field value is X-100; the first field value of the first field corresponding to the small plum is Y, the second field value is Y +100, and the first information output by the electronic equipment comprises the first field value and the second field value of the first field corresponding to the small royal jelly and the first field value and the second field value of the first field corresponding to the small plum; and the relevant personnel can obtain the business logic corresponding to the transfer by analyzing the first information.

It should be noted that, relevant personnel may query the first data relationship table corresponding to the first service through the first information of the first service, obtain a field related to the first service through the first data relationship table, and determine a data change relationship corresponding to the first field through a first field value and a second field value corresponding to the first field in the first data relationship table, thereby obtaining the data processing logic of the first field.

In the embodiment of the invention, a first field value and a second field value corresponding to each field in a first data relation table corresponding to a first service are obtained from a service data table corresponding to a service system related to the first service; determining a first field with a changed field value based on a first field value and a second field value corresponding to each field in the first data relation table; and outputting first information about the first service, wherein the first information represents all first fields corresponding to the reference fields in the first data relation table, and a first field value and a second field value corresponding to each first field. The first data relation table represents a field corresponding to a parameter entry field corresponding to a first service in a service data table corresponding to each related service system; the first field value and the second field value are field values before and after a first processing request of the service system responding to the first service respectively. Therefore, the first information output by the electronic equipment can reflect the business data table related to the first business, the related fields in the business data table and the data change relation of the fields, the related information of the business data table related to the business is determined without manually analyzing the business source codes, and the efficiency and the accuracy of obtaining the data related to the first business can be improved.

In order to facilitate the relevant personnel to know the service logic corresponding to the first service, in some embodiments, after step 103, the method further includes: and outputting the service logic corresponding to the first service based on the input parameter in the first processing request and the first information.

The electronic equipment compares the first field value corresponding to each first field and the corresponding second field value one by one based on the first field value and the second field value corresponding to each first field in all the first fields related to the same input parameter to obtain the data change relation of each first field; determining the data processing logic of the corresponding first field according to the data change relation of each first field; determining processing logic corresponding to the corresponding input parameters based on the data processing logic of all the first fields and the dependency relationship between the first fields; and summarizing the processing logic corresponding to each input parameter corresponding to the first service to obtain the service logic corresponding to the first service.

In the scheme, the electronic device can output the service logic corresponding to the first service, so that relevant personnel can check the service logic corresponding to the first service conveniently, and because the relevant personnel do not need to manually analyze the data related to the first service to obtain the service logic corresponding to the first service, the time consumed by manually analyzing the relevant data is saved, and the efficiency of the relevant personnel for obtaining the service logic can be improved.

Fig. 8 is a schematic flow chart of an implementation of a data processing method according to an application embodiment of the present invention, as shown in fig. 8, the data processing method includes:

step 801: and acquiring SQL sentences executed by the business system in the process of executing the test case corresponding to the first business from the business system related to the first business.

The timing process of step 801 refers to the related description of step 201, which is not repeated herein.

Step 802: and determining a second field relevant to the test case and a corresponding field value in each business data table corresponding to each business system by analyzing all the obtained SQL sentences.

The timing process of step 802 refers to the related description of step 202, which is not repeated herein.

Step 803: determining each group of fields with the same field value based on the parameter fields and the corresponding field values in the test case and the determined fields and the corresponding field values; each set of fields includes a parameter field and a second field.

The timing process of step 803 please refer to the related description of step 203, which is not repeated herein.

Step 804: constructing a first data relation table based on each group of determined fields; and the first data relation table represents the corresponding field of the parameter-entering field corresponding to the first service in the service data table corresponding to each related service system.

The timing process of step 804 refers to the related description of step 204, which is not repeated herein.

Step 805: acquiring a first field value and a second field value corresponding to each field in a first data relation table corresponding to a first service from a service data table corresponding to a service system related to the first service; the first field value and the second field value are field values before and after a first processing request of the service system responding to the first service respectively.

The timing process of step 805 refers to the related description of step 101, which is not repeated herein. In actual application, the electronic device obtains the first field value and the second field value according to the flowchart shown in fig. 9.

Step 806: and determining a first field with a changed field value based on the first field value and the second field value corresponding to each field in the first data relation table.

The timing process of step 806 refers to the related description of step 102, which is not repeated herein.

Step 807: and outputting first information about the first service, wherein the first information represents all first fields corresponding to the reference fields in the first data relation table, and a first field value and a second field value corresponding to each first field.

The timing process of step 807 refers to the related description of step 103, which is not repeated herein.

In order to implement the method according to the embodiment of the present invention, an embodiment of the present invention further provides an electronic device, as shown in fig. 10, where the electronic device includes:

an obtaining unit 101, configured to obtain, from a service data table corresponding to a service system related to a first service, a first field value and a second field value corresponding to each field in a first data relationship table corresponding to the first service; the first data relation table represents a field corresponding to a parameter entry field corresponding to a first service in a service data table corresponding to each related service system; the first field value and the second field value are field values before and after a first processing request of a service system responding to the first service respectively;

a determining unit 102, configured to determine, based on a first field value and a second field value corresponding to each field in the first data relationship table, a first field in which a field value is changed;

an output unit 103, configured to output first information about the first service, where the first information represents all first fields corresponding to the reference field in the first data relationship table, and a first field value and a second field value corresponding to each first field.

In some embodiments, the output unit 103 is further configured to: and outputting the service logic corresponding to the first service based on the input parameter in the first processing request and the first information.

In some embodiments, the electronic device further comprises a construction unit for:

acquiring SQL sentences executed by a business system in the process of executing a test case corresponding to a first business from the business system related to the first business;

determining a second field relevant to the test case and a corresponding field value in each business data table corresponding to each business system by analyzing all the obtained SQL sentences;

determining each group of fields with the same field value based on the parameter fields and the corresponding field values in the test case and the determined fields and the corresponding field values; each group of fields comprises a parameter field and a second field;

and constructing a first data relation table based on each group of determined fields.

In some embodiments, the building unit is specifically configured to:

cutting the SQL sentence according to the blank space to obtain a first array;

determining a statement type corresponding to the SQL statement based on a first string in the first array and a set character string corresponding to the set statement type;

and extracting the identification of the business data table, the field corresponding to the statement type and the field value from the first array based on the determined statement type and the corresponding set analysis strategy.

In some embodiments, the building unit is specifically configured to:

extracting the identifier of the business data table from the first array based on the determined statement type and the corresponding first set analysis strategy;

and extracting fields and corresponding field values contained in the business data table from the first array based on the determined statement types and the corresponding second set analysis strategies.

In some embodiments, the building unit is specifically configured to: extracting the identification of the service data table from the first array by any one of the following methods:

determining the word string corresponding to the set index value in the first array as the identifier of the business data table under the condition that the SQL statement is an insert statement, an update statement or a delete statement;

and under the condition that the SQL statement is the query statement, determining a first string in the first array after the first set string as the identifier of the business data table.

In some embodiments, the building unit is specifically configured to:

under the condition that the SQL statement is an insert statement, determining multiple groups of fields and field values based on a first group of strings and a second group of strings which are connected by adopting a second set string in the first array;

under the condition that the SQL statement is an updating statement, determining at least two groups of fields and field values from the first array based on the equal sign in the first array and the position of the third set string;

and under the condition that the SQL statement is a deletion statement or a query statement, determining a group of fields and field values representing the execution condition based on the position of the equal sign in the first array.

In practical applications, the obtaining Unit 101, the determining Unit 102, the output Unit 103 and the constructing Unit may be implemented by a Processor in an electronic device, such as a Central Processing Unit (CPU), a Digital Signal Processor (DSP), a Micro Control Unit (MCU), or a Programmable Gate Array (FPGA).

It should be noted that: in the above embodiment, when performing data processing, the electronic device is only illustrated by dividing the program modules, and in practical applications, the processing may be distributed to different program modules according to needs, that is, the internal structure of the apparatus is divided into different program modules to complete all or part of the processing described above. In addition, the electronic device and the data processing method provided by the above embodiments belong to the same concept, and specific implementation processes thereof are described in the method embodiments for details, which are not described herein again.

Based on the hardware implementation of the program module, in order to implement the method according to the embodiment of the present invention, an embodiment of the present invention further provides an electronic device. Fig. 11 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present invention, and as shown in fig. 11, the electronic device 11 includes:

a communication interface 111 capable of performing information interaction with other devices such as network devices and the like;

and the processor 112 is connected with the communication interface 111 to implement information interaction with other devices, and is used for executing the data processing method provided by one or more of the above technical solutions when running a computer program. And the computer program is stored on the memory 113.

Of course, in practice, the various components in the electronic device 11 are coupled together by the bus system 114. It will be appreciated that the bus system 114 is used to enable communications among the components. The bus system 114 includes a power bus, a control bus, and a status signal bus in addition to a data bus. For clarity of illustration, however, the various buses are labeled as bus system 114 in FIG. 11.

The memory 113 in the embodiments of the present invention is used to store various types of data to support the operation of the electronic device 11. Examples of such data include: any computer program for operating on the electronic device 11.

It will be appreciated that the memory 113 can be either volatile memory or nonvolatile memory, and can include both volatile and nonvolatile memory. Among them, the nonvolatile Memory may be a Read Only Memory (ROM), a Programmable Read Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), a magnetic random access Memory (FRAM), a Flash Memory (Flash Memory), a magnetic surface Memory, an optical disk, or a Compact Disc Read-Only Memory (CD-ROM); the magnetic surface storage may be disk storage or tape storage. Volatile Memory can be Random Access Memory (RAM), which acts as external cache Memory. By way of illustration and not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), Enhanced Synchronous Dynamic Random Access Memory (Enhanced DRAM), Synchronous Dynamic Random Access Memory (SLDRAM), Direct Memory (DRmb Access), and Random Access Memory (DRAM). The memory 113 described in connection with the embodiments of the invention is intended to comprise, without being limited to, these and any other suitable types of memory.

The method disclosed by the above-mentioned embodiments of the present invention can be applied to the processor 112, or implemented by the processor 112. The processor 112 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 112. The processor 112 described above may be a general purpose processor, a DSP, or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like. Processor 112 may implement or perform the methods, steps, and logic blocks disclosed in embodiments of the present invention. A general purpose processor may be a microprocessor or any conventional processor or the like. The steps of the method disclosed by the embodiment of the invention can be directly implemented by a hardware decoding processor, or can be implemented by combining hardware and software modules in the decoding processor. The software modules may be located in a storage medium located in the memory 113, and the processor 112 reads the program in the memory 113 and performs the steps of the aforementioned methods in conjunction with its hardware.

Optionally, when the processor 112 executes the program, the corresponding process implemented by the terminal in each method according to the embodiment of the present invention is implemented, and for brevity, no further description is given here.

In an exemplary embodiment, the embodiment of the present invention further provides a storage medium, i.e. a computer storage medium, specifically a computer readable storage medium, for example, including a first memory 113 storing a computer program, which is executable by a processor 112 of a terminal to perform the steps of the foregoing method. The computer readable storage medium may be Memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface Memory, optical disk, or CD-ROM.

In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described device embodiments are merely illustrative, for example, the division of the unit is only a logical functional division, and there may be other division ways in actual implementation, such as: multiple units or components may be combined, or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the coupling, direct coupling or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or units may be electrical, mechanical or other forms.

The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed on a plurality of network units; some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.

In addition, all the functional units in the embodiments of the present invention may be integrated into one processing module, or each unit may be separately used as one unit, or two or more units may be integrated into one unit; the integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.

Those of ordinary skill in the art will understand that: all or part of the steps for implementing the method embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer readable storage medium, and when executed, the program performs the steps including the method embodiments; and the aforementioned storage medium includes: a mobile storage device, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.

The technical means described in the embodiments of the present invention may be arbitrarily combined without conflict.

It should be noted that the term "and/or" in the embodiment of the present invention is only an association relationship describing an associated object, and indicates that three relationships may exist, for example, a and/or B may indicate: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the term "at least one" herein means any combination of any one or more of a plurality, for example, including at least one of A, B, C, and may mean including any one or more elements selected from the group consisting of A, B and C.

The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.

25页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:并行处理方法、系统、电子设备及计算机可读介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!