CN112115190A - Method, device and system for converting interface message - Google Patents

Method, device and system for converting interface message Download PDF

Info

Publication number
CN112115190A
CN112115190A CN202010842893.XA CN202010842893A CN112115190A CN 112115190 A CN112115190 A CN 112115190A CN 202010842893 A CN202010842893 A CN 202010842893A CN 112115190 A CN112115190 A CN 112115190A
Authority
CN
China
Prior art keywords
interface
converted
field
target
message
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
CN202010842893.XA
Other languages
Chinese (zh)
Other versions
CN112115190B (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.)
Suning Cloud Computing Co Ltd
Original Assignee
Suning Cloud Computing 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 Suning Cloud Computing Co Ltd filed Critical Suning Cloud Computing Co Ltd
Priority to CN202010842893.XA priority Critical patent/CN112115190B/en
Publication of CN112115190A publication Critical patent/CN112115190A/en
Priority to CA3128537A priority patent/CA3128537A1/en
Application granted granted Critical
Publication of CN112115190B publication Critical patent/CN112115190B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/258Data format conversion from or to a database
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems

Abstract

The invention discloses a conversion method, a device and a system of interface messages. The method comprises the following steps: acquiring a target interface corresponding to an interface to be converted; matching a target field for a field to be converted in the interface message to be converted according to the target interface; generating a field mapping instruction according to the field to be converted and the target field; and mapping the field to be converted into the target field according to the field mapping instruction. The invention breaks away from the project development mode of the original hard code compiling, realizes the quick and efficient butt joint with the service providing end system, and simultaneously avoids the waste of research and development resources caused by the frequent change of the client side interface requirements.

Description

