CN115396525B - 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
CN115396525B
CN115396525B CN202211035555.0A CN202211035555A CN115396525B CN 115396525 B CN115396525 B CN 115396525B CN 202211035555 A CN202211035555 A CN 202211035555A CN 115396525 B CN115396525 B CN 115396525B
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.)
Active
Application number
CN202211035555.0A
Other languages
Chinese (zh)
Other versions
CN115396525A (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

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 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; extracting and format-processing effective request data in the service request data based on standard request parameter information to generate standard request data; service response data is generated and returned based on the response to the standard request data. Through 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 a computer technology, in particular to a data interaction method and device based on service template mapping.
Background
With the rapid development of computer technology, the service system is often required to be modified or expanded to realize interconnection. For example, each business system in the hospital can be modified, so that interconnection and intercommunication of data in the hospital can be realized.
At present, the data interaction logic of each service system is generally modified based on an interconnection interaction protocol, so that the interconnection interaction protocol is utilized to perform data interaction. However, the method greatly increases the development workload, has more data volume and larger data volume during interaction, is easy to occupy 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 and interworking 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 comprising:
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;
extracting and format-processing effective request data in the service request data based on the standard request parameter information to generate standard request data;
service response data is generated and returned based on the response to the standard request data.
According to another aspect of the present invention, there is provided a data interaction device based on service template mapping, the device 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;
the standard request parameter information determining module is used for 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;
The standard request data generation module is used for extracting and carrying out format processing on the 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 and returning the service response data based on the response to the standard request data.
The embodiments of the above invention have the following advantages or benefits:
the service request may include service request data and service request address information by obtaining a service request sent by the requesting end. The target message type may be determined by the service request data in the service request and the target service type may be determined by the service request address information. Based on the target service type, a target service template corresponding to the target service class 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 standard request data, generating service response data based on response to the standard request data and returning the service response data, so that uniform response of service requests can be realized, interconnection service 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.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flow chart of a data interaction method based on service template mapping according to a first embodiment of the present invention;
fig. 2 is a flow chart of 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 that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the 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 the above-described drawings are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise 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 1
Fig. 1 is a flowchart of a data interaction method based on service template mapping according to a first embodiment of the present invention, where the embodiment may be applicable to a case of responding to service requests sent by request ends of different services. The method may be performed by a data interaction means based on a service template mapping, which means may be implemented in hardware and/or software, which means may be integrated in an electronic device. As shown in fig. 1, the method specifically includes the following steps:
S110, acquiring a service request sent by a request end.
Wherein, the request end may refer to a service client end for sending a service request. Different requesting ends may correspond to different business 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 ends of different services can generate service requests and send the service requests to corresponding service servers or interconnection servers, so that the service servers or the interconnection servers can acquire the service requests sent by the request ends.
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 doctor service type for processing doctor information, a department service type for processing department information, or a hospitalization service type for processing hospitalization 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: information update type, information new type, information deletion type, information query type, or the like.
Specifically, the server may determine, according to the service request address information, a target service type corresponding to the service request. For example: if the service request address information is address information of the hospitalization information, which is sent by the hospitalization unit client and is requested to process the hospitalization information, the target service type may be a hospitalization service type. If the service request address information is address information of a department client which requests to process department information, the target service type can 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 between 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.
Wherein, each service type corresponds to a service template, and the target service template may refer to a service template corresponding to the target service type. Various mappings may be stored in the target service template. For example, a mapping relationship between the message type and the standard request parameter information may be stored in the target service template. The standard request parameter information may refer to parameter information corresponding to standard request parameters responded by the interconnection server.
Specifically, a target service template may be determined according to the target service type. And the mapping relation stored in the target service template is utilized, 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 taking the target message type as a comparison. For example, if the target service type is a hospitalization service type, the target service template may be a hospitalization 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, a mapping relationship between the service type and the service template may be preset. 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 reference to the target service type. Based on the mapping relation 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 format-processing effective request data in the service request data based on 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 that the interworking server can respond to. The format processing operations may include, but are not limited to, format contrast 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, javaScript object notation) format.
Specifically, based on standard request parameter information, effective request data in service request data is extracted, so that invalid request data is reduced, and service response speed is improved. And judging the format of the effective request data in the service request data, if the effective request data format in the service request data is the same as the data format of the standard request parameter information, format conversion is not needed, and the effective request data can be directly used as the standard request data. If the effective request data format in the service request data is different from the data format of the standard request parameter information, carrying out 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 server, so that the interconnection 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 end. Or if the standard request data is determined directly in the interconnection server, the interconnection server responds to the standard request data to generate standard response data, service response data is generated based on the standard response data and is sent to the request end, so that corresponding standard request data can be uniformly generated for the request ends of different services to respond, and the interconnection service of the data is realized.
According to the technical scheme of the embodiment, the service request sent by the request end is obtained, wherein the service request can comprise service request data and service request address information. The target message type may be determined by the service request data in the service request and the target service type may be determined by the service request address information. Based on the target service type, a target service template corresponding to the target service class 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 standard request data, generating service response data based on response to the standard request data and returning the service response data, so that uniform response of service requests can be realized, interconnection service 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; if the data format corresponding to the effective request data is inconsistent with the standard data request format, carrying out 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 a standard request parameter and a standard data request format. The standard request parameter may be a request parameter that needs to be included in the index request data. The standard data request format may be a data format corresponding to the 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, request data corresponding to the standard request parameters in the service request data may be extracted based on the standard request parameters, 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, the 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 inconsistent with the standard data request format, converting the data format of the effective request data into the standard data request format, and taking the effective request data converted by the request format as the standard request data, so that the standard request data meeting the interconnection and interworking requirements can be generated.
The standard request data may be obtained by performing effective data extraction and then performing format conversion, or may be obtained by performing format conversion and then performing effective 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 inconsistent with the standard data request format, carrying out request format conversion on the service request data based on the standard data request format; extracting request data corresponding to standard request parameters in the service request data after format conversion to obtain extracted effective request data, and generating 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. If the data format corresponding to the service request data is inconsistent with the standard data request format, the standard data request format is used as a reference to perform request format conversion on the service request data, and the service request data in the standard data request format is obtained. Extracting request data corresponding to standard request parameters in service request data in a standard data request format, obtaining effective request data, and taking the effective request data as standard request data, so that standard request data meeting interconnection and interworking requirements can be generated.
On the basis of the above embodiment, extracting request data corresponding to standard request parameters 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 the 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 a mapping relation between the standard request parameter and the service request parameter; and extracting the request data corresponding to the target service request parameters in the service request data to obtain the extracted effective request data.
In this embodiment, for each service type, a mapping relationship between a standard request parameter and a service request parameter corresponding to each service type may be stored, so that a mapping relationship between a standard request parameter and a service request parameter corresponding to a target service type is used as a mapping relationship between a standard request parameter and a service request parameter corresponding to a service request, where different message types corresponding to the same service type have the same mapping relationship between a standard request parameter and a service request parameter. Or, for each message type, a mapping relationship between a standard request parameter and a service request parameter corresponding to each message type may be stored, so that a mapping relationship between a standard request parameter and a service request parameter corresponding to a target message type is used as a mapping relationship between a standard request parameter and a service request parameter corresponding to a service request, where different service types corresponding to the same message type have the same mapping relationship between a standard request parameter and a service request parameter. Or, for each message type corresponding to each service type, a mapping relation between the corresponding standard request parameter and the service request parameter can be stored, 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 is used as the mapping relation between the standard request parameter and the service request parameter corresponding to the service request, thereby realizing the refinement of the mapping relation, improving the accuracy of data response and further meeting the personalized service requirement.
It should be noted that, the mapping relationship between the standard request parameter and the service request parameter may be stored in the service template, so as to quickly obtain the mapping relationship from the service template. The mapping relation between the standard request parameter and the service request parameter can also be separately stored in other storage positions.
After determining the mapping relation between the standard request parameter and the service request parameter, the standard request parameter in the standard request parameter information can be used as a reference, and the target service request parameter corresponding to the standard request parameter can be determined based on the mapping relation. For example, the mapping relationship between the standard request parameter and the service request parameter may be: the name corresponds to the name, the identity ID corresponds to the 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 the target service request parameter according to the mapping relation of the 'name' 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 can be extracted, and the effective request data can be obtained, thereby further improving the accuracy of data extraction, further reducing the acquisition of invalid request data, reducing the difficulty of data analysis, and improving the speed and the flexibility of service response.
Example two
Fig. 2 is a flow chart of a data interaction method based on service template mapping according to a second embodiment of the present invention, where the generation process of service response data is described in detail on the basis of the foregoing embodiments. Wherein the explanation of the same or corresponding terms as those of the above embodiments is not repeated herein. Referring to fig. 2, the service template mapping-based data interaction method provided in this embodiment may include the following steps:
s210, acquiring a service request sent by a 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, extracting and format processing are carried out on the effective request data in the service request data based on the standard request parameter information, so that the standard request data is generated.
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 identifiable by the request end.
Specifically, for each service type, the service response parameter information corresponding to each service type may be stored, 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, where different message types corresponding to the same service type have the same service response parameter information. Or, for each message type, the service response parameter information corresponding to each message type may be stored, 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, where different service types corresponding to the same message type have the same service response parameter information. Or, for each message type corresponding to each service type, the corresponding service response parameter information can be stored, so that the service response parameter information corresponding to the target message type under the target service type is used as the service response parameter information corresponding to the service request, thereby improving the accuracy of data response and further meeting the personalized service requirement.
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 and the service response parameter information in the target service template.
In this embodiment, a mapping relationship between a message type and service response parameter information may be stored in the target service template, so that service response parameter information corresponding to the target message type may be determined based on the mapping relationship in the target service template with reference to the target message type. Since the target message type corresponds to the service request, the service response parameter information corresponding to the target message type is also referred to as service response parameter information corresponding to the service request.
Illustratively, the API (Application Program Interface ) of the service request may be determined by the target message type, and the service response parameter information corresponding to the service request may be obtained by calling and analyzing the API of the service request.
S260, based on the response to the standard request data, standard response data is acquired.
The standard response data may refer to response data obtained by the interconnection server responding to the standard request data.
Specifically, the interconnection server may respond to the standard request data, and obtain standard response data corresponding to the standard request data.
S270, extracting and format processing is carried out on the effective response data in the standard response data based on the service response parameter information, and the service response data is generated and returned.
The valid response data may be response data corresponding to the service response parameter in the index response data. The service response data may refer to response data that the interworking server responds to according to the standard request data. The format processing operations may include, but are not limited to, format contrast 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, valid response data in the standard response data is extracted, so that invalid response data is reduced, and the service response speed is improved. 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 the format of the service response parameter information, format conversion is not needed, and the effective response data can be used as service response data at the moment and the service response data can be returned to the request terminal. If the format of the effective response data in the standard response data is different from the format of the service response parameter information, format conversion is carried out on the format of the effective response data in the standard response data, the effective response data after format conversion is used as the service response data, and the service response data is returned to the request end.
Illustratively, after generating the standard request data, further comprising: persistence is carried out on the standard request data, and the standard request data is stored in a pipeline; service interaction log data is generated based on the standard response data and the standard request data stored in the pipeline.
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 standard request data stored in the pipeline, so that related personnel can conduct data monitoring, abnormality analysis and the like based on the service interaction log data.
According to the technical scheme, service response parameter information corresponding to the service request is determined based on the target service type and/or the target message type, effective response data in standard response data is extracted and formatted based on the service response parameter information, service response data is generated and returned, unified response of the service request is achieved, interconnection service of the data is achieved, invalid response data can be reduced through extraction of the effective response data, and accordingly response speed of the service request is further improved.
On the basis of the above embodiment, the service response parameter information may include: service response parameters and service data response formats. Accordingly, S270 may include: extracting response data corresponding to the service response parameters in the standard response data to obtain extracted effective response data; if the data format corresponding to the effective response data is inconsistent with the service data response format, the response format conversion is carried out on the effective response data based on the service data response format, and the service response data is generated.
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, response data corresponding to the service response parameters in the standard response data may be extracted based on the service response parameters, 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, no response format conversion is required for the effective response data, and the effective response data can be directly used as the service response data. If the data format corresponding to the effective response data is inconsistent 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.
The service response data may be obtained by extracting the valid response data and then performing format conversion, or may be obtained by extracting the valid response data and then performing format conversion. 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 inconsistent with the service data response format, carrying out response format conversion on the standard response data based on the service data response format; extracting response data corresponding to the service response parameters in the standard response data after format conversion to obtain extracted effective response data, and generating service response data.
Specifically, it can 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, no response format conversion is required for the standard response data. If the data format corresponding to the standard response data is inconsistent with the service data response format, the service data response format is used as a reference, and the standard response data is subjected to response format conversion, so that the standard response data in the service data response format is obtained. Extracting response data corresponding to service response parameters in standard response data in a service data response format, obtaining effective response data, and taking the effective response data as the service response data, so that response requirements meeting different request ends can be generated.
On the basis of the above embodiment, extracting response data corresponding to service response parameters 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 the 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 a 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 a standard response parameter and a service response parameter corresponding to each service type may be stored, so that a mapping relationship between a standard response parameter and a service response parameter corresponding to a target service type is used as a mapping relationship between a standard response parameter and a service response parameter corresponding to a service request, where different message types corresponding to the same service type have the same mapping relationship between a standard response parameter and a service response parameter. Or, for each message type, a mapping relationship between a standard response parameter and a service response parameter corresponding to each message type may be stored, so that a mapping relationship between a standard response parameter and a service response parameter corresponding to a target message type is used as a mapping relationship between a standard response parameter and a service response parameter corresponding to a service request, where 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, for each message type corresponding to each service type, a mapping relation between the corresponding standard response parameter and the service response parameter 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 is used as the mapping relation between the standard response parameter and the service response parameter corresponding to the service request, thereby realizing the refinement of the mapping relation, improving the accuracy of data response and further meeting the personalized service requirement.
It should be noted that, the mapping relationship between the standard response parameter and the service response parameter may be stored in the service template, so as to quickly obtain the mapping relationship from the service template. The mapping relation between the standard response parameters and the service response parameters can be separately stored in other storage positions.
After determining the mapping relation between the standard response parameter and the service response parameter, the target standard response parameter corresponding to the service response parameter can be determined based on the mapping relation by taking the service response parameter in the service response parameter information as a reference. For example, the mapping relationship between the standard response parameter and the service response parameter may be: the "Cost" corresponds to the "medical Cost", wherein the "Cost" is a standard response parameter, and the "medical Cost" is a service response parameter. When the service response parameter is 'medical Cost', the 'medical Cost' is determined to be the target standard response parameter according to the mapping relation, so that when the response data corresponding to the service response parameter 'medical Cost' is not contained in the standard response data, the response data corresponding to the target standard response parameter 'Cost' in the standard response data is extracted, and effective response data is obtained, thereby further improving the accuracy of effective response data extraction, further reducing the acquisition of invalid response data, reducing the difficulty of data analysis, and improving the speed of service response.
The following is an embodiment of a service template mapping-based data interaction device provided by the embodiment of the present invention, where the device and the service template mapping-based data interaction method of the foregoing embodiments belong to the same inventive concept, and details of the service template mapping-based data interaction device are not described in detail in the embodiment of the service template mapping-based data interaction device, and reference may be made to the embodiment of the foregoing service template mapping-based data interaction method.
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, where the present embodiment may be applicable to a case of responding to service requests sent by request ends of different services. As shown in fig. 3, the apparatus specifically includes: the service request acquisition module 310, the target type determination module 320, the standard request parameter information determination module 330, the standard request data generation module 340, and the 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 a target service type, and determine standard request parameter information corresponding to a service request based on a mapping relationship between a target message type and the target service template; the standard request data generating module 340 is 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; the service response data generating module 350 is configured to generate service response data and return the service response data based on the response to the standard request data.
According to the technical scheme of the embodiment, the service request sent by the request end is obtained, wherein the service request can comprise service request data and service request address information. The target message type may be determined by the service request data in the service request and the target service type may be determined by the service request address information. Based on the target service type, a target service template corresponding to the target service class 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 standard request data, generating service response data based on response to the standard request data and returning the service response data, so that uniform response of service requests can be realized, interconnection service 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 generation unit is used for carrying out request format conversion on the effective request data based on the standard data request format if the data format corresponding to the effective request data is inconsistent with the standard data request format, so as to generate the standard request data.
Optionally, the effective request data acquiring 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 the service request parameter; determining a target service request parameter corresponding to the standard request parameter in the standard request parameter information based on a mapping relation between the standard request parameter and the service request parameter; and extracting the request data corresponding to the target service request parameters in the service request data to obtain the extracted effective request data.
Optionally, the data interaction device based on the 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 generation unit is used for extracting and carrying out format processing on the effective response data in the standard response data based on the service response parameter information, generating 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 and the service response parameter information in the target service template.
Optionally, the service response parameter information includes: service response parameters and service data response formats. 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 extracted effective response data; and the service response data generation subunit is used for carrying out response format conversion on the effective response data based on the service data response format if the data format corresponding to the effective response data is inconsistent with the service data response format, so as to generate the service response data.
Optionally, the effective response data obtaining subunit may be 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 a 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.
Optionally, the data interaction device based on the service template mapping may further include: the service interaction log data generation module is used for persistence of the standard request data and storing the standard request data into a pipeline; service interaction log data is generated based on the standard response data and the standard request data stored in the pipeline.
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 executing the data interaction method based on the service template mapping.
It should be noted that, in the embodiment of the data interaction device based on the service template mapping, each included unit and module are only divided according to the functional logic, but not limited to the above-mentioned division, so long as the corresponding functions can be implemented; in addition, the specific names of the functional units are also only for distinguishing from each other, and are not used to limit the protection scope of the present invention.
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described 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, while the invention has been described in connection with the above embodiments, the invention is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the invention, which is set forth in the following claims.

