CN109670081B - Method and device for processing service request - Google Patents

Method and device for processing service request Download PDF

Info

Publication number
CN109670081B
CN109670081B CN201811620772.XA CN201811620772A CN109670081B CN 109670081 B CN109670081 B CN 109670081B CN 201811620772 A CN201811620772 A CN 201811620772A CN 109670081 B CN109670081 B CN 109670081B
Authority
CN
China
Prior art keywords
configuration file
xml configuration
database operation
request
statements
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811620772.XA
Other languages
Chinese (zh)
Other versions
CN109670081A (en
Inventor
陈国杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Bank of China Ltd
Original Assignee
Bank of China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Bank of China Ltd filed Critical Bank of China Ltd
Priority to CN201811620772.XA priority Critical patent/CN109670081B/en
Publication of CN109670081A publication Critical patent/CN109670081A/en
Application granted granted Critical
Publication of CN109670081B publication Critical patent/CN109670081B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The method comprises the steps of obtaining a first XML configuration file and a second XML configuration file corresponding to a business processing request after receiving the business processing request, extracting target parameters from the business processing request by using the first XML configuration file, reading a database operation statement in the second XML configuration file and executing the database operation statement to obtain a database operation result, assembling the database operation result into a processing result return message according to the first XML configuration file, and returning the processing result return message. Compared with the existing mode of using JAVA files to operate the database, the method does not use JAVA files, but records database operation statements in the second XML configuration file, and the execution efficiency of the second XML configuration file is superior to that of JAVA files, so that the execution efficiency of the method is higher than that of the existing database operation mode.

Description

Method and device for processing service request
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a method and an apparatus for processing a service request.
Background
The service processing system can receive a service processing request sent from the outside of the system, process the request according to a preset processing logic, and return a processing result to a sender of the service processing request. A specific example is taken as an example for explanation. The bank processing system can receive a transaction detail query request sent by a user through the terminal, query related transaction detail data in the data storage system, and return the related transaction detail data to the user terminal.
Currently, the data processing logic is generally implemented by JAVA files, that is, the data processing logic is written in JAVA files, and the JAVA files are called in the processing procedure to execute the processing procedure. However, this approach is inefficient.
Disclosure of Invention
In view of this, the present application provides a method for processing a service request, so as to improve the processing efficiency of the service processing request. In addition, the application also provides a device for processing the service request, which is used for ensuring the application and the realization of the method in practice.
In order to achieve the purpose, the technical scheme provided by the application is as follows:
in a first aspect, the present application provides a method for processing a service request, including:
after receiving a service processing request, acquiring a first XML configuration file and a second XML configuration file corresponding to the service processing request; the first XML configuration file records the analysis rule of the service processing request and the assembly rule of the processing return result; the second XML configuration file records processing logic statements related to the service processing request, wherein the processing logic statements at least comprise database operation statements;
extracting target parameters from the service processing request according to the analysis rule in the first XML configuration file;
reading a database operation statement in the second XML configuration file, and transmitting the target parameter into the database operation statement for execution so as to obtain a database operation result;
according to the assembly rule in the first XML configuration file, the database operation result is assembled into a processing result return message;
and returning the processing result to return the message.
In a second aspect, the present application provides an apparatus for processing a service request, including:
the configuration file acquisition module is used for acquiring a first XML configuration file and a second XML configuration file corresponding to a service processing request after receiving the service processing request; the first XML configuration file records the analysis rule of the service processing request and the assembly rule of the processing return result; the second XML configuration file records processing logic statements related to the service processing request, wherein the processing logic statements at least comprise database operation statements;
the extraction module of the target parameter is used for extracting the target parameter from the service processing request according to the analysis rule in the first XML configuration file;
a database operation result obtaining module, configured to read a database operation statement in the second XML configuration file, and transmit the target parameter to the database operation statement for execution, so as to obtain a database operation result;
a return message assembly module, configured to assemble the database operation result into a processing result return message according to the assembly rule in the first XML configuration file;
and the return message returning module is used for returning the processing result return message.
The method comprises the steps of obtaining a first XML configuration file and a second XML configuration file corresponding to a service processing request after receiving the service processing request, wherein the first XML configuration file is used for extracting parameters and packaging results, the second XML configuration file is used for operating a database by using the parameters to obtain results, further extracting target parameters from the service processing request by using the first XML configuration file, reading database operation statements in the second XML configuration file and executing the database operation statements to obtain database operation results, assembling the database operation results into processing result return messages according to the first XML configuration file, and returning the processing result return messages. Compared with the existing mode of using JAVA files to operate the database, the method does not use JAVA files, but records database operation statements in the second XML configuration file, and the execution efficiency of the second XML configuration file is superior to that of JAVA files, so that the execution efficiency of the method is higher than that of the existing database operation mode.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a method for processing a service request provided by the present application;
FIG. 2 is an example of a second XML configuration file provided herein;
fig. 3 is a schematic structural diagram of a service request processing apparatus provided in the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described 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 of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
For facilitating understanding of the technical solution, the present application is first described with reference to an application scenario.
In the service processing scenario, a device on one side may send a service processing request to a device on the other side, and for convenience of description, a device on the sender may be referred to as a requesting device, and a device on the receiver may be referred to as a processing device. The requesting device may be a user terminal or may be another type of terminal or system.
It should be noted that, in the application scenario of the present application, a database system is generally used in a process of processing a service processing request by a processing device, that is, required service data is obtained from the database system. In addition, in order to perform a query operation of the database system, it is also necessary to extract a required query parameter from the service processing request. Therefore, it can be seen that the processing process of the processing device on the service processing request can be divided into two parts, namely, a process of extracting parameters required by query from the service processing request, and a process of operating the database by using the parameters.
The parameter extraction process of the current service processing request and the operation process of the database both depend on the processing logic written in the JAVA file, and the execution efficiency of the JAVA file is low.
The description about the process of extracting the parameters in the service processing request.
The service processing request is generally sent in a message manner, that is, the requesting device encapsulates the service processing request in a message and sends the message to the processing device. For ease of understanding, the messages are explained. A message (message) is a data unit exchanged and transmitted in the network, i.e. a data block to be sent by a station at one time. The message contains the complete service processing request information to be sent, and the message has different lengths, and the length is not limited and can be changed. The unit of network transmission is that packets, packets and frames are continuously encapsulated in the transmission process for transmission, and the encapsulation mode is to add some information segments, namely data with message headers organized in a certain format. For example, the message type, message version, message length, message entity, etc. are contained in the message. Messages are used to exchange information when making requests and responses between systems, and need to conform to well-defined formats. In addition, the application message is mostly when communication is needed among a plurality of systems, such as a bank ESB system to a gateway system to a unionpay system.
After receiving the message, the processing equipment extracts the query parameters from the service processing request by using the extraction logic written by the JAVA file. The development process of the JAVA file is complex, and the execution process requires steps such as compiling and running, which results in low execution efficiency.
Description about database operation process.
The processing of a business function typically requires the invocation of business data in a database system. The specific implementation manner is that the module for operating the database can receive a service processing request sent by an external interface, and call related service data from the database system according to the requirement of the service processing request.
A module for operating the database may be referred to as a database operation module, and in order to implement a function of processing the database, the module needs to call a database operation statement in a JAVA file written in advance, which is inefficient.
In addition, due to the complexity of the real-world business scenario, a business processing request may require multiple interactions between the database operation module and the data tables in the database system. The logic for interactive processing is contained in a JAVA file. The interactive processing logic in the file comprises the steps of assigning data obtained by the previous database operation statement to the next database operation statement, performing database connection and the like, and executing the next database operation statement to perform interactive operation with the database system again. Such repeated interaction requires both the development of database code and the development of corresponding calling logic code in JAVA files. The processing logic is not only slow in execution efficiency, but also poor in universality and low in development efficiency.
In order to solve at least one of the above technical problems, the present application provides a method flow for operating a database, which specifically includes the following steps S101 to S105, as shown in fig. 1.
S101: after receiving a service processing request, acquiring a first XML configuration file and a second XML configuration file corresponding to the service processing request; the first XML configuration file records the analysis rule of the service processing request and the assembly rule of the processing return result; and the second XML configuration file records processing logic statements related to the service processing request, wherein the processing logic statements at least comprise database operation statements.
The processing device may receive the service processing request, and after receiving the service processing request, the processing device needs to determine a corresponding XML configuration file according to the service processing request. The XML configuration files comprise two types, wherein the first XML configuration file is used for extracting target parameters and returning a processing result, and the second XML configuration file is used for operating the database. For convenience of description, the two XML configuration files are referred to as a first XML configuration file and a second XML configuration file, respectively.
Different service processing requests use different types of messages, different types of messages and different message fields, so that different first XML configuration files need to be set.
For example, a certain service processing request is a transaction detail of the current day of inquiry, and the service processing request includes fields such as a card number, an inquiry date, an encoding format and the like; the other service processing request is used for inquiring historical transaction details, and the service processing request comprises fields such as a card number, a starting date, an ending date, an encoding format and the like. The two service query requests correspond to two different first XML configuration files. It should be noted that the specific content of the message type is set according to actual requirements, and is not limited to the above-mentioned example.
In order to find the required first XML configuration file, a correspondence relationship between the identifier of the service processing request and the first XML configuration file may be set. In practical application, after receiving the service processing request, the first XML configuration file corresponding to the service processing request can be found according to the identifier of the service processing request and the corresponding relationship.
It should be noted that the number of the first XML configuration files may not be one, and may be two. The two first XML configuration files are respectively used for extracting target parameters and assembling a processing result return message.
The above is a description of the first XML configuration file, and the description of the second XML configuration file is as follows.
It will be appreciated that the database processing logic for different business process requests is different.
Firstly, the types of service processing requests are different, and the processing logic is different. For example, if a certain service processing request is a query transaction detail, a database query statement is required; another business process request is to delete a contact, then a database delete statement is needed. Furthermore, even if the same type of service processing request is used, the processing logic is different. For example, all are database query statements, but the difference in query content may result in different query logic, such as one processing logic that may include verification of the query parameters and another processing logic that does not need to verify the query parameters.
Therefore, corresponding processing logic statements can be written in advance for different business processing requests. It should be noted that, in the present application, the configuration file in XML (Extensible Markup Language) format is used to store the processing logic statement, that is, different service processing requests correspond to different second XML configuration files.
And after receiving the service processing request, determining a second XML configuration file corresponding to the received service processing request according to the corresponding relation between the service processing request and the second XML configuration file.
And processing logic statements corresponding to the service processing request are recorded in the second XML configuration file, the processing logic statements are divided into a plurality of types, and in order to realize the operation on the database, the processing logic statements at least comprise database operation statements.
The database operation statement refers to a statement for performing an operation on the database, and the operation may include various types such as query, deletion, addition, modification, and the like. The database operation statement may be embodied as an SQL (Structured Query Language) statement.
S102: and extracting the target parameters from the service processing request according to the analysis rule in the first XML configuration file.
The first XML configuration file is written according to the message fields, and the message contains the fields, so that the extraction rules of the fields can be set in the first XML configuration file.
In one example, the service processing request is encapsulated in a request message, and the parsing rule mainly includes a field sequence and a field length. The specific implementation manner of this step is to extract each message segment that conforms to the field length from the request message in sequence; and determining parameters corresponding to each message segment according to a setting rule of the field sequence, wherein the determined parameters are extracted target parameters.
Specifically, the fields in the request message are arranged in a certain order, and each field is set according to a specified length. Therefore, after receiving the request message, the request message can be split according to the field lengths, each split message segment can be regarded as each field, and then according to the stipulation of the field sequence, what field each message segment is respectively determined. The determined field is the target parameter.
For example, in an extraction rule of a request message for querying transaction details on the current day, the field sequence is as follows: card number, date and currency; the field lengths are 16, 8 and 3 respectively. After receiving a request message for transaction details on the current day, firstly extracting message fragments with the length of 16 from the message content, assuming that the message fragments are 1234567890987654, and knowing that the message fragments are card numbers according to the field sequence; extracting message segments with the lengths of 8, assuming that the message segments are 20180505, and knowing the date of the message segments according to the field sequence; and extracting message segments with the lengths of 3, assuming that the message segments are RMBs, and knowing that the message segments are currency according to the field sequence. In summary, three target parameters, which are the card number, date and currency, can be extracted from the message content. It should be noted that, in the above extraction manner, after one message segment is extracted, the parameter content corresponding to the message segment is determined, or all message segments are extracted and the parameter content corresponding to each message segment is determined respectively.
On the basis of the above, the parsing rule may further include a field type, where the field type is used to check whether the data type of the extracted target parameter conforms to the rule of the field type. If the field type of the target parameter does not accord with the rule of the preset field type, an error prompt message can be returned.
For example, the field type of an extracted certain target parameter is a card number, the field type of the card number is a number, and if the card number parameter extracted from the message includes characters, the field type specification that the type of the parameter does not conform to is indicated; for another example, if the field type of a certain extracted target parameter is date, and the date parameter extracted from the message is 20181345, the target parameter does not conform to the rule of date, the rule is four digits in year, two digits in month, and two digits in day, it can be determined that the target parameter is not legal.
The following is one example of a first XML configuration file containing parsing rules.
Figure BDA0001926820770000071
In the analysis rule, the field length is shown as a length attribute, the field name is shown as a name attribute, and the field sequence is shown as the writing sequence of the fields. According to the parsing rule, the target parameters contained in the request message can be extracted.
The extracted target parameters comprise parameter names and parameter values, and the target parameters can be used for data query in a database, and the specific process is shown as the following step.
S103: and reading the database operation statement in the second XML configuration file, and transmitting the target parameter into the database operation statement for execution so as to obtain a database operation result.
The second XML configuration file includes a database operation statement, which may be included in the tag node, the tag node of the second XML configuration file is read, the database operation statement included therein is analyzed, and the analyzed database operation statement is executed, so that a database operation result may be obtained.
It should be noted that, in practical application, each tag node in the second XML configuration file needs to be read sequentially, the database operation statement in each tag node needs to be analyzed, and the target parameter obtained in the previous step is transmitted to the database operation statement and executed.
More specifically, each database operation statement has a front-back writing sequence in the second XML configuration file, and then the database operation statements in the second XML configuration file are sequentially read and executed according to the front-back writing sequence. When the first database operation statement in the second XML configuration file is executed, the database needs to be connected, after the execution of the first database operation statement is finished, the subsequent database operation statement can be directly read and executed, and the operation needs not to be established with the database to carry out operation as in the existing operation mode of JAVA files.
S104: and according to the assembly rule in the first XML configuration file, assembling the database operation result into a processing result return message.
Wherein, the first XML configuration file sets an assembly rule of the return message, and the assembly rule may include: field order, packing format, etc.
The following is one example of a first XML configuration file containing assembly rules. In the following assembly rule, the returned fields respectively include a transaction code, a return code, return information, a total number of records, a return number of records, a customer number, a customer name, a transaction card number, a transaction account number, and an … … charging account number, the order of the fields is written as follows, and the assembly format is shown as the following name attribute and length attribute.
Figure BDA0001926820770000081
Figure BDA0001926820770000091
And after the database operation result is obtained, assembling the data operation result into a return message according to the assembly rule.
S105: and returning the processing result and returning the message.
Wherein the return message is returned to the sender of the service processing request.
According to the technical scheme, the method for operating the database is characterized in that after a service processing request is received, a first XML configuration file and a second XML configuration file corresponding to the service processing request are obtained, the first XML configuration file is used for extracting parameters and packaging results, the second XML configuration file is used for operating the database by using the parameters to obtain results, then the first XML configuration file is used for extracting target parameters from the service processing request, database operation statements in the second XML configuration file are read and executed to obtain database operation results, the database operation results are assembled into processing result return messages according to the first XML configuration file, and the processing result return messages are returned. Compared with the existing mode of using JAVA files to operate the database, the method does not use JAVA files, but records database operation statements in the second XML configuration file, and the execution efficiency of the second XML configuration file is superior to that of JAVA files, so that the execution efficiency of the method is higher than that of the existing database operation mode.
In particular, the execution speed of the second XML configuration file is better than the execution speed of the JAVA file. The reason is that the second XML configuration file is loaded into the memory, and if the query result obtained from the previous database operation statement needs to be used in the subsequent database operation statement, the query result obtained from the previous database operation statement can be directly sent to the subsequent database operation statement for use, and the query result of each database operation statement in the JAVA file does not need to be subjected to logic processing such as judgment, assignment and the like, and is used for other database operation statements after being processed.
In addition, the running process of the first XML configuration file does not need steps of compiling and executing the JAVA file and the like, so that the running efficiency is high.
In addition to the advantage in execution efficiency, the development efficiency of the second XML configuration file is also superior to that of the JAVA file. The reason is that if the logic of the business processing needs to be modified, development operations such as recompiling and packaging are needed after the JAVA file is modified. However, after the second XML configuration file is modified, these development operations need not be performed, but only the modification of the configuration file contents.
In the prior art, the workload of code development is large, and the burden of developers is increased. However, the present application may flexibly configure the processing logic of parsing, value transferring, returning the result of querying the database, etc. in the second XML configuration file according to the tag rule. A user only needs to write a second XML configuration file and introduce a response Jar package, flexible configuration can be automatically achieved, extra workload is not needed, and unnecessary development workload of developers can be greatly reduced.
The specific form of the second XML configuration file is explained below.
The second XML configuration file is composed of tag nodes, each tag node has respective processing contents, and the combination of the processing contents forms the processing logic recorded by the second XML configuration file. The processing content of the tag node can be the operation on the database, the format verification of the incoming parameter and the like. The execution mode of the second XML configuration file is that the processing contents represented by the label nodes are sequentially executed according to the writing sequence of the label nodes.
The processing logic statements in the second XML configuration file include incoming parameters, and the sources of the incoming parameters include two types, which are the service processing request and the database operation result, respectively. That is, parameters may be extracted from the business process request as incoming parameters in the database operation statement. Alternatively, the operation result of one database operation statement may serve as an incoming parameter of another database operation statement.
If the incoming parameters of the database operation statements come from the service processing request, reading the database operation statements in the second XML configuration file and executing, wherein the specific implementation mode comprises the following steps:
extracting target parameters from the service processing request; reading a database operation statement in the second XML configuration file; and transmitting the target parameters into the database operation statement as the input parameters, and executing the database operation statement with the input parameters.
The processing logic statements in the second XML configuration file may include, in addition to the above database operation statements, the following two types of statements, that is, parameter verification statements and verification result return statements.
Based on the second XML configuration file in the above form, the method for operating a database provided by the present application further includes the following steps:
reading a parameter verification statement in the second XML configuration file and executing to obtain a verification result of the target parameter; and reading the verification result return statement in the second XML configuration file and executing to return the parameter verification result.
The parameter verification statement comprises a verification rule and a parameter standard, and whether the parameter in the service processing request meets the parameter standard is verified according to the verification rule. The verification result returning statement is used for returning the verification result to the sender of the service processing request.
The form of the second XML configuration file is described below by using a specific application scenario and several examples of the second XML configuration file.
The database operation module receives a service processing request sent by the external interface, and supposing that the purpose of the service processing request is to request to inquire the bank card transaction details in a certain time period from the database. The database operation module parses the service processing request and extracts the parameters required for querying the database from the service processing request, wherein the parameters include the start date and the end date of the time period.
Taking the second XML configuration file shown in fig. 2 as an example, it is assumed that the time parameters extracted from the service processing request are STR _ DATE (start DATE of time period) and END _ DATE (END DATE of time period), the configuration file includes a tag node < ifbf >, the tag node includes a condition field, and the field indicates a judgment condition for two time parameters. The content of the judgment condition is to judge whether the format of the time parameter is inaccurate. According to the processing logic of the configuration file, if the format of the time parameter is not accurate, the content contained in the tag node < key > is returned, and the content contained in the tag node is used for indicating that the format of the time parameter is not accurate.
To supplement one point, R in the condition field in fig. 2 may be used to represent an externally incoming parameter.
It should be noted that the processing logic statement includes a statement of the type of the database operation statement, and the database query statement may be executed in various types of tag nodes.
One example is that the database query statement may be contained in an < atom > tag node.
Referring to the code example of the second XML configuration file shown below, the tag node < atom > includes a sub-tag < content >, which includes an SQL statement, i.e., a SELECT statement, representing a query.
Figure BDA0001926820770000121
To supplement one, D in the condition field of the code example above may indicate that the parameter TIME _ SCOPE is derived from the query result of other database query statements.
In another example, the database query statement may be included in the decision condition < ifbf > tag node.
Still taking the code example described above as an example, the condition field in the < ifbf > tag node may contain a database operation statement.
In yet another example, the database operation statements may also be contained in the loop class label node.
The loop class tag node refers to a tag node that loops an operation of the same process a plurality of times. The database operation statement is contained in the label node of the type, so that the same content of the database can be processed for many times.
In yet another example, the database operation statement may also be included in a text-type tag node or the like.
The text class tag node refers to a tag node containing a JAVA statement. Database operation statements may also be included in this type of tag node. For example, the JAVA statement has a function of, after obtaining all query results queried by the database operation statement from the database, selecting a part of the query results that satisfy the condition from the query results as the final returned query results.
It should be noted that, in addition to the above examples, the database operation statements may be contained in other types of tag nodes.
Regardless of which types of tag nodes the database operation statements are in, the tag nodes in the second XML configuration file are written sequentially.
In practical applications, the method for operating a database provided by the present application may further include: and verifying the second XML configuration file. Specifically, the method comprises the following steps: the step of validating the second XML configuration file may include:
and acquiring the content format rule of the second XML configuration file, and verifying whether the content format of the second XML configuration file conforms to the content format rule.
The second XML configuration file has certain content format rules, for example, what tag nodes may appear in the second XML configuration file, what the name of each tag node is, what the canonical format of the tag node is, what the fields that the tag node may contain are, what the name of the field is, what the canonical format of the field is, and so on.
Before executing the processing logic statement in the second XML configuration file, the content format of the second XML configuration file needs to be verified, and whether the content format meets the requirement of the content format rule is verified. Similarly, the first XML configuration file may be validated.
The two XML configuration files in the present application may be run and executed by the JAR package. Specifically, the JAR packet may parse the parsing rule in the first XML configuration file, extract the target parameter from the service processing request according to the parsing rule, or assemble the database operation result into the return message according to the assembly rule of the processing result return message in the first XML configuration file. The JAR package may also execute the database operation statement in the second XML configuration file to obtain a database operation result.
Referring to fig. 3, the present application provides an apparatus for operating a database, which specifically includes: a configuration file obtaining module 301, a target parameter extracting module 302, a database operation result obtaining module 303, a return message assembling module 304, and a return message returning module 305.
A configuration file obtaining module 301, configured to obtain, after receiving a service processing request, a first XML configuration file and a second XML configuration file corresponding to the service processing request; the first XML configuration file records the analysis rule of the service processing request and the assembly rule of the processing return result; the second XML configuration file records processing logic statements related to the service processing request, wherein the processing logic statements at least comprise database operation statements;
a target parameter extraction module 302, configured to extract a target parameter from the service processing request according to an analysis rule in the first XML configuration file;
a database operation result obtaining module 303, configured to read a database operation statement in the second XML configuration file, and transmit the target parameter to the database operation statement for execution, so as to obtain a database operation result;
a return message assembly module 304, configured to assemble the database operation result into a processing result return message according to the assembly rule in the first XML configuration file;
a return message returning module 305, configured to return a processing result return message.
In one example, the database operation statement comprises a plurality of pieces, each of the plurality of pieces having a front-to-back writing order in the second XML configuration file; the database operation result obtaining module is configured to read and execute the database operation statement in the second XML configuration file, and includes: and the database operation result obtaining module is specifically used for sequentially reading and executing the database operation statements in the second XML configuration file according to the front-back writing sequence.
In one example, the service processing request is encapsulated in a request message, and the parsing rule includes: field order and field length; the extracting module of the target parameter is configured to extract the target parameter from the service processing request according to the parsing rule in the first XML configuration file, and includes: the extraction module of the target parameter is specifically used for sequentially extracting message segments which are in accordance with the length of the field from the request message; and determining parameters corresponding to each message segment according to a setting rule of the field sequence, wherein the determined parameters are extracted target parameters.
In one example, processing the logical statement further comprises: parameter verification statements and verification result return statements; the apparatus further comprises: the parameter verification module is used for reading and executing the parameter verification statements in the second XML configuration file to obtain a verification result of the target parameters; and reading the verification result return statement in the second XML configuration file and executing to return the parameter verification result.
In one example, the apparatus for service request processing further includes: and the configuration file verification module is used for acquiring the content format rules of the first XML configuration file and the second XML configuration file and verifying whether the content formats of the first XML configuration file and the second XML configuration file accord with the content format rules.
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other.
It is further noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the same element.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method for service request processing, comprising:
after receiving a service processing request, obtaining a first XML configuration file corresponding to the service processing request according to a preset corresponding relation between the service processing request and the first XML configuration file; acquiring a second XML configuration file corresponding to the service processing request according to a preset corresponding relation between the service processing request and the second XML configuration file; the first XML configuration file records an analysis rule of a service processing request and an assembly rule of a processing return result; the second XML configuration file records processing logic statements related to the service processing request, wherein the processing logic statements at least comprise database operation statements;
extracting target parameters from the service processing request according to the analysis rule in the first XML configuration file;
reading a database operation statement in the second XML configuration file, and transmitting the target parameter into the database operation statement for execution so as to obtain a database operation result;
according to the assembly rule in the first XML configuration file, the database operation result is assembled into a processing result return message;
and returning the processing result to return the message.
2. The method of claim 1, wherein the database operation statement comprises a plurality of database operation statements, each database operation statement having a front-to-back writing order in the second XML configuration file;
reading and executing the database operation statements in the second XML configuration file, wherein the reading and executing comprise:
and sequentially reading and executing the database operation statements in the second XML configuration file according to the front-back writing sequence.
3. The method of claim 1, wherein the service request is encapsulated in a request message, and the parsing rule comprises: field order and field length;
then, said extracting the target parameter from the service processing request according to the parsing rule in the first XML configuration file includes:
extracting message segments which accord with the length of the field from the request message in sequence;
and determining parameters corresponding to each message segment according to a setting rule of the field sequence, wherein the determined parameters are extracted target parameters.
4. The method of service request processing of claim 1, wherein processing the logical statement further comprises: parameter verification statements and verification result return statements; the method further comprises:
reading and executing the parameter verification statements in the second XML configuration file to obtain a verification result of the target parameters;
and reading a verification result return statement in the second XML configuration file and executing to return a parameter verification result.
5. The method of service request processing according to claim 1, further comprising: a step of verifying the first XML configuration file and the second XML configuration file;
the verification of the first XML configuration file and the second XML configuration file specifically includes:
and acquiring content format rules of the first XML configuration file and the second XML configuration file, and verifying whether the content formats of the first XML configuration file and the second XML configuration file conform to the content format rules.
6. An apparatus for service request processing, comprising:
the configuration file acquisition module is used for acquiring a first XML configuration file corresponding to a service processing request according to a preset corresponding relation between the service processing request and the first XML configuration file after receiving the service processing request; acquiring a second XML configuration file corresponding to the service processing request according to a preset corresponding relation between the service processing request and the second XML configuration file; the first XML configuration file records an analysis rule of a service processing request and an assembly rule of a processing return result; the second XML configuration file records processing logic statements related to the service processing request, wherein the processing logic statements at least comprise database operation statements;
the extraction module of the target parameter is used for extracting the target parameter from the service processing request according to the analysis rule in the first XML configuration file;
a database operation result obtaining module, configured to read a database operation statement in the second XML configuration file, and transmit the target parameter to the database operation statement for execution, so as to obtain a database operation result;
a return message assembly module, configured to assemble the database operation result into a processing result return message according to the assembly rule in the first XML configuration file;
and the return message returning module is used for returning the processing result return message.
7. The apparatus for service request processing according to claim 6, wherein the database operation statement comprises a plurality of database operation statements, each database operation statement having a front-to-back writing sequence in the second XML configuration file;
the database operation result obtaining module is configured to read and execute the database operation statement in the second XML configuration file, and includes:
and the database operation result obtaining module is specifically configured to sequentially read and execute the database operation statements in the second XML configuration file according to the front-back writing sequence.
8. The apparatus of claim 6, wherein the service request is encapsulated in a request message, and wherein the parsing rule comprises: field order and field length;
the target parameter extracting module is configured to extract the target parameter from the service processing request according to the parsing rule in the first XML configuration file, and includes:
the extraction module of the target parameter is specifically used for sequentially extracting message segments which are in accordance with the length of the field from the request message; and determining parameters corresponding to each message segment according to a setting rule of the field sequence, wherein the determined parameters are extracted target parameters.
9. The apparatus of claim 6, wherein the processing logic statement further comprises: parameter verification statements and verification result return statements; the apparatus further comprises:
the parameter verification module is used for reading and executing the parameter verification statements in the second XML configuration file to obtain a verification result of the target parameters; and reading the verification result return statement in the second XML configuration file and executing to return the parameter verification result.
10. The apparatus for service request processing according to claim 6, further comprising:
and the configuration file verification module is used for obtaining the content format rules of the first XML configuration file and the second XML configuration file and verifying whether the content formats of the first XML configuration file and the second XML configuration file accord with the content format rules.
CN201811620772.XA 2018-12-28 2018-12-28 Method and device for processing service request Active CN109670081B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811620772.XA CN109670081B (en) 2018-12-28 2018-12-28 Method and device for processing service request

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811620772.XA CN109670081B (en) 2018-12-28 2018-12-28 Method and device for processing service request

Publications (2)

Publication Number Publication Date
CN109670081A CN109670081A (en) 2019-04-23
CN109670081B true CN109670081B (en) 2021-02-02

Family

ID=66146538

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811620772.XA Active CN109670081B (en) 2018-12-28 2018-12-28 Method and device for processing service request

Country Status (1)

Country Link
CN (1) CN109670081B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110719296B (en) * 2019-10-25 2022-11-22 福建网能科技开发有限责任公司 Method for automatically analyzing message data in terminal communication protocol
CN111124479B (en) * 2019-12-18 2024-03-22 北京像素软件科技股份有限公司 Method and system for analyzing configuration file and electronic equipment
CN111464608A (en) * 2020-03-30 2020-07-28 山东浪潮通软信息科技有限公司 Message processing method and device
CN111553652B (en) * 2020-04-23 2023-10-27 中国银行股份有限公司 Service processing method and device
CN112286907A (en) * 2020-10-26 2021-01-29 中信百信银行股份有限公司 Database configuration method and device, electronic equipment and readable storage medium
CN112506481A (en) * 2020-12-01 2021-03-16 数字广东网络建设有限公司 Service data interaction method and device, computer equipment and storage medium
CN112769863B (en) * 2021-01-26 2021-11-16 北京树米网络科技有限公司 Method and device for processing service request message data, electronic equipment and readable storage medium
CN115292624B (en) * 2022-10-08 2023-08-04 成都同步新创科技股份有限公司 General message processing method and device based on HTTP protocol

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7908317B2 (en) * 2007-06-07 2011-03-15 Oracle International Corporation System and method for URL compression
CN101634982A (en) * 2008-07-24 2010-01-27 国际商业机器公司 Method and system used for verifying XML document
CN102073534B (en) * 2011-02-24 2014-07-30 深圳市同洲电子股份有限公司 Data analysis method and device
CN107622091B (en) * 2017-08-23 2020-11-13 创新先进技术有限公司 Database query method and device

Also Published As

Publication number Publication date
CN109670081A (en) 2019-04-23

Similar Documents

Publication Publication Date Title
CN109670081B (en) Method and device for processing service request
CN104699718B (en) Method and apparatus for being rapidly introduced into business datum
CN101246486B (en) Method and apparatus for improved process of expressions
US7865525B1 (en) High efficiency binary encoding
CN110445860B (en) Message sending method, device, terminal equipment and storage medium
CN103294652B (en) A kind of data transfer device and system
CN111552838B (en) Data processing method and device, computer equipment and storage medium
CN114500690B (en) Interface data processing method and device, electronic equipment and storage medium
CN101009516A (en) A method and system for data synchronization
CN110602056A (en) Service parameter transmission method and device
US20070156737A1 (en) Application integration systems and methods
CN109413131A (en) A kind of method and device of log parsing
CN110020243A (en) Querying method, device, Internet of Things server and the storage medium of internet of things data
CN107040613A (en) A kind of message transmitting method and system
CN103646015B (en) Transmission, the method and system for receiving and transmitting XML message
CN111324645B (en) Block chain data processing method and device
CN110839022A (en) Vehicle-mounted control software communication protocol analysis method based on xml language
CN113239039B (en) Dynamic data storage method, query method, management method and management system
CN113836145B (en) Method, device, electronic equipment and computer readable storage medium for requesting data
CN114138877A (en) Method, device and equipment for realizing theme data service based on micro-service architecture
CN113608889A (en) Message data processing method, device, equipment and storage medium
CN102314406A (en) The method and system that is used for the lazy data sequenceization of compunication
KR20210128096A (en) Apparatus and method for interworking among internet of things platforms
CN111447156A (en) Data exchange method and device, electronic equipment and storage medium
CN111125110B (en) Non-primary key field checking method, device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant