CN115396525A - Data interaction method and device based on service template mapping - Google Patents

Data interaction method and device based on service template mapping Download PDF

Info

Publication number
CN115396525A
CN115396525A CN202211035555.0A CN202211035555A CN115396525A CN 115396525 A CN115396525 A CN 115396525A CN 202211035555 A CN202211035555 A CN 202211035555A CN 115396525 A CN115396525 A CN 115396525A
Authority
CN
China
Prior art keywords
service
request
data
response
standard
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.)
Granted
Application number
CN202211035555.0A
Other languages
Chinese (zh)
Other versions
CN115396525B (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.)
Shanghai Clinbrain Information Technology Co Ltd
Original Assignee
Shanghai Clinbrain Information Technology Co 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 Shanghai Clinbrain Information Technology Co Ltd filed Critical Shanghai Clinbrain Information Technology Co Ltd
Priority to CN202211035555.0A priority Critical patent/CN115396525B/en
Publication of CN115396525A publication Critical patent/CN115396525A/en
Application granted granted Critical
Publication of CN115396525B publication Critical patent/CN115396525B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/08Protocols for interworking; Protocol conversion
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)

Abstract

The embodiment of the invention discloses a data interaction method and device based on service template mapping. The method comprises the following steps: acquiring a service request sent by a request terminal, wherein the service request comprises service request data and service request address information; determining a target service type according to the service request address information, and determining a target message type according to the service request data; determining a target service template based on the target service type, and determining standard request parameter information corresponding to the service request based on the mapping relation between the target message type and the target service template; based on the standard request parameter information, extracting and processing the format of effective request data in the service request data to generate standard request data; based on the response to the standard request data, service response data is generated and returned. By the technical scheme of the embodiment of the invention, interconnection service can be realized, and the service response speed and flexibility are improved.

Description