Method, device and system for converting interface message
Technical Field
The present invention relates to the field of application program interface adaptation technologies, and in particular, to a method, an apparatus, and a system for converting an interface packet.
Background
An Application Program Interface (API) is middleware that realizes communication between computer software by using a set of preset definitions, programs, and protocols. At present, instruction conversion between a service request end and a service providing end is mostly needed to be realized through an API for operations such as information query, data uploading and the like on the internet by a user, so that the service request end and the service providing end need to adopt the same set of interface component scheme (namely interface message), but in the actual operation process, the service request end has the situation of the interface component scheme defined by the service request end, the interface component scheme is often different from the interface component scheme adopted by the service providing end, and the interfaces of the service request end and the service providing end are difficult to match when the time comes, so that the interface component scheme of the service request end or the interface component scheme of the service providing end need to be converted to be kept consistent, data transmission is realized, and therefore, a conversion technology of the interface message is generated.
In the prior art, the conversion of interface messages mainly includes two ways: one is according to the self-defined interface specification of the service request end, the service provider end makes the development of the customized interface service through the way of hard coding; the other is that the service request end establishes data transmission between the self-contained platform and the service providing end by referring to the standard API open type interface component scheme provided by the service providing end. However, for the first method, different message formats and the specification, customization, development and data conversion of the document of the service request end cannot realize the reusability of the system, the research and development period is long, and the later operation and maintenance cost is high; for the second mode, although the standardized interface service is provided for the service request end, and the research and development burden of the server providing end is reduced, the system modification cost and the research and development investment of the service request end are increased, and inconvenience is brought to the service providing end.
Disclosure of Invention
In order to solve the problems in the prior art, embodiments of the present invention provide a method, an apparatus, and a system for converting an interface packet. The technical scheme is as follows:
in a first aspect, a method for converting an interface packet is provided, where the method includes:
according to the obtained target interface corresponding to the interface to be converted;
matching a target field for a field to be converted in an interface message to be converted according to the target interface, and establishing a mapping relation between the field to be converted and the target field;
generating a field mapping instruction according to the mapping relation between the field to be converted and the target field;
and converting the field to be converted into the target field according to the field mapping instruction.
Further, the matching of the target field for the field to be converted in the interface message to be converted according to the target interface includes:
calling a corresponding target interface parameter table according to the target interface;
and matching the field to be converted with the target interface parameter table to obtain the target field.
Further, the obtaining of the field to be converted includes:
acquiring a message structure tree according to the interface message to be converted, wherein nodes in the message structure tree are fields in the interface message to be converted;
and taking the field corresponding to the node selected by the user in the message structure tree as the field to be converted.
Further, the interface message to be converted is a request parameter message or a return parameter message.
Further, the method further comprises:
if an instruction for analyzing the field value of the field to be converted is received, acquiring a field value analysis rule;
generating an analysis instruction according to a field value analysis rule selected by a user;
and analyzing the field value of the field to be converted according to the analysis instruction.
Further, the method further comprises:
matching a target abnormal code for the received abnormal code to be converted according to the target interface;
generating an abnormal code mapping instruction according to the abnormal code to be converted and the target abnormal code;
and converting the abnormal code to be converted into the target abnormal code according to the abnormal code mapping instruction.
Further, the matching of the target exception code for the received exception code to be converted according to the target interface includes:
calling a corresponding target interface abnormal code table according to the target interface;
and matching the field to be converted with the target interface abnormal code table to obtain the target abnormal code.
Further, the acquiring a target interface corresponding to the interface to be converted includes:
acquiring a corresponding relation between the interface to be converted and the target interface according to a user account, and acquiring the target interface corresponding to the interface to be converted according to the corresponding relation;
before the obtaining of the target interface corresponding to the interface to be converted, the method further includes:
acquiring interface information to be converted corresponding to the interface message to be converted, and calling user interface information associated with the user account;
and comparing the interface information to be converted with the user interface information, and if the interface information to be converted is consistent with the user interface information, successfully verifying.
In a second aspect, an interface packet converting apparatus is provided, where the apparatus includes:
the target interface acquisition module is used for acquiring a target interface corresponding to the interface to be converted;
the matching module is used for matching a target field for a field to be converted in an interface message to be converted according to the target interface and establishing a mapping relation between the field to be converted and the target field;
a conversion instruction generating module, configured to generate a field mapping instruction according to the mapping relationship between the field to be converted and the target field;
and the field conversion module is used for converting the field to be converted into the target field according to the field mapping instruction.
Further, the field conversion module further comprises:
and the calling module is used for calling the corresponding target interface parameter table according to the target interface.
And the target field acquisition module is used for matching the field to be converted with the target interface parameter table to acquire the target field.
Further, the field conversion module includes:
and the message structure tree acquisition module is used for acquiring a message structure tree according to the interface message to be converted, and nodes in the message structure tree are fields in the interface message to be converted.
And the field to be converted determining module is used for taking the field corresponding to the node selected by the user in the message structure tree as the field to be converted.
Further, the interface message to be converted is a request parameter message or a return parameter message.
Further, the apparatus further comprises:
and the field value analysis rule acquisition module is used for acquiring a field value analysis rule when receiving an instruction of field value analysis of the field to be converted.
And the analysis instruction generation module is used for generating an analysis instruction according to the field value analysis rule selected by the user.
And the field value conversion module is used for analyzing the field value of the field to be converted according to the analysis instruction.
Further, the apparatus further comprises:
and the target abnormal code matching module is used for matching the target abnormal code for the received abnormal code to be converted according to the target interface.
And the abnormal code mapping instruction generating module is used for generating an abnormal code mapping instruction according to the abnormal code to be converted and the target abnormal code.
And the target abnormal code mapping module is used for converting the abnormal code to be converted into the target abnormal code according to the abnormal code mapping instruction.
Further, the target abnormal code matching module is specifically configured to call a corresponding target interface abnormal code table according to the target interface;
and matching the field to be converted with the target interface abnormal code table to obtain the target abnormal code.
Further, the target interface obtaining module is specifically configured to obtain a corresponding relationship between the interface to be converted and the target interface according to a user account, and obtain the target interface corresponding to the interface to be converted according to the corresponding relationship;
the device further comprises:
and the user interface information acquisition module is used for acquiring the interface information to be converted corresponding to the interface message to be converted and calling the user interface information associated with the user account.
And the checking module is used for comparing the interface information to be converted with the user interface information, and if the interface information to be converted is consistent with the user interface information, the checking is successful.
In a third aspect, there is provided a computer system comprising:
one or more processors; and
a memory associated with the one or more processors for storing program instructions that, when read and executed by the one or more processors, perform the method of the first aspect described above.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
1. according to the technical scheme, the associated target interface is obtained through the user account, the target field is automatically matched through the interface code to be converted and the target interface, and the field mapping instruction is generated and has reusability, so that the scheme is separated from a project development mode written by original hard codes, the quick and efficient butt joint with a service providing end system is realized, and the waste of research and development resources caused by frequent change of the interface requirement of a client side is avoided;
2. according to the technical scheme disclosed by the invention, the interface message to be converted is analyzed in a message structure tree form, so that the management of a visual configuration mode is realized, the project docking is more flexible, the multiplexing of multiple projects is realized, the investment of development resources and project operation and maintenance cost is reduced, the accuracy and integrity of the address data of a client are ensured, and the purchasing efficiency of the client is improved.
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 flowchart of a method for converting an interface packet according to an embodiment of the present invention;
fig. 2 is a flowchart of a conversion method of an interface message including an exception code according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a conversion apparatus for interface packets according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a computer system according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying 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.
In the internal purchasing and bidding process, in order to ensure the openness and transparency of the purchasing price and the convenience and high efficiency of the purchasing process, some large-scale enterprise clients can build an internal purchasing platform by themselves and bid suppliers at all levels by adopting a mode of docking the electronic commerce system on the line, the data intercommunication of full-transaction links of commodities, orders, logistics, after-sales, reconciliation, invoices and the like is realized by both side systems, and an API docking scheme is adopted in the data intercommunication mode.
Since the supplier is often more than one supplier, in order to facilitate the management of the supplier and meet the relevant requirements of internal procurement policy and regulation, the enterprise client will create a standard API docking scheme for the supplier system. The scheme defines interface protocol, submission mode, data format, URL of each interface, parameters of input and output of the interface, parameter type requirement, message format and sample description in detail. However, the API of the provider system is often customized and different from the target interface docking scheme proposed by the enterprise, so that the interface message of the provider system needs to be unified with the interface message of the purchasing platform system of the enterprise client.
In the process of unified conversion, because the requirements of the enterprise client are substantially different from the requirements of the supplier system and the business, including but not limited to different definitions and requirements of field names, field types and message structures of commodity name input and output, detailed requirement analysis, application establishment, preparation of research and development resources and implementation of an API docking scheme meeting the requirements of the user side are required according to the requirements of user document specifications and by combining the internal business and system characteristics of the supplier. The e-commerce full-flow API docking main flow generally relates to 8 large modules after commodities, prices, stocks, orders, logistics, account checking, invoices and sales, and 20 independent interfaces, and a full closed loop of the whole transaction information flow can be created only through the service of an interface component. The project is put into operation from access to online to production operation, and needs 80-100 people to invest at least every day without calculating later-stage operation and maintenance, so that under the condition of limited research and development resources, the project online time required in a user side bid contract is difficult to meet, the credit crisis of a company and large default loss are caused, and if the project quality is only sacrificed in order to guarantee the construction period, the potential safety hazard of a system is buried in the later-stage operation.
Therefore, in order to solve the problems in the prior art, embodiments of the present invention provide a method, an apparatus, and a system for converting an interface packet, where the specific technical solution is as follows:
as shown in fig. 1, a method for converting an interface message includes:
and S1, acquiring a target interface corresponding to the interface to be converted.
The target interface is selected when the user registers, is associated with the user account, and can select one or more target interfaces, so that the one or more target interfaces can be acquired when the target interface associated with the user account is acquired.
And S2, matching a target field for the field to be converted in the interface message to be converted according to the target interface, and establishing a mapping relation between the field to be converted and the target field.
As described above, the interface message to be converted is a request parameter message when entering the participation, and the interface message to be converted is a return parameter message when leaving the participation. The target field is a field included in a target interface message corresponding to the target interface. When there are multiple target interfaces, there may be multiple target fields matched with the field to be converted, in which case, the user needs to select one target field from the mappable target fields as the final target field to be mapped.
In one embodiment, the obtaining of the field to be converted in step S2 includes:
s21, obtaining a message structure tree according to the interface message to be converted, wherein the nodes in the message structure tree are fields in the interface message to be converted.
And S22, taking the field corresponding to the node selected by the user in the message structure tree as the field to be converted.
The field to be converted is determined as the field to be converted when the interface message to be converted is converted into the target interface message, so that after the field to be converted is determined, when the conversion is executed, the user only needs to determine the interface to be converted and the target interface.
The above two situations include obtaining the message structure tree:
one is that, directly parsing the interface message to be converted into a message structure tree;
one is that, the user creates a father node according to the interface message to be converted, and selects a field in the interface message to be converted to construct a node, thereby constructing a message structure tree step by step.
In one embodiment, step S2 includes:
and S23, calling a corresponding target interface parameter table according to the target interface.
And S24, matching the field to be converted with the target interface parameter table to obtain the target field.
The target interface parameter table includes target fields corresponding to the fields to be converted specified by the service personnel according to the target interface message.
In one embodiment, invoking the corresponding target interface parameter table according to the target interface comprises:
s231, matching the interface type of the target interface with the target interface classification table, and determining the target interface table.
S232, matching the interface name of the target interface with the target interface table, and determining a target interface parameter table.
The target interface classification table, the target interface table and the target interface parameter table are all formulated by technical personnel according to target interface information, SQL is adopted for initialization, and incremental SQL change maintenance is carried out if changes follow-up.
And S3, generating a field mapping instruction according to the field to be converted and the target field.
The field mapping instruction comprises the mapping relation between the field to be converted and the target field, the field mapping instruction is stored in the database and can be multiplexed, and only the corresponding interface to be converted and the target interface need to be selected subsequently.
And S4, converting the field to be converted into the target field according to the field mapping instruction.
In the above step S4, the mapping from the field to be converted to the target field is completed, and by analogy, the mapping conversion of all the fields in the interface message to be converted can be completed, so as to complete the unification of the interface message to be converted and the target interface message.
In one embodiment, the method further comprises:
s5, if an instruction of field value analysis of the field to be converted is received, acquiring a field value analysis rule.
And S6, generating an analysis command according to the field value analysis rule selected by the user.
And S7, resolving the field value of the field to be converted according to the resolving instruction.
As described above, after determining the field to be converted in step S22, the user may further configure the parameter basic information, the mapping field information, and the field value parsing rule information for the field to be converted.
Wherein, the parameter basic information comprises: field name, whether it is a mandatory field, whether it is an array, field type, value of an entry reference, and field description. The field types may be: "String", "int", "long", "double", "object", etc.
The mapping field information includes: the one or more target fields matched in step S2.
The field value parsing rule information includes: whether to parse, and a field value parsing rule.
The field value parsing rule at least comprises: basic type conversion, mapping value type conversion, basic array to object array, "division to object array, date format conversion, digital format conversion, four fundamental operations, 7 kinds of corresponding rules are described as follows:
basic type conversion: such as int reshaping- > string, 123- > "123".
And (3) conversion of the type of the mapping value: if the customized value is converted into the standard value, or conversely, if 0- > false and 1- > true, the converted value rule configuration is needed, the mapping standard value must be an enumeration type, the selected value does not support manual input, and the base table records an optional configuration item of the enumeration value.
Converting the basic array into the object array: the method belongs to structural instruction conversion, and a basic array is converted into an object array.
"," split to object array: the method belongs to structural instruction conversion, and an object array is converted into a comma separated character string for splitting.
And (3) converting the date format: and the date format conversion at the user side is matched into a date format which can be identified by a target field, such as yyyMMddHHmmss- > "YYYY-MM-DD hh: MM: ss".
Digital format conversion: and converting the digital format of the user side into a digital format which can be identified by the target field, and ensuring that the numerical precision and decimal place number required by the user side are consistent with the target interface.
Four operations are as follows: and inputting a constant to realize addition, subtraction, multiplication and division operations between the selected field value and the constant.
The data type and the analysis rule linkage logic are shown in the following table 1, and the numerical types comprise: int, long, double.
TABLE 1
Figure BDA0002642079160000091
It should be noted that the methods disclosed in S1 to S7 may be applied to the interface message to be converted as a request parameter or a return parameter, respectively, and for the return parameter, the parsing rule of the field value is basically opposite to that of the request parameter, including:
converting the object array into the basic array, separating, judging null values, setting fixed values and converting input parameters into output parameters, wherein the corresponding rules are explained as follows:
converting the object array into the basic array: the conversion target value is inverted in correspondence with the entry parameter "basic array to object array" rule.
Object array transfer "," partition: the conversion target values are inverted corresponding to the 'split object array' rule of 'argument'.
And (4) judging a null value: and returning whether the configuration is successful or not according to the field value of the standard errorCode only under the condition that the target interface has no reference back field.
Setting a fixed value: directly setting a fixed value returned by a certain field of the customized interface.
And (3) transferring ginseng in and out: and mapping items are input fields configured for the customized interface, and when the input fields are output, the field values have no conversion rule, and the field values in the request are directly returned.
The data type and the analysis rule linkage logic are shown in the following table 2, and the numerical types include: int, long, double.
TABLE 2
Figure BDA0002642079160000101
In one embodiment, the method further comprises:
and S8, matching the target abnormal code for the received abnormal code to be converted according to the target interface.
And S9, generating an exception code mapping instruction according to the exception code to be converted and the target exception code.
And S10, mapping the exception code to be converted into the target exception code according to the exception code mapping instruction.
The exception code is a code returned when the interface is abnormal. The problem that the abnormal code of the interface message to be converted is inconsistent with the abnormal code of the target interface message exists, so the embodiment of the invention further provides a technical scheme for converting the abnormal code.
It should be noted that, as shown in fig. 2, in an embodiment, the request parameter is first subjected to message conversion, then the return parameter is subjected to message conversion, and finally the abnormal code is converted. Before the conversion of the return parameters, the default item judgment is carried out on the mandatory item field of the target interface, if the default field exists, a fixed value needs to be configured for complementing, and if the default field does not exist, the process directly enters a return parameter configuration link. Similarly, after the return parameter is converted, before the exception code is converted, default item judgment needs to be carried out on the necessary field of the target interface.
In one embodiment, the obtaining of the target interface corresponding to the interface to be converted in step S1 includes:
acquiring a corresponding relation between an interface to be converted and a target interface according to a user account, and acquiring the target interface corresponding to the interface to be converted according to the corresponding relation;
before step S1, the method further includes:
and acquiring interface information to be converted corresponding to the interface message to be converted, and calling user interface information associated with the user account.
Above, the interface information to be converted includes: interface attribution user, interface type, interface name and interface code. The user interface information is obtained when the user registers, and is bound with the user account. The user interface information includes: the interface attribution user, the interface type, the interface name and the interface code can also comprise: interface description, input return message format.
And comparing the interface information to be converted with the user interface information, and if the interface information to be converted is consistent with the user interface information, successfully verifying.
The above-mentioned comparison of the interface information to be converted with the user interface information is the check of the user and the interface message to be converted, and the problem that the interface message to be converted does not conform to the user interface information can be eliminated through the check.
As shown in fig. 3, based on the above method for converting an interface packet, an embodiment of the present invention further provides a device for converting an interface packet, including: a request parameter message conversion module 31 and a return parameter message conversion module 32. The request parameter message conversion module 31 and the return parameter message conversion module 32 have the same structure, and specifically include:
and a target interface obtaining module 311, configured to obtain a target interface corresponding to the interface to be converted.
The matching module 312 is configured to match a target field for a field to be converted in an interface message to be converted according to a target interface, and establish a mapping relationship between the field to be converted and the target field.
And the conversion instruction generating module 313 is configured to generate a field mapping instruction according to the field to be converted and the target field.
And the field conversion module 314 is configured to convert the field to be converted into the target field according to the field mapping instruction.
In one embodiment, the field conversion module 314 includes:
and the message structure tree acquisition module is used for acquiring a message structure tree according to the interface message to be converted, and nodes in the message structure tree are fields in the interface message to be converted.
And the field to be converted determining module is used for taking the field corresponding to the node selected by the user in the message structure tree as the field to be converted.
The specific operation method of the message structure tree acquisition module may be as follows: analyzing the interface message to be converted into a message structure tree; it can also be: receiving a father node created by a user and a field construction node in the selected interface message to be converted, thereby constructing a message structure tree.
In one embodiment, the field conversion module 314 further comprises:
and the calling module is used for calling the corresponding target interface parameter table according to the target interface.
And the target field acquisition module is used for matching the field to be converted with the target interface parameter table to acquire the target field.
In one embodiment, the calling module is specifically configured to:
matching the interface type of the target interface with the target interface classification table to ensure the target interface table;
and matching the interface name of the target interface with the target interface table, and determining a target interface parameter table.
In one embodiment, the above apparatus further comprises:
the field value parsing rule obtaining module 315 is configured to obtain a field value parsing rule when an instruction of field value parsing of a field to be converted is received.
The parsing instruction generating module 316 is configured to generate a parsing instruction according to a field value parsing rule selected by a user.
The field value converting module 317 is configured to parse the field value of the field to be converted according to the parsing instruction.
The field value parsing rules of the request parameter packet and the return parameter packet are as described in the method embodiment.
In one embodiment, the above apparatus further comprises: the exception code conversion module 33 specifically includes:
and the target exception code matching module 331 is configured to match the target exception code for the received exception code to be converted according to the target interface.
The target exception code matching module 331 is specifically configured to call a corresponding target interface exception code table according to the target interface; and matching the field to be converted with the target interface abnormal code table to obtain the target abnormal code.
The exception code mapping instruction generating module 332 is configured to generate an exception code mapping instruction according to the exception code to be converted and the target exception code.
And a target exception code mapping module 333, configured to map the exception code to be converted into the target exception code according to the exception code mapping instruction.
In an embodiment, the target interface obtaining module 311 is specifically configured to obtain a corresponding relationship between an interface to be converted and a target interface according to a user account, and obtain the target interface corresponding to the interface to be converted according to the corresponding relationship.
The above-mentioned device still includes:
the user interface information obtaining module 34 is configured to obtain interface information to be converted corresponding to the interface message to be converted, and call user interface information associated with the user account.
And the checking module 35 is configured to compare the interface information to be converted with the user interface information, and if the interface information is consistent with the user interface information, the checking is successful.
Based on the foregoing method embodiment, an embodiment of the present invention further provides a computer system, including:
one or more processors; and
and a memory associated with the one or more processors, the memory for storing program instructions, the program instructions when read and executed by the one or more processors, performing the above-mentioned pushing method of the merchandise information.
Fig. 4 illustrates an architecture of a computer system, which may include, in particular, a processor 410, a video display adapter 411, a disk drive 412, an input/output interface 413, a network interface 414, and a memory 420. The processor 410, the video display adapter 411, the disk drive 412, the input/output interface 413, the network interface 414, and the memory 420 may be communicatively connected by a communication bus 430.
The processor 410 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits, and is configured to execute related programs to implement the technical solution provided by the present Application.
The Memory 420 may be implemented in the form of a ROM (Read Only Memory), a RAM (Random Access Memory), a static storage device, a dynamic storage device, or the like. The memory 420 may store an operating system 421 for controlling the operation of the electronic device 400, a basic input output system 422(BIOS) for controlling low-level operations of the electronic device 400. In addition, a web browser 423, a data storage management system 424, and a device identification information processing system 425, and the like, may also be stored. The device identification information processing system 425 may be an application program that implements the operations of the foregoing steps in this embodiment of the present application. In summary, when the technical solution provided in the present application is implemented by software or firmware, the relevant program code is stored in the memory 420 and called to be executed by the processor 410.
The input/output interface 413 is used for connecting an input/output module to realize information input and output. The i/o module may be configured as a component in a device (not shown) or may be external to the device to provide a corresponding function. The input devices may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output devices may include a display, a speaker, a vibrator, an indicator light, etc.
The network interface 414 is used to connect a communication module (not shown in the figure) to implement communication interaction between the present device and other devices. The communication module can realize communication in a wired mode (such as USB, network cable and the like) and also can realize communication in a wireless mode (such as mobile network, WIFI, Bluetooth and the like).
Bus 430 includes a path that transfers information between the various components of the device, such as processor 410, video display adapter 411, disk drive 412, input/output interface 413, network interface 414, and memory 420.
In addition, the electronic device 400 may also obtain information of specific pickup conditions from the virtual resource object pickup condition information database 441 for performing condition judgment, and the like.
It should be noted that although the above-mentioned devices only show the processor 410, the video display adapter 411, the disk drive 412, the input/output interface 413, the network interface 414, the memory 420, the bus 430 and so on, in a specific implementation, the device may also include other components necessary for normal operation. Furthermore, it will be understood by those skilled in the art that the apparatus described above may also include only the components necessary to implement the solution of the present application, and not necessarily all of the components shown in the figures.
From the above description of the embodiments, it is clear to those skilled in the art that the present application can be implemented by software plus necessary general hardware platform. Based on such understanding, the technical solutions of the present application may be essentially implemented or the portions contributing to the prior art may be embodied in the form of a software product, which may be stored in a storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method of the embodiments or some portions of the embodiments of the present application.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, the system or system embodiments are substantially similar to the method embodiments and therefore are described in a relatively simple manner, and reference may be made to some of the descriptions of the method embodiments for related points. The above-described system and system embodiments are merely illustrative, wherein units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
1. according to the technical scheme, the associated target interface is obtained through the user account, the target field is automatically matched through the interface code to be converted and the target interface, the field mapping instruction is generated, a project development mode written by the original hard code is separated, the quick and efficient butt joint with a service providing end system is realized, and the waste of research and development resources caused by frequent change of the interface requirement of a client side is avoided;
2. according to the technical scheme disclosed by the invention, the interface message to be converted is analyzed in a message structure tree form, so that the management of a visual configuration mode is realized, the project docking is more flexible, the multiplexing of multiple projects is realized, the investment of development resources and project operation and maintenance cost is reduced, the accuracy and integrity of the address data of a client are ensured, and the purchasing efficiency of the client is improved.
All the above-mentioned optional technical solutions can be combined arbitrarily to form the optional embodiments of the present invention, and are not described herein again.
The present invention is not limited to the above preferred embodiments, and any modifications, equivalent replacements, improvements, etc. within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method for converting interface messages is characterized by comprising the following steps:
acquiring a target interface corresponding to an interface to be converted;
matching a target field for a field to be converted in an interface message to be converted according to the target interface, and establishing a mapping relation between the field to be converted and the target field;
generating a field mapping instruction according to the mapping relation between the field to be converted and the target field;
and converting the field to be converted into the target field according to the field mapping instruction.
2. The method of claim 1, wherein the matching a target field for a field to be converted in an interface message to be converted according to the target interface comprises:
calling a corresponding target interface parameter table according to the target interface;
and matching the field to be converted with the target interface parameter table to obtain the target field.
3. The method of claim 1, wherein the obtaining of the field to be converted comprises:
acquiring a message structure tree according to the interface message to be converted, wherein nodes in the message structure tree are fields in the interface message to be converted;
and taking the field corresponding to the node selected by the user in the message structure tree as the field to be converted.
4. The method according to any one of claims 1 to 3, wherein the interface message to be converted is a request parameter message or a return parameter message.
5. The method of any one of claims 1 to 3, further comprising:
if an instruction for analyzing the field value of the field to be converted is received, acquiring a field value analysis rule;
generating an analysis instruction according to a field value analysis rule selected by a user;
and analyzing the field value of the field to be converted according to the analysis instruction.
6. The method of any one of claims 1 to 3, further comprising:
matching a target abnormal code for the received abnormal code to be converted according to the target interface;
generating an abnormal code mapping instruction according to the abnormal code to be converted and the target abnormal code;
and converting the abnormal code to be converted into the target abnormal code according to the abnormal code mapping instruction.
7. The method of claim 6, wherein said matching a target exception code for a received exception code to be translated according to the target interface comprises:
calling a corresponding target interface abnormal code table according to the target interface;
and matching the field to be converted with the target interface abnormal code table to obtain the target abnormal code.
8. The method according to any one of claims 1 to 3, wherein the obtaining of the target interface corresponding to the interface to be converted comprises:
acquiring a corresponding relation between the interface to be converted and the target interface according to a user account, and acquiring the target interface corresponding to the interface to be converted according to the corresponding relation;
before the obtaining of the target interface corresponding to the interface to be converted, the method further includes:
acquiring interface information to be converted corresponding to the interface message to be converted, and calling user interface information associated with the user account;
and comparing the interface information to be converted with the user interface information, and if the interface information to be converted is consistent with the user interface information, successfully verifying.
9. An interface message conversion device, comprising:
the target interface acquisition module is used for acquiring a target interface corresponding to the interface to be converted;
the matching module is used for matching a target field for a field to be converted in an interface message to be converted according to the target interface and establishing a mapping relation between the field to be converted and the target field;
a conversion instruction generating module, configured to generate a field mapping instruction according to the mapping relationship between the field to be converted and the target field;
and the field conversion module is used for converting the field to be converted into the target field according to the field mapping instruction.
10. A computer system, comprising:
one or more processors; and
a memory associated with the one or more processors for storing program instructions that, when read and executed by the one or more processors, perform the method of any of claims 1-8 above.
CN202010842893.XA 2020-08-20 2020-08-20 Method, device and system for converting interface message Active CN112115190B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202010842893.XA CN112115190B (en) 2020-08-20 2020-08-20 Method, device and system for converting interface message
CA3128537A CA3128537A1 (en) 2020-08-20 2021-08-17 Interface message conversion method, device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010842893.XA CN112115190B (en) 2020-08-20 2020-08-20 Method, device and system for converting interface message