Claims (9)

1. A data interaction method based on service template mapping, comprising:
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;
extracting and format-processing effective request data in the service request data based on the standard request parameter information to generate standard request data;
generating service response data based on the response to the standard request data and returning;
the method further comprises the steps of:
determining service response parameter information corresponding to the service request based on the target service type and/or the target message type;
the generating service response data based on the response to the standard request data and returning comprises the following steps:
acquiring standard response data based on the response to the standard request data;
and extracting and format processing effective response data in the standard response data based on the service response parameter information, generating service response data and returning the service response data.
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 and the standard request parameter information in the target service template.
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 are performed on the valid request data in the service request data based on the standard request parameter information, and standard request data is generated, including:
extracting 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 inconsistent with the standard data request format, carrying out request format conversion on the effective request data based on the standard data request format to generate standard request data.
4. A method according to claim 3, wherein 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 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 parameters in the service request data to obtain the extracted effective request data.
5. The method according to claim 1, 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 and the service response parameter information in the target service template.
6. The method of claim 1, wherein the service response parameter information comprises: service response parameters and service data response formats;
the extracting and format processing are performed on the valid response data in the standard response data based on the service response parameter information, and the generating 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 inconsistent 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.
7. The method according to claim 6, wherein 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 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;
extracting response data corresponding to the target standard response parameters in the standard response data to obtain extracted effective response data.
8. The method of any of claims 5-7, further comprising, after generating the standard request data:
persistence is carried out on the standard request data, and the standard request data is stored in a pipeline;
service interaction log data is generated based on the standard response data and the standard request data stored in the pipeline.
9. A data interaction device based on service template mapping, 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;
The standard request parameter information determining module is used for 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;
the standard request data generation module is used for extracting and carrying out format processing on the effective request data in the service request data based on the standard request parameter information to generate standard request data;
the service response data generation module is used for generating service response data and returning the service response data based on the response to the standard request data;
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;
the service response data generation module includes: 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 generation unit is used for extracting and carrying out format processing on the effective response data in the standard response data based on the service response parameter information, generating service response 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 CN115396525A (en) 2022-11-25
CN115396525B true 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 (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102055686A (en) * 2011-01-24 2011-05-11 宇龙计算机通信科技(深圳)有限公司 Data exchange method and system as well as mobile terminal
CN108243022A (en) * 2016-12-23 2018-07-03 中国移动通信有限公司研究院 A kind of web service messages transmission method, device, terminal and server
CN113259375A (en) * 2021-06-10 2021-08-13 长视科技股份有限公司 Video service response method and electronic equipment

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8700469B2 (en) * 2006-03-06 2014-04-15 Apple Inc. System and method for delivering advertising with enhanced effectiveness
US8756324B2 (en) * 2011-12-02 2014-06-17 Hewlett-Packard Development Company, L.P. Automatic cloud template approval
US20140358991A1 (en) * 2013-05-31 2014-12-04 Fluke Corporation Integrating data from various network nodes using a template stack
CN106161178B (en) * 2015-03-24 2019-08-02 阿里巴巴集团控股有限公司 A kind of method and apparatus accessing instant messaging network
CN109344183B (en) * 2018-01-30 2020-11-24 深圳壹账通智能科技有限公司 Data interaction method and 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
CN109524065B (en) * 2018-11-07 2024-06-25 深圳平安医疗健康科技服务有限公司 Medical data query method, medical data platform and related devices
CN213876824U (en) * 2020-07-28 2021-08-03 四川大学华西医院 Medical shift work attendance system
CN114153626A (en) * 2021-10-29 2022-03-08 深圳市金蝶天燕云计算股份有限公司 Method and device for abstracting service integration process and computer equipment
CN113705226B (en) * 2021-10-29 2022-02-11 上海柯林布瑞信息技术有限公司 Medical text entity labeling method and device
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 (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102055686A (en) * 2011-01-24 2011-05-11 宇龙计算机通信科技(深圳)有限公司 Data exchange method and system as well as mobile terminal
CN108243022A (en) * 2016-12-23 2018-07-03 中国移动通信有限公司研究院 A kind of web service messages transmission method, device, terminal and server
CN113259375A (en) * 2021-06-10 2021-08-13 长视科技股份有限公司 Video service response method and electronic equipment

Non-Patent Citations (2)

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

Also Published As

Publication number Publication date
CN115396525A (en) 2022-11-25

Similar Documents

Publication Publication Date Title
CN108984388B (en) Method and terminal equipment for generating automatic test case
CN107872437B (en) Method, device and server for service request
CN110022289B (en) Data transmission method, device and system
CN112148674B (en) Log data processing method, device, computer equipment and storage medium
CN107360261B (en) HTTP request processing method and device and electronic equipment
CN114500690B (en) Interface data processing method and device, electronic equipment and storage medium
CN112182036A (en) Data sending and writing method and device, electronic equipment and readable storage medium
CN110784509B (en) Medical information processing method and system and related components
CN111988418B (en) Data processing method, device, equipment and computer readable storage medium
CN111782652B (en) Data calling method, device, computer equipment and storage medium
CN112511591A (en) Method, device, equipment and medium for realizing hospital interface data interaction
CN110704200A (en) Method and device for converting call interface
CN111200649B (en) Scheduling method and device and scheduling model generation method and device
CN111180051A (en) Medical image data processing method and device
CN115396525B (en) Data interaction method and device based on service template mapping
CN113760562A (en) Link tracking method, device, system, server and storage medium
CN111953931A (en) Data sharing method and device and storage medium
CN112417016A (en) Data exchange method, system, equipment and storage medium
CN112491943A (en) Data request method, device, storage medium and electronic equipment
CN107483294B (en) Method and device for monitoring network request
CN113596105B (en) Content acquisition method, edge node and computer readable storage medium
CN112948474B (en) Data export method, device, equipment and computer readable storage medium
CN114647688A (en) Service data sharing method and device and computer storage medium
CN113918245A (en) Data calling method, device, equipment and computer readable storage medium
US20110320527A1 (en) Method and system for managing a web-domain request

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