Data interaction method and device based on service template mapping
Technical Field
The embodiment of the invention relates to computer technology, in particular to a data interaction method and device based on service template mapping.
Background
With the rapid development of computer technology, system transformation or expansion of a service system is often required to realize interconnection. For example, each business system in a hospital can be modified to realize interconnection of data inside the hospital.
At present, data interaction logic of each service system is usually modified based on an interworking protocol, so as to perform data interaction by using the interworking protocol. However, this approach greatly increases the development workload, and the data volume is larger and larger during interaction, which easily occupies server resources, and reduces the service response speed and flexibility.
Disclosure of Invention
The embodiment of the invention provides a data interaction method and device based on service template mapping, which are used for realizing interconnection service and improving service response speed and flexibility.
According to an aspect of the present invention, there is provided a data interaction method based on service template mapping, the method including:
acquiring a service request sent by a request end, wherein the service request comprises service request data and service request address information;
determining a target service type according to the service request address information, and determining a target message type according to the service request data;
determining a target service template based on the target service type, and determining standard request parameter information corresponding to the service request based on the target message type and the mapping relation in the target service template;
based on the standard request parameter information, extracting and processing the format of effective request data in the service request data to generate standard request data;
and generating service response data based on the response to the standard request data and returning.
According to another aspect of the present invention, there is provided a data interaction device based on service template mapping, the device including:
the service request acquisition module is used for acquiring a service request sent by a request terminal, wherein the service request comprises service request data and service request address information;
the target type determining module is used for determining a target service type according to the service request address information and determining a target message type according to the service request data;
a standard request parameter information determining module, configured to determine a target service template based on the target service type, and determine standard request parameter information corresponding to the service request based on a mapping relationship between the target message type and the target service template;
the standard request data generation module is used for extracting and processing the format of effective request data in the service request data based on the standard request parameter information to generate standard request data;
and the service response data generation module is used for generating service response data based on the response to the standard request data and returning the service response data.
The embodiment of the invention has the following advantages or beneficial effects:
by obtaining the service request sent by the request end, the service request may include service request data and service request address information. The target message type may be determined by service request data in the service request and the target service type may be determined by service request address information. Based on the target service type, a target service template corresponding to the target service type can be determined, and standard request parameter information corresponding to the service request can be determined according to the mapping relation between the target message type and the target service template. The method comprises the steps of taking standard request parameter information as a reference, extracting and format processing effective request data in service request data, generating the standard request data in a unified mode, generating service response data based on response to the standard request data and returning the service response data, achieving unified response of service requests, achieving interconnection and intercommunication service of data, reducing invalid request data by extracting the effective request data, reducing data analysis difficulty and improving service request response speed. And the mapping relation in the target service template can be dynamically configured based on the service requirement, so that the flexibility and maintainability of the interconnection service can be improved.
It should be understood that the statements in this section are not intended to identify key or critical features of the embodiments of the present invention, nor are they intended to limit the scope of the invention. Other features of the present invention will become apparent from the following description.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flowchart of a data interaction method based on service template mapping according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating a data interaction method based on service template mapping according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a data interaction device based on service template mapping according to a third embodiment of the present invention.
Detailed Description
In order to make those skilled in the art better understand the technical solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, 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 invention.
It should be noted that the terms "target," "original," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in other sequences than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example one
Fig. 1 is a flowchart of a data interaction method based on service template mapping according to an embodiment of the present invention, which is applicable to a case of responding to service requests sent by request terminals of different services. The method may be performed by a data interaction device based on service template mapping, which may be implemented in the form of hardware and/or software, which may be integrated in an electronic device. As shown in fig. 1, the method specifically includes the following steps:
s110, acquiring the service request sent by the request end.
The requesting end may refer to a service client for sending a service request. Different request terminals may correspond to different service services. The service request may include service request data and service request address information. The service request address information may be a uniform resource locator of the requesting end. Specifically, the request terminals of different services may generate service requests and send the service requests to corresponding service servers or interworking servers, so that the service servers or the interworking servers may obtain the service requests sent by the request terminals.
S120, determining a target service type according to the service request address information, and determining a target message type according to the service request data.
The target service type may refer to a service type corresponding to the currently acquired service request. For example, the target service types may include, but are not limited to: a visit service type for processing the visit information, a department service type for processing the department information, or an in-patient service type for processing the in-patient information. The target message type may refer to a processing message type corresponding to the currently acquired service request. The target message types may include, but are not limited to: the information updating type, the information adding type, the information deleting type, the information inquiring type and the like.
Specifically, the service end may determine a target service type corresponding to the service request according to the service request address information. For example: if the service request address information is address information which is sent by the client of the department of living in and requests to process the hospitalization information, the target service type can be a hospitalization service type. If the service request address information is address information of request processing department information sent by a certain department client, the target service type may be a department service type. The target service type may correspond to a plurality of message types. The target message type may be determined based on message type identification information corresponding to a message type node or a message type field in the service request data, where the message type identification information is used to uniquely identify the message type so as to distinguish different message types.
S130, determining a target service template based on the target service type, and determining standard request parameter information corresponding to the service request based on the mapping relation between the target message type and the target service template.
Each service type corresponds to one service template, and the target service template may refer to a service template corresponding to the target service type. Various types of mapping relationships may be stored in the target service template. For example, the target service template may store a mapping relationship between the message type and the standard request parameter information. The standard request parameter information may be parameter information corresponding to a standard request parameter responded by the interworking server.
Specifically, according to the target service type, the target service template can be determined. And the standard request parameter information corresponding to the target message type, namely the standard request parameter information corresponding to the service request can be determined by using the mapping relation stored in the target service template and taking the target message type as a contrast. For example, if the target service type is an in-patient service type, the target service template may be an in-patient service template. If the target message type is the query type, the standard request parameter information corresponding to the query type can be determined according to the mapping relation stored in the hospitalization service template.
Illustratively, S130 may include: determining a target service template corresponding to the target service type according to the target service type and the mapping relation between the service type and the service template; and determining standard request parameter information corresponding to the service request according to the target message type and the mapping relation between the message type in the target service template and the standard request parameter information.
In this embodiment, the mapping relationship between the service type and the service template may be set in advance. Specifically, based on the mapping relationship between the service type and the service template, the target service template corresponding to the target service type may be determined with the target service type as a reference. Based on the mapping relationship between the message type stored in the target service template and the standard request parameter information, the standard request parameter information corresponding to the target message type can be determined by taking the target message type as a reference. Since the target message type corresponds to the service request, the standard request parameter information corresponding to the target message type, that is, the standard request parameter information corresponding to the service request.
And S140, extracting and processing the effective request data in the service request data according to the standard request parameter information to generate standard request data.
The valid request data may refer to request data corresponding to a standard request parameter in the service request data. The standard request data may refer to request data to which the interworking server may respond. Format processing operations may include, but are not limited to, format comparison operations, format conversion operations, and the like. In this embodiment, the data format corresponding to the service request data may be an XML (Extensible Markup Language) format or a JSON (JavaScript Object Notation) format.
Specifically, based on the standard request parameter information, the valid request data in the service request data is extracted, so that invalid request data is reduced, and the service response speed is increased. And judging the format of the effective request data in the service request data, if the format of the effective request data in the service request data is the same as the data format of the standard request parameter information, the format conversion is not needed, and the effective request data can be directly used as the standard request data. And if the format of the effective request data in the service request data is different from the data format of the standard request parameter information, performing format conversion on the effective request data format in the service request data, and taking the effective request data after format conversion as the standard request data.
And S150, generating service response data based on the response to the standard request data and returning.
Specifically, if the standard request data is determined in the service server, the service server sends the standard request data to the interconnection and interworking server, so that the interconnection and interworking server responds to the standard request data to generate standard response data, and the service server can generate service response data based on the standard response data and send the service response data to the request terminal. Or, if the standard request data is directly determined in the interconnection and interworking server, the interconnection and interworking server responds to the standard request data to generate standard response data, generates service response data based on the standard response data and sends the service response data to the request terminal, so that the request terminals aiming at different services can uniformly generate corresponding standard request data to respond, and interconnection and interworking service of data is realized.
According to the technical scheme of the embodiment, the service request sent by the request terminal is obtained, wherein the service request may include service request data and service request address information. The target message type may be determined by service request data in the service request and the target service type may be determined by service request address information. Based on the target service type, a target service template corresponding to the target service type can be determined, and standard request parameter information corresponding to the service request can be determined according to the mapping relation between the target message type and the target service template. The method comprises the steps of taking standard request parameter information as a reference, extracting and format processing effective request data in service request data, uniformly generating the standard request data, generating service response data based on a response to the standard request data and returning the service response data, so that uniform response of service requests can be realized, interconnection and intercommunication services of data can be realized, invalid request data can be reduced by extracting the effective request data, the data analysis difficulty is reduced, and the service request response speed is improved. And the mapping relation in the target service template can be dynamically configured based on the service requirement, so that the flexibility and maintainability of the interconnection service can be improved.
On the basis of the above embodiment, the standard request parameter information may include: standard request parameters and standard data request formats. Accordingly, S140 may include: extracting request data corresponding to standard request parameters in the service request data to obtain extracted effective request data; and if the data format corresponding to the effective request data is not consistent with the standard data request format, performing request format conversion on the effective request data based on the standard data request format to generate standard request data.
In this embodiment, the standard request parameter information may include standard request parameters and a standard data request format. The standard request parameter may refer to a request parameter that needs to be included in the standard request data. The standard data request format may refer to a data format corresponding to standard request data. For example, if the interworking server performs data interaction based on HTTP (Hyper Text Transfer Protocol) + JSON interaction Protocol, the standard data request format is JSON format. Specifically, the request data corresponding to the standard request parameter in the service request data may be extracted based on the standard request parameter, so as to obtain valid request data in the service request data. If the data format corresponding to the valid request data is the same as the standard data request format, request format conversion of the valid request data is not needed, and the valid request data can be directly used as the standard request data. If the data format corresponding to the effective request data is not consistent with the standard data request format, the data format of the effective request data is converted into the standard data request format, and the effective request data after the request format conversion is used as the standard request data, so that the standard request data meeting the interconnection requirement can be generated.
Illustratively, the standard request data may be obtained by performing valid data extraction first and then performing format conversion, or may be obtained by performing format conversion first and then performing valid data extraction. For example, S140 may further include: judging whether the standard data request format is consistent with the data format corresponding to the service request data; if the data format corresponding to the service request data is not consistent with the standard data request format, performing request format conversion on the service request data based on the standard data request format; and extracting the request data corresponding to the standard request parameters in the service request data after format conversion to obtain the extracted effective request data and generate the standard request data.
Specifically, it may be determined whether the standard data request format is consistent with the data format corresponding to the service request data. If the data format corresponding to the valid request data is the same as the standard data request format, the request format conversion of the service request data is not needed. And if the data format corresponding to the service request data is not consistent with the standard data request format, performing request format conversion on the service request data by taking the standard data request format as a reference to obtain the service request data in the standard data request format. The request data corresponding to the standard request parameters in the service request data in the standard data request format is extracted to obtain effective request data, and the effective request data is used as standard request data, so that the standard request data meeting the interconnection requirement can be generated.
On the basis of the foregoing embodiment, extracting request data corresponding to a standard request parameter in service request data to obtain extracted valid request data may include: determining a mapping relation between standard request parameters corresponding to the service request and service request parameters based on the target service type and/or the target message type; determining a target service request parameter corresponding to the standard request parameter in the standard request parameter information based on the mapping relation between the standard request parameter and the service request parameter; and extracting the request data corresponding to the target service request parameter in the service request data to obtain the extracted effective request data.
In this embodiment, for each service type, a mapping relationship between the standard request parameter and the service request parameter corresponding to each service type may be stored, so that the mapping relationship between the standard request parameter and the service request parameter corresponding to the target service type is used as the mapping relationship between the standard request parameter and the service request parameter corresponding to the service request, and at this time, different message types corresponding to the same service type have the same mapping relationship between the standard request parameter and the service request parameter. Or, for each message type, the mapping relationship between the standard request parameter and the service request parameter corresponding to each message type may be stored, so that the mapping relationship between the standard request parameter and the service request parameter corresponding to the target message type is used as the mapping relationship between the standard request parameter and the service request parameter corresponding to the service request, and at this time, different service types corresponding to the same message type have the same mapping relationship between the standard request parameter and the service request parameter. Or, the mapping relation between the standard request parameter and the service request parameter corresponding to each message type can be stored for each message type corresponding to each service type, so that the mapping relation between the standard request parameter and the service request parameter corresponding to the target message type under the target service type can be used as the mapping relation between the standard request parameter and the service request parameter corresponding to the service request, the refinement of the mapping relation can be realized, the accuracy of data response is improved, and the personalized service requirement is further met.
It should be noted that the mapping relationship between the standard request parameter and the service request parameter can be stored in the service template, so as to obtain the mapping relationship from the service template quickly. The mapping relationship between the standard request parameters and the service request parameters can also be stored to other storage locations separately.
After the mapping relationship between the standard request parameter and the service request parameter is determined, the standard request parameter in the standard request parameter information may be used as a reference, and the target service request parameter corresponding to the standard request parameter is determined based on the mapping relationship. For example, the mapping relationship between the standard request parameters and the service request parameters may be: the name corresponds to a name, the identity ID corresponds to an identity card number and the like, wherein the name and the identity ID are standard request parameters, and the name and the identity card number are service request parameters. When the standard request parameter is 'name', the 'name' can be determined as a target service request parameter according to the mapping relation corresponding to the 'name' in the mapping relation, so that when the service request data does not contain the request data corresponding to the standard request parameter 'name', the request data corresponding to the target service request parameter 'name' in the service request data is extracted, and effective request data is obtained, thereby further improving the accuracy of data extraction, further reducing the acquisition of the ineffective request data, reducing the difficulty of data analysis, and improving the speed and flexibility of service response.
Example two
Fig. 2 is a schematic flow chart of a data interaction method based on service template mapping according to a second embodiment of the present invention, and this embodiment describes in detail a generation process of service response data based on the foregoing embodiments. Wherein explanations of the same or corresponding terms as those of the above embodiments are omitted. Referring to fig. 2, the data interaction method based on service template mapping provided by this embodiment may include the following steps:
s210, acquiring the service request sent by the request end.
S220, determining a target service type according to the service request address information, and determining a target message type according to the service request data.
S230, determining a target service template based on the target service type, and determining standard request parameter information corresponding to the service request based on the mapping relation between the target message type and the target service template.
S240, based on the standard request parameter information, extracting and format processing are carried out on effective request data in the service request data, and standard request data are generated.
And S250, determining service response parameter information corresponding to the service request based on the target service type and/or the target message type.
The service response parameter information may refer to parameter information corresponding to a service response parameter that can be recognized by the requesting end.
Specifically, the service response parameter information corresponding to each service type may be stored for each service type, so that the service response parameter information corresponding to the target service type is used as the service response parameter information corresponding to the service request, and at this time, different message types corresponding to the same service type have the same service response parameter information. Or, the service response parameter information corresponding to each message type may be stored for each message type, so that the service response parameter information corresponding to the target message type is used as the service response parameter information corresponding to the service request, and at this time, different service types corresponding to the same message type have the same service response parameter information. Or, the service response parameter information corresponding to each message type corresponding to each service type can be stored, so that the service response parameter information corresponding to the target message type under the target service type can be used as the service response parameter information corresponding to the service request, and therefore, the accuracy of data response can be improved, and further, the personalized service requirements can be met.
Illustratively, S250 may include: and determining service response parameter information corresponding to the service request according to the target message type and the mapping relation between the message type in the target service template and the service response parameter information.
In this embodiment, the target service template may store a mapping relationship between the message type and the service response parameter information, so that based on the mapping relationship in the target service template, with the target message type as a reference, the service response parameter information corresponding to the target message type may be determined. Since the target message type corresponds to the service request, the service response parameter information corresponding to the target message type is also the service response parameter information corresponding to the service request.
For example, an Application Program Interface (API) of the service request may be determined according to the target message type, and service response parameter information corresponding to the service request may be obtained by calling and analyzing the API of the service request.
S260, acquiring standard response data based on the response to the standard request data.
The standard response data may be response data obtained by the interworking server responding to the standard request data.
Specifically, the interconnection and interworking server may respond to the standard request data to obtain standard response data corresponding to the standard request data.
And S270, based on the service response parameter information, extracting and format processing effective response data in the standard response data, generating service response data and returning the service response data.
The valid response data may refer to response data corresponding to the service response parameter in the standard response data. The service response data may refer to response data in which the interworking server requests a data response according to a standard. Format processing operations may include, but are not limited to, format comparison operations, format conversion operations, and the like. In this embodiment, the data format corresponding to the standard response data may be an XML format or a JSON format.
Specifically, based on the service response parameter information, effective response data in the standard response data is extracted to reduce ineffective response data and improve the service response speed. And judging the format of the effective response data in the standard response data, if the format of the effective response data in the standard response data is the same as that of the service response parameter information, the format conversion is not needed, and at the moment, the effective response data can be used as the service response data and the service response data is returned to the request end. And if the format of the effective response data in the standard response data is different from the format of the service response parameter information, performing format conversion on the effective response data in the standard response data, taking the effective response data after the format conversion as service response data, and returning the service response data to the request end.
Illustratively, after generating the standard request data, further comprising: the standard request data is persisted and stored in the pipeline; service interaction log data is generated based on the standard response data and the standard request data stored in the pipe.
In this embodiment, the standard request data may be persisted and stored into the pipeline. Service interaction log data can be generated based on the obtained standard response data and the standard request data stored in the pipeline, so that related personnel can perform data monitoring, abnormal analysis and other conditions based on the service interaction log data.
According to the technical scheme of the embodiment, the service response parameter information corresponding to the service request is determined based on the target service type and/or the target message type, the effective response data in the standard response data is extracted and processed in the format based on the service response parameter information, the service response data is generated and returned, so that the uniform response of the service request is realized, the interconnection and intercommunication service of the data is realized, the invalid response data can be reduced by extracting the effective response data, the response speed of the service request is further improved, and the flexibility and maintainability of the response to different service requests can be improved by dynamically configuring the service response parameter information.
On the basis of the above embodiment, the service response parameter information may include: service response parameters and service data response format. Accordingly, S270 may include: extracting response data corresponding to the service response parameters in the standard response data to obtain extracted effective response data; and if the data format corresponding to the effective response data is not consistent with the service data response format, performing response format conversion on the effective response data based on the service data response format to generate service response data.
In this embodiment, the service response parameter information may include a service response parameter and a service data response format. The service response parameter may refer to a response parameter that needs to be included in the service response data. The service data response format may refer to a data format corresponding to the service response data. For example, if the service server performs data interaction based on the HTTP + XML interaction protocol, the service data response format is an XML format.
Specifically, the response data corresponding to the service response parameter in the standard response data may be extracted based on the service response parameter, so as to obtain valid response data in the standard response data. If the data format corresponding to the effective response data is the same as the service data response format, the effective response data does not need to be subjected to response format conversion, and the effective response data can be directly used as the service response data. And if the data format corresponding to the effective response data is not consistent with the service data response format, converting the data format corresponding to the effective response data into the service data response format, and taking the effective response data after the response format conversion as the service response data.
Illustratively, the service response data may be obtained by performing valid response data extraction first and then performing format conversion, or may be obtained by performing format conversion first and then performing valid response data extraction. For example, S270 may further include: judging whether the data format corresponding to the standard response data is consistent with the service data response format or not; if the data format corresponding to the standard response data is not consistent with the service data response format, performing response format conversion on the standard response data based on the service data response format; and extracting response data corresponding to the service response parameters in the standard response data after format conversion to obtain extracted effective response data and generate service response data.
Specifically, it may be determined whether the service data response format is consistent with the data format corresponding to the valid response data. If the data format corresponding to the standard response data is the same as the service data response format, the response format conversion of the standard response data is not needed. And if the data format corresponding to the standard response data is not consistent with the service data response format, performing response format conversion on the standard response data by taking the service data response format as a reference to obtain the standard response data in the service data response format. Response data corresponding to the service response parameters in the standard response data in the service data response format are extracted to obtain effective response data, and the effective response data are used as service response data, so that response requirements of different request ends can be met.
On the basis of the foregoing embodiment, extracting response data corresponding to the service response parameter in the standard response data to obtain extracted effective response data may include: determining a mapping relation between standard response parameters corresponding to the service request and service response parameters based on the target service type and/or the target message type; determining a target standard response parameter corresponding to the service response parameter in the service response parameter information based on the mapping relation between the standard response parameter and the service response parameter; and extracting response data corresponding to the target standard response parameters in the standard response data to obtain extracted effective response data.
In this embodiment, for each service type, a mapping relationship between the standard response parameter and the service response parameter corresponding to each service type may be stored, so that the mapping relationship between the standard response parameter and the service response parameter corresponding to the target service type is used as the mapping relationship between the standard response parameter and the service response parameter corresponding to the service request, and at this time, different message types corresponding to the same service type have the same mapping relationship between the standard response parameter and the service response parameter. Or, for each message type, the mapping relationship between the standard response parameter and the service response parameter corresponding to each message type may be stored, so that the mapping relationship between the standard response parameter and the service response parameter corresponding to the target message type is used as the mapping relationship between the standard response parameter and the service response parameter corresponding to the service request, and at this time, different service types corresponding to the same message type have the same mapping relationship between the standard response parameter and the service response parameter. Or, the mapping relation between the standard response parameter and the service response parameter corresponding to each message type corresponding to each service type can be stored, so that the mapping relation between the standard response parameter and the service response parameter corresponding to the target message type under the target service type can be used as the mapping relation between the standard response parameter and the service response parameter corresponding to the service request, and thus, the refinement of the mapping relation can be realized, the accuracy of data response is improved, and the personalized service requirement is met.
It should be noted that the mapping relationship between the standard response parameter and the service response parameter can be stored in the service template, so as to obtain the mapping relationship from the service template quickly. The mapping relationship between the standard response parameter and the service response parameter can also be stored to other storage locations separately.
After the mapping relationship between the standard response parameter and the service response parameter is determined, the target standard response parameter corresponding to the service response parameter may be determined based on the mapping relationship with reference to the service response parameter in the service response parameter information. For example, the mapping relationship between the standard response parameter and the service response parameter may be: the "Cost" corresponds to the "medical expense", wherein the "Cost" is a standard response parameter, and the "medical expense" is a service response parameter. When the service response parameter is the medical expense, the medical expense is determined to be the target standard response parameter according to the mapping relation, so that when the standard response data does not contain the response data corresponding to the service response parameter medical expense, the response data corresponding to the target standard response parameter Cost in the standard response data is extracted, and effective response data is obtained, so that the accuracy of extracting the effective response data is further improved, the acquisition of invalid response data is reduced, the difficulty of data analysis is reduced, and the speed of service response is improved.
The following is an embodiment of the data interaction apparatus based on service template mapping according to an embodiment of the present invention, which belongs to the same inventive concept as the data interaction method based on service template mapping according to the foregoing embodiments, and reference may be made to the above embodiment of the data interaction method based on service template mapping for details that are not described in detail in the embodiment of the data interaction apparatus based on service template mapping.
EXAMPLE III
Fig. 3 is a schematic structural diagram of a data interaction device based on service template mapping according to a third embodiment of the present invention, which is applicable to a case of responding to service requests sent by request terminals of different services. As shown in fig. 3, the apparatus specifically includes: a service request acquisition module 310, a target type determination module 320, a standard request parameter information determination module 330, a standard request data generation module 340, and a service response data generation module 350.
The service request obtaining module 310 is configured to obtain a service request sent by a request end, where the service request includes service request data and service request address information; a target type determining module 320, configured to determine a target service type according to the service request address information, and determine a target message type according to the service request data; a standard request parameter information determining module 330, configured to determine a target service template based on the target service type, and determine standard request parameter information corresponding to the service request based on a mapping relationship between the target message type and the target service template; a standard request data generating module 340, configured to extract and format valid request data in the service request data based on the standard request parameter information, and generate standard request data; and a service response data generating module 350, configured to generate and return service response data based on a response to the standard request data.
According to the technical scheme of the embodiment, the service request sent by the request terminal is obtained, wherein the service request may include service request data and service request address information. The target message type may be determined by service request data in the service request and the target service type may be determined by service request address information. Based on the target service type, a target service template corresponding to the target service type can be determined, and standard request parameter information corresponding to the service request can be determined according to the mapping relation between the target message type and the target service template. The method comprises the steps of taking standard request parameter information as a reference, extracting and format processing effective request data in service request data, uniformly generating the standard request data, generating service response data based on a response to the standard request data and returning the service response data, so that uniform response of service requests can be realized, interconnection and intercommunication services of data can be realized, invalid request data can be reduced by extracting the effective request data, the data analysis difficulty is reduced, and the service request response speed is improved. And the mapping relation in the target service template can be dynamically configured based on the service requirement, so that the flexibility and maintainability of the interconnection service can be improved.
Optionally, the standard request parameter information determining module 330 may be specifically configured to: determining a target service template corresponding to the target service type according to the target service type and the mapping relation between the service type and the service template; and determining standard request parameter information corresponding to the target message type according to the target message type and the mapping relation between the message type in the target service template and the standard request parameter information.
Optionally, the standard request parameter information includes: standard request parameters and standard data request formats; the standard request data generation module 340 may include: the effective request data acquisition unit is used for extracting the request data corresponding to the standard request parameters in the service request data to obtain the extracted effective request data; and the standard request data generating unit is used for performing request format conversion on the effective request data based on the standard data request format to generate standard request data if the data format corresponding to the effective request data is inconsistent with the standard data request format.
Optionally, the valid request data obtaining unit may be specifically configured to determine, based on the target service type and/or the target message type, a mapping relationship between a standard request parameter corresponding to the service request and a service request parameter; determining a target service request parameter corresponding to the standard request parameter in the standard request parameter information based on the mapping relation between the standard request parameter and the service request parameter; and extracting the request data corresponding to the target service request parameter in the service request data to obtain the extracted effective request data.
Optionally, the data interaction apparatus based on service template mapping may further include:
the service response parameter information determining module is used for determining service response parameter information corresponding to the service request based on the target service type and/or the target message type; accordingly, the service response data generation module 350 may include: a standard response data acquisition unit configured to acquire standard response data based on a response to the standard request data; and the service response data generating unit is used for extracting and processing the effective response data in the standard response data based on the service response parameter information, generating the service response data and returning the service response data.
Optionally, the service response parameter information determining module may be specifically configured to: and determining service response parameter information corresponding to the target message type according to the target message type and the mapping relation between the message type in the target service template and the service response parameter information.
Optionally, the service response parameter information includes: service response parameters and service data response format. The service response data generation unit may include: the effective response data acquisition subunit is used for extracting response data corresponding to the service response parameters in the standard response data to obtain the extracted effective response data; and the service response data generation subunit is used for performing response format conversion on the effective response data based on the service data response format to generate the service response data if the data format corresponding to the effective response data is inconsistent with the service data response format.
Optionally, the effective response data obtaining subunit is specifically configured to determine, based on the target service type and/or the target message type, a mapping relationship between a standard response parameter corresponding to the service request and the service response parameter; determining a target standard response parameter corresponding to the service response parameter in the service response parameter information based on the mapping relation between the standard response parameter and the service response parameter; and extracting response data corresponding to the target standard response parameters in the standard response data to obtain the extracted effective response data.
Optionally, the data interaction apparatus based on service template mapping may further include: the service interaction log data generation module is used for persisting the standard request data and storing the standard request data into a pipeline; based on the standard response data and the standard request data stored in the pipe, service interaction log data is generated.
The data interaction device based on the service template mapping, provided by the embodiment of the invention, can execute the data interaction method based on the service template mapping, provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the data interaction method based on the service template mapping.
It should be noted that, in the embodiment of the data interaction apparatus based on the service template mapping, the included units and modules are only divided according to the functional logic, but are not limited to the above division, as long as the corresponding functions can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments illustrated herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A data interaction method based on service template mapping is characterized by comprising the following steps:
acquiring a service request sent by a request end, wherein the service request comprises service request data and service request address information;
determining a target service type according to the service request address information, and determining a target message type according to the service request data;
determining a target service template based on the target service type, and determining standard request parameter information corresponding to the service request based on the mapping relation between the target message type and the target service template;
based on the standard request parameter information, extracting and format processing effective request data in the service request data to generate standard request data;
and generating service response data based on the response to the standard request data and returning.
2. The method of claim 1, wherein the determining a target service template based on the target service type and determining standard request parameter information corresponding to the service request based on a mapping relationship between the target message type and the target service template comprises:
determining a target service template corresponding to the target service type according to the target service type and the mapping relation between the service type and the service template;
and determining standard request parameter information corresponding to the service request according to the target message type and the mapping relation between the message type in the target service template and the standard request parameter information.
3. The method of claim 1, wherein the standard request parameter information comprises: standard request parameters and standard data request formats;
the extracting and format processing of the effective request data in the service request data based on the standard request parameter information to generate standard request data includes:
extracting the request data corresponding to the standard request parameters in the service request data to obtain extracted effective request data;
and if the data format corresponding to the effective request data is not consistent with the standard data request format, performing request format conversion on the effective request data based on the standard data request format to generate standard request data.
4. The method according to claim 3, wherein the extracting the request data corresponding to the standard request parameter in the service request data to obtain the extracted valid request data includes:
determining a mapping relation between standard request parameters and service request parameters corresponding to the service request based on the target service type and/or the target message type;
determining a target service request parameter corresponding to the standard request parameter in the standard request parameter information based on the mapping relation between the standard request parameter and the service request parameter;
and extracting the request data corresponding to the target service request parameter in the service request data to obtain the extracted effective request data.
5. The method of claim 1, further comprising:
determining service response parameter information corresponding to the service request based on the target service type and/or the target message type;
the step of generating and returning service response data based on the response to the standard request data comprises the following steps:
acquiring standard response data based on the response to the standard request data;
and based on the service response parameter information, extracting and format processing effective response data in the standard response data to generate service response data and returning the service response data.
6. The method according to claim 5, wherein the determining service response parameter information corresponding to the service request based on the target service type and/or the target message type comprises:
and determining service response parameter information corresponding to the service request according to the target message type and the mapping relation between the message type in the target service template and the service response parameter information.
7. The method of claim 5, wherein the service response parameter information comprises: service response parameters and service data response formats;
the extracting and format processing of the effective response data in the standard response data based on the service response parameter information to generate service response data includes:
extracting response data corresponding to the service response parameters in the standard response data to obtain extracted effective response data;
and if the data format corresponding to the effective response data is not consistent with the service data response format, performing response format conversion on the effective response data based on the service data response format to generate service response data.
8. The method according to claim 7, wherein the extracting response data corresponding to the service response parameter in the standard response data to obtain extracted valid response data includes:
determining a mapping relation between standard response parameters and service response parameters corresponding to the service request based on the target service type and/or the target message type;
determining a target standard response parameter corresponding to the service response parameter in the service response parameter information based on the mapping relation between the standard response parameter and the service response parameter;
and extracting response data corresponding to the target standard response parameters in the standard response data to obtain extracted effective response data.
9. The method of any of claims 5-8, after generating the standard request data, further comprising:
the standard request data is persisted and stored in a pipeline;
generating service interaction log data based on the standard response data and the standard request data stored in the pipe.
10. A data interaction device based on service template mapping is characterized by comprising:
the service request acquisition module is used for acquiring a service request sent by a request end, wherein the service request comprises service request data and service request address information;
the target type determining module is used for determining a target service type according to the service request address information and determining a target message type according to the service request data;
a standard request parameter information determining module, configured to determine a target service template based on the target service type, and determine standard request parameter information corresponding to the service request based on a mapping relationship between the target message type and the target service template;
the standard request data generation module is used for extracting and processing the format of effective request data in the service request data based on the standard request parameter information to generate standard request data;
and the service response data generation module is used for generating service response data based on the response to the standard request data and returning the service response data.
CN202211035555.0A 2022-08-26 2022-08-26 Data interaction method and device based on service template mapping Active CN115396525B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211035555.0A CN115396525B (en) 2022-08-26 2022-08-26 Data interaction method and device based on service template mapping

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211035555.0A CN115396525B (en) 2022-08-26 2022-08-26 Data interaction method and device based on service template mapping