Publications (2)

Publication Number Publication Date
CN112115190A true CN112115190A (en) 2020-12-22
CN112115190B CN112115190B (en) 2022-11-18

Family

ID=73804194

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010842893.XA Active CN112115190B (en) 2020-08-20 2020-08-20 Method, device and system for converting interface message

Country Status (2)

Country Link
CN (1) CN112115190B (en)
CA (1) CA3128537A1 (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112769975A (en) * 2020-12-31 2021-05-07 武汉联影医疗科技有限公司 Data integration method and device, server and storage medium
CN112882974A (en) * 2021-02-09 2021-06-01 深圳市云网万店科技有限公司 JSON data conversion method and device, computer equipment and storage medium
CN113535832A (en) * 2021-06-10 2021-10-22 杭州未名信科科技有限公司 Method and device for acquiring cloud service data, electronic equipment and medium
CN113783860A (en) * 2021-09-01 2021-12-10 建信金融科技有限责任公司 Message processing method, device and equipment based on visual configuration
CN113938530A (en) * 2021-09-09 2022-01-14 中国联合网络通信集团有限公司 Data transmission method and device
CN114338835A (en) * 2021-12-31 2022-04-12 中企云链(北京)金融信息服务有限公司 Data message dynamic conversion method and device, storage medium and electronic device
CN114500690A (en) * 2022-02-15 2022-05-13 平安科技(深圳)有限公司 Interface data processing method and device, electronic equipment and storage medium
CN115866087A (en) * 2022-11-29 2023-03-28 广发银行股份有限公司 Message mapping and HTTP request message conversion method and device

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115103034A (en) * 2022-06-27 2022-09-23 京东科技信息技术有限公司 Message protocol conversion method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101335648A (en) * 2008-07-25 2008-12-31 中兴通讯股份有限公司 Automatic converting method for packets of different interfaces and apparatus thereof
CN107463409A (en) * 2017-08-11 2017-12-12 深圳乐信软件技术有限公司 A kind of interface conversion method, interface convertor, storage medium and electric terminal
CN109831440A (en) * 2019-02-21 2019-05-31 中国联合网络通信集团有限公司 Interface packets conversion method, device and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101335648A (en) * 2008-07-25 2008-12-31 中兴通讯股份有限公司 Automatic converting method for packets of different interfaces and apparatus thereof
CN107463409A (en) * 2017-08-11 2017-12-12 深圳乐信软件技术有限公司 A kind of interface conversion method, interface convertor, storage medium and electric terminal
CN109831440A (en) * 2019-02-21 2019-05-31 中国联合网络通信集团有限公司 Interface packets conversion method, device and storage medium

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112769975B (en) * 2020-12-31 2022-06-24 武汉联影医疗科技有限公司 Data integration method and device, server and storage medium
CN112769975A (en) * 2020-12-31 2021-05-07 武汉联影医疗科技有限公司 Data integration method and device, server and storage medium
CN112882974A (en) * 2021-02-09 2021-06-01 深圳市云网万店科技有限公司 JSON data conversion method and device, computer equipment and storage medium
CN112882974B (en) * 2021-02-09 2024-01-05 深圳市云网万店科技有限公司 JSON data conversion method and device, computer equipment and storage medium
CN113535832A (en) * 2021-06-10 2021-10-22 杭州未名信科科技有限公司 Method and device for acquiring cloud service data, electronic equipment and medium
CN113783860A (en) * 2021-09-01 2021-12-10 建信金融科技有限责任公司 Message processing method, device and equipment based on visual configuration
CN113783860B (en) * 2021-09-01 2023-11-28 建信金融科技有限责任公司 Message processing method, device, equipment and storage medium based on visual configuration
CN113938530B (en) * 2021-09-09 2023-06-23 中国联合网络通信集团有限公司 Data transmission method and device
CN113938530A (en) * 2021-09-09 2022-01-14 中国联合网络通信集团有限公司 Data transmission method and device
CN114338835A (en) * 2021-12-31 2022-04-12 中企云链(北京)金融信息服务有限公司 Data message dynamic conversion method and device, storage medium and electronic device
CN114500690A (en) * 2022-02-15 2022-05-13 平安科技(深圳)有限公司 Interface data processing method and device, electronic equipment and storage medium
CN114500690B (en) * 2022-02-15 2023-08-18 平安科技(深圳)有限公司 Interface data processing method and device, electronic equipment and storage medium
CN115866087A (en) * 2022-11-29 2023-03-28 广发银行股份有限公司 Message mapping and HTTP request message conversion method and device
CN115866087B (en) * 2022-11-29 2023-11-17 广发银行股份有限公司 Message mapping and message conversion method, device and transmission system

Also Published As

Publication number Publication date
CA3128537A1 (en) 2022-02-20
CN112115190B (en) 2022-11-18

Similar Documents

Publication Publication Date Title
CN112115190B (en) Method, device and system for converting interface message
CN101266666B (en) Document for commerce in trading partner network and interface definition based on same document
US6226675B1 (en) Participant server which process documents for commerce in trading partner networks
CN108334387B (en) Dynamic interface rendering method and device
US8959196B2 (en) Registry for trading partners using documents for commerce in trading partner networks
US8850454B2 (en) Method and computer program product for integrating a first application providing a B2B gateway and one or more second applications
JP4500842B2 (en) Document-based transaction processing system and method
US8612307B2 (en) System and method to price and exchange data producers and data consumers through formatting data objects with necessary and sufficient item definition information
US9092244B2 (en) System for developing custom data transformations for system integration application programs
US20020091533A1 (en) Technique for automated e-business services
US20060200749A1 (en) System and method for conversion of generic services' applications into component based applications for devices
US20040221001A1 (en) Web service architecture and methods
JP2008084328A5 (en)
WO2010139226A1 (en) Service component and application software development method and system based on the service component
CN111247550A (en) Computerized transaction management module for blockchain networks
US9710282B2 (en) System to automate development of system integration application programs and method therefor
CN111176761A (en) Micro-service calling method and device
US20040006610A1 (en) Architecture and method for configuration validation web service
CN111104556A (en) Service processing method and device
KR102475305B1 (en) Method, Apparatus and System for Automatic Interlocking Between Heterogeneous Platform
CN107505852B (en) Method for constructing cloud manufacturing service description file containing simulation information
CN115242422A (en) Data intercommunication processing method and device and information management system
US20040006571A1 (en) Architecture and method for product catalog web service
CN113448960A (en) Method and device for importing form file
KR20210045284A (en) Method, Apparatus and System for Interlocking Between Heterogeneous Shopping Mall

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