Detailed Description
In order to make those skilled in the art better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be described in detail below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all embodiments. All other embodiments that can be derived from the embodiments given herein by a person of ordinary skill in the art are intended to be within the scope of the present disclosure.
The platform design has the advantage that different service function modules can reuse the capability of the platform, thereby reducing the development and maintenance cost. On the other hand, however, once the configuration on the platform changes, the services running on the platform may theoretically be affected. In order to reduce the workload of subsequent tests, it is necessary to perform further screening on the possibly affected services. In many current platform systems, the configuration of the platform is directly applied to each service processing module, and the maintenance information of the service dimension is lacking in the configuration of the platform, that is, after a certain configuration on the platform is changed, it cannot be directly located which services running on the platform may be affected.
In order to solve the above problems, a direct solution is to add service dimensional maintenance information in the platform, but this method requires modification of the existing platform design, and is not practical for many systems already deployed and operated on a large scale. Therefore, at present, most manual judgment methods are adopted to position services that may be affected by platform configuration change, and the manual judgment methods also have great limitations: taking the third-party payment system as an example, according to actual business requirements, one third-party payment mechanism needs to access hundreds of banks and needs to process different businesses of the banks. Under the platform design architecture, for a third-party payment system, the multiplexing of the services of different banks to the platform capability can be realized only by adding corresponding service instance configurations (such as the online payment service of a worker bank, the credit card repayment service of a rural bank and the like) aiming at the services of different banks. However, once the platform configuration of the third-party payment system is changed, the possibly affected business needs to be manually located from various specific businesses of various banks, which is not only inefficient and requires a large amount of labor cost, but also is difficult to avoid the situations of misjudgment and missed judgment, and if the platform configuration is updated frequently, the above problem is more serious.
In view of the foregoing problems, the present application provides a method for positioning services of a platform-based system, and fig. 1 shows a flowchart of the method for positioning services of a platform-based system, where the method includes the following steps:
s101, obtaining platform configuration change information;
the platform configuration change information at least includes: changed data record information; specifically, the following may be mentioned: one or more rows of data records of a certain data table are changed, one or more rows of data records of a certain specific field of a certain table are changed, and the like. In addition, the platform configuration change information may further include systems, modules, and the like related to the change, and the present application is not limited thereto.
S102, inquiring whether a record matched with the changed data record is contained in the associated data corresponding to any service;
s103, determining whether the service is influenced by the platform configuration change according to the query result: if the service associated data contains a record matched with the changed data record, determining the service as the service influenced by the change of the platform configuration;
according to the scheme, the platform configuration and the specific service are associated in a mode of constructing service associated data, so that after the platform configuration is changed, whether the service is influenced by the change of the platform configuration can be automatically judged by inquiring the service associated data.
In actual application, for each concerned service, corresponding service-related data may be constructed (a construction method of the service-related data will be described in an embodiment later), after platform configuration is changed, for a specific service, according to an obtained changed data record, it is queried whether a record matching the changed data record is included in the corresponding service-related data, and if so, it is described that the service is affected by the change of the platform configuration. After the above processing is respectively performed on all concerned services, which services can be screened out to be influenced by the configuration change of the platform.
The service associated data is irrelevant to the operation logic of the original service on the platform, and the normal operation of the platform service cannot be influenced. The service associated data can be constructed in the normal operation stage of the platform and can be directly called after the configuration of the platform is changed; the service related data can also be dynamically constructed according to the actual change condition of the platform configuration, namely the service related data is constructed as required after the configuration change information is obtained, so that the storage overhead in the normal operation stage of the platform is reduced.
Fig. 2 is a flowchart of a method for constructing service related data, and for a certain service that needs attention, the corresponding method for constructing service related data may include the following steps:
s201, determining an associated data table of a service information table according to a service information field needing attention and the service information table to which the field belongs;
according to actual requirements, the "service needing attention" can be a very specific service, such as "industrial and commercial bank credit card repayment service"; the service can also be a general name of a class of services, such as "industrial and commercial banking service" (specifically including industrial and commercial bank credit card payment service, industrial and commercial bank online payment service, etc.), "credit card payment service" (specifically including industrial and commercial bank credit card payment service, agricultural bank credit card payment service, etc.), and when the service is actually applied, the service which needs to be paid attention "can be flexibly defined according to the field design condition of the service information table and the attention requirement.
S202, constructing an association query instruction by taking the service information table and the associated data table thereof as a query source table, and the association between the service information table and the associated data table thereof and the value of the service information field as query conditions;
wherein, the value of the service information field is used for appointing a specific service; the service information field can be one or more fields according to actual requirements, and under the condition that the service information field is a plurality of fields, joint values of the fields are adopted when the query condition is constructed.
For each specific service, if the service information table corresponds to a plurality of associated data tables, there may be a plurality of feasible associated query instruction construction schemes according to the association condition between the data tables, for example: only one associated query instruction capable of covering all associated data tables may be constructed, or a plurality of associated query instructions may be constructed for a plurality of associated data tables, respectively.
For example, for the service information table 0, there are associated data table1 and associated data table2, where table 0 is directly associated with table1, table 0 is directly associated with table2, and table1 is directly associated with table2. Then when constructing the association query instruction, if it is desired to preferentially select a construction scheme with fewer association query instructions, an association query instruction can be constructed based on "table 0-table 1-table 2"; if it is desired to prefer a construction scheme with a shorter associated path: two associated query instructions may be constructed based on "table 0-table 1" and "table 0-table 2", respectively. Of course, in practical applications, the association between tables may be more complex, and those skilled in the art can flexibly construct the association query instruction according to the practical situation.
S203, executing the associated query instruction, and taking the query result as service associated data.
The step can be executed in a 'pre-construction' stage, and the associated query instruction result of each service is stored so as to be directly called after the platform configuration is changed. In addition, in the stage of "pre-construction", only the associated query instruction corresponding to each service may be constructed and stored, and after the configuration change information is obtained, the pre-constructed associated query instruction is called and executed as required, so as to obtain the service associated data.
The following describes the scheme of the present application with reference to a specific application example:
fig. 3 is a schematic diagram of a specific application scenario of the present application, where a third party payment platform is a part designed in a platform, and when a platform configuration is changed, the changed content is sent out in a "configuration change event" form. The configuration change analyzer is used for inquiring whether a record matched with the changed data record is contained in the associated data corresponding to any service, so that the configuration change event is analyzed into a standard event, and the service related to the platform configuration change is further tested or adjusted subsequently. The following describes the standard events defined in this embodiment:
configuration change event: the function is equivalent to "platform configuration change information" in the foregoing embodiment, and refers to a message sent after a configuration change occurs on a platform, and details of the current change, such as a system, a database, a table field, and the like related to the change, are recorded in the message.
Standard events: a standardized format is defined in the business dimension. Because the subsequent testing and adjustment requirements are service dimensional (for example, corresponding test cases need to be matched according to specific services), and the configuration change is database table record dimensional, the configuration change at a certain time can be associated with the specific services by using standard events as intermediaries.
In this example, 2 fields are defined mainly for "standard events": service metadata, service metadata value:
business NAME BIZ _ NAME: the name of the type of service (e.g., credit card payment, online payment, etc.);
service instance BIZ _ KEYWORD: service instance keys under the service type (e.g., ICBC, ABC, etc.).
It should be noted that the above field definitions of the standard events are only used for illustration, and should not be construed as a limitation to the scheme of the present application.
In order to implement the function of the configuration change parser (i.e. change of a database record, and analyze a service that may be affected through a certain modeling), firstly, service-related data needs to be constructed, and it is assumed that there are 3 data tables, table1, table2, and table3, in the platform, where:
table1 contains the fields:
id
table2_id
table3_id
table2 contains the fields:
id
url
table3 contains the fields:
id
BIZ_NAME
BIZ_KEYWORD
if the "service needing attention" corresponding to the actual requirement is "all service types", it may be determined that the service information field needing attention is "BIZ _ NAME", table3 is a service information table, and tables 1 and 2 are associated data tables of the service information table. Assume that the platform currently supports two traffic types: service a and service B, then service association data may be constructed for service a and service B, respectively.
1. Service A:
defining sql _ a as service associated data of service a, constructing an associated query instruction for obtaining sql _ a by using a service information table (table3) and associated data tables (table1, table2) as query source tables, and using association between the service information table and its associated data table (table1 and table2 are associated through a table2_ id field, table1 and table3 are associated through a table3_ id field), and value of the service information field (BIZ _ NAME of table3 ═ service a') as query conditions as follows:
sql_A=
SELECT t1.id,t2.id,t2.url,t3.id,t3.BIZ_NAME,t3.BIZ_KEYWORD
FROM table1t1,table2t2,table3t3
WHERE t1.table2_ id ═ t2.id AND t1.table3_ id ═ t3.id AND t3.biz _ NAME ═ service a'
2. And B, service B:
defining sql _ B as service related data of service B, constructing an associated query instruction for obtaining sql _ B by using a service information table (table3) and associated data tables (table1, table2) as query source tables, and using association between the service information table and its associated data table (table1 and table2 are associated through a table2_ id field, table1 and table3 are associated through a table3_ id field), and value of the service information field (BIZ _ NAME of table3 ═ service B') as query conditions as follows:
sql_B=
SELECT t1.id,t2.id,t2.url,t3.id,t3.BIZ_NAME,t3.BIZ_KEYWORD
FROM table1t1,table2t2,table3t3
WHERE t1.table2_ id ═ t2.id AND t1.table3_ id ═ t3.id AND t3.biz _ NAME ═ service B'
It should be noted that the above sql code is only used for illustrative purposes and should not be construed as limiting the scope of the present application.
According to the built sql _ A and sql _ B, when the platform configuration is changed, whether the change affects the service A and the service B can be determined by respectively inquiring whether the sql _ A and the sql _ B contain records matched with the changed data records.
For example, when a record (table2.id ═ xxx) in table2 is changed, sql is assembled and searched in sql _ a and sql _ B, respectively:
sql _ a' ═ sql _ a + t2.id ═ xxx "; // corresponding service A
sql _ B ═ sql _ B + t2.id ═ xxx "; // corresponding service B
Taking the service a as an example, if data can be retrieved through sql _ a', it is indicated that the current platform configuration change will affect the service a. Otherwise, if the data can not be retrieved through the sql _ a, it can be judged that the platform configuration change has no influence on the service a.
For the retrieved data, data of two fields of the service NAME BIZ _ NAME and the service instance BIZ _ KEYWORD can be obtained, and standard events can be generated through the two fields of data. And the service classification information and the service instance information are utilized to generate standard events. According to the standard events, the corresponding test case can be matched, such as the business of online payment of industry, the business of credit card repayment of agricultural departments, and the like, so as to further test or adjust the corresponding business.
Corresponding to the above method embodiment, the present application further provides a service positioning apparatus of a platform-based system, as shown in fig. 4, the apparatus may include:
a change information obtaining module 110, configured to obtain platform configuration change information, where the platform configuration change information at least includes: changed data record information;
the query module 120 is configured to query whether a record matching the changed data record is included in the associated data corresponding to any service;
a positioning module 130, configured to determine, when the service related data includes a record matching the changed data record, the service as a service affected by the change in the platform configuration;
an association data construction module 140 for:
determining an associated data table of a service information table according to a service information field needing attention and the service information table to which the field belongs;
constructing an association query instruction by taking the service information table and the associated data table thereof as a query source table, taking the association of the service information table and the associated data table thereof and the value of the service information field as query conditions, wherein the value of the service information field is used for specifying a specific service;
and executing the association query instruction, and taking a query result as service association data.
In a specific embodiment of the present application, the associated data constructing module 140 may be specifically configured to:
the service associated data is constructed in advance,
or
And after the configuration change information is obtained, business associated data is constructed as required.
In a specific embodiment of the present application, the associated data constructing module 140 may be specifically configured to:
and after the configuration change information is obtained, executing a pre-constructed association query instruction as required to obtain service association data.
In a specific embodiment of the present application, the associated data constructing module 140 may be specifically configured to:
and constructing an associated query instruction covering all associated data tables aiming at each specific service.
In one embodiment of the present application, the service information field may include one field or a plurality of fields; and under the condition that the service information field comprises a plurality of fields, the value of the service information field is the joint value of the fields.
From the above description of the embodiments, it is clear to those skilled in the art that the present application can be implemented by software plus necessary general hardware platform. Based on such understanding, the technical solutions of the present application may be essentially or partially implemented in the form of a software product, which may be stored in a storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments or some parts of the embodiments of the present application.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus embodiment, since it is substantially similar to the method embodiment, it is relatively simple to describe, and reference may be made to some descriptions of the method embodiment for relevant points. The above-described apparatus embodiments are merely illustrative, and the modules described as separate components may or may not be physically separate, and the functions of the modules may be implemented in one or more software and/or hardware when implementing the solution of the present application. And part or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
The foregoing is directed to embodiments of the present application and it is noted that numerous modifications and adaptations may be made by those skilled in the art without departing from the principles of the present application and are intended to be within the scope of the present application.