Publications (2)

Publication Number Publication Date
CN115396525A true CN115396525A (en) 2022-11-25
CN115396525B CN115396525B (en) 2023-07-21

Family

ID=84123575

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211035555.0A Active CN115396525B (en) 2022-08-26 2022-08-26 Data interaction method and device based on service template mapping

Country Status (1)

Country Link
CN (1) CN115396525B (en)

Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070208610A1 (en) * 2006-03-06 2007-09-06 Miva, Inc. System and method for delivering advertising with enhanced effectiveness
CN102055686A (en) * 2011-01-24 2011-05-11 宇龙计算机通信科技(深圳)有限公司 Data exchange method and system as well as mobile terminal
US20130145033A1 (en) * 2011-12-02 2013-06-06 Srivathsan P. Polla Automatic cloud template approval
US20140358991A1 (en) * 2013-05-31 2014-12-04 Fluke Corporation Integrating data from various network nodes using a template stack
CN106161178A (en) * 2015-03-24 2016-11-23 阿里巴巴集团控股有限公司 A kind of method and apparatus accessing instant messaging network
CN108243022A (en) * 2016-12-23 2018-07-03 中国移动通信有限公司研究院 A kind of web service messages transmission method, device, terminal and server
CN109344183A (en) * 2018-01-30 2019-02-15 深圳壹账通智能科技有限公司 Data interactive method, device, computer equipment and storage medium
CN109523225A (en) * 2018-10-12 2019-03-26 平安科技(深圳)有限公司 A kind of measure of managing contract, system and terminal device
CN109524065A (en) * 2018-11-07 2019-03-26 平安医疗健康管理股份有限公司 Medical data querying method, medical data platform and relevant apparatus
CN213876824U (en) * 2020-07-28 2021-08-03 四川大学华西医院 Medical shift work attendance system
CN113259375A (en) * 2021-06-10 2021-08-13 长视科技股份有限公司 Video service response method and electronic equipment
CN113705226A (en) * 2021-10-29 2021-11-26 上海柯林布瑞信息技术有限公司 Medical text entity labeling method and device
CN114153626A (en) * 2021-10-29 2022-03-08 深圳市金蝶天燕云计算股份有限公司 Method and device for abstracting service integration process and computer equipment
CN114221836A (en) * 2021-12-15 2022-03-22 杭州橙鹰数据技术有限公司 Data processing method and device
CN114579653A (en) * 2022-03-08 2022-06-03 上海柯林布瑞信息技术有限公司 Data set-based CDA document generation method and device and electronic equipment
CN114866628A (en) * 2022-05-17 2022-08-05 中国银行股份有限公司 Message processing method, device, equipment and storage medium

Patent Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070208610A1 (en) * 2006-03-06 2007-09-06 Miva, Inc. System and method for delivering advertising with enhanced effectiveness
CN102055686A (en) * 2011-01-24 2011-05-11 宇龙计算机通信科技(深圳)有限公司 Data exchange method and system as well as mobile terminal
US20130145033A1 (en) * 2011-12-02 2013-06-06 Srivathsan P. Polla Automatic cloud template approval
US20140358991A1 (en) * 2013-05-31 2014-12-04 Fluke Corporation Integrating data from various network nodes using a template stack
CN106161178A (en) * 2015-03-24 2016-11-23 阿里巴巴集团控股有限公司 A kind of method and apparatus accessing instant messaging network
CN108243022A (en) * 2016-12-23 2018-07-03 中国移动通信有限公司研究院 A kind of web service messages transmission method, device, terminal and server
CN109344183A (en) * 2018-01-30 2019-02-15 深圳壹账通智能科技有限公司 Data interactive method, device, computer equipment and storage medium
CN109523225A (en) * 2018-10-12 2019-03-26 平安科技(深圳)有限公司 A kind of measure of managing contract, system and terminal device
CN109524065A (en) * 2018-11-07 2019-03-26 平安医疗健康管理股份有限公司 Medical data querying method, medical data platform and relevant apparatus
CN213876824U (en) * 2020-07-28 2021-08-03 四川大学华西医院 Medical shift work attendance system
CN113259375A (en) * 2021-06-10 2021-08-13 长视科技股份有限公司 Video service response method and electronic equipment
CN113705226A (en) * 2021-10-29 2021-11-26 上海柯林布瑞信息技术有限公司 Medical text entity labeling method and device
CN114153626A (en) * 2021-10-29 2022-03-08 深圳市金蝶天燕云计算股份有限公司 Method and device for abstracting service integration process and computer equipment
CN114221836A (en) * 2021-12-15 2022-03-22 杭州橙鹰数据技术有限公司 Data processing method and device
CN114579653A (en) * 2022-03-08 2022-06-03 上海柯林布瑞信息技术有限公司 Data set-based CDA document generation method and device and electronic equipment
CN114866628A (en) * 2022-05-17 2022-08-05 中国银行股份有限公司 Message processing method, device, equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
马晓;赵哲;: "P2P模式下协同软件数据传输方式的分析与研究", 电脑知识与技术, no. 24 *
高婕: "基于微博数据的POI现势状态变化检测方法", 中国优秀硕士学位论文全文数据库 (信息科技辑)》 *

Also Published As

Publication number Publication date
CN115396525B (en) 2023-07-21

Similar Documents

Publication Publication Date Title
CN107622135B (en) Method and apparatus for displaying information
CN107360261B (en) HTTP request processing method and device and electronic equipment
CN109617647B (en) Message conversion method and device, computer equipment and computer readable storage medium
CN112182036A (en) Data sending and writing method and device, electronic equipment and readable storage medium
CN111782652B (en) Data calling method, device, computer equipment and storage medium
CN109871354B (en) File processing method and device
CN114153626A (en) Method and device for abstracting service integration process and computer equipment
CN112671950A (en) Domain name processing method and device based on block chain, electronic equipment and storage medium
CN111988418B (en) Data processing method, device, equipment and computer readable storage medium
CN115039392A (en) Message processing method, device and system and server
CN114598750B (en) Data request processing method, device and storage medium
CN109871408B (en) Multi-type database adaptation method, device, electronic equipment and storage medium
CN111507714A (en) Verification method, verification device, server and storage medium
CN111294288A (en) Traffic identification method and device, application program interface gateway and storage medium
CN109862074B (en) Data acquisition method and device, readable medium and electronic equipment
JP2018533092A (en) Network request and response processing method, terminal, server, and storage medium
CN109471713B (en) Method and device for inquiring information
CN115396525B (en) Data interaction method and device based on service template mapping
CN113919310A (en) Short message content determination method and device, electronic equipment and storage medium
CN113704486A (en) Map data construction method and device and map data query method and device
CN113691618A (en) Message notification method, device, message center and storage medium
CN112860292A (en) Configuration management method and device based on application
CN113779018A (en) Data processing method and device
CN112948474A (en) Data export method, device, equipment and computer readable storage medium
CN114139072B (en) Page data processing method and device, electronic 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