CN112948306A - Method and device for expanding system interface - Google Patents

Method and device for expanding system interface Download PDF

Info

Publication number
CN112948306A
CN112948306A CN202110339206.7A CN202110339206A CN112948306A CN 112948306 A CN112948306 A CN 112948306A CN 202110339206 A CN202110339206 A CN 202110339206A CN 112948306 A CN112948306 A CN 112948306A
Authority
CN
China
Prior art keywords
interface input
input message
message
interface
field
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.)
Pending
Application number
CN202110339206.7A
Other languages
Chinese (zh)
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.)
China Construction Bank Corp
Original Assignee
China Construction Bank Corp
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 China Construction Bank Corp filed Critical China Construction Bank Corp
Priority to CN202110339206.7A priority Critical patent/CN112948306A/en
Publication of CN112948306A publication Critical patent/CN112948306A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • G06F13/4004Coupling between buses
    • G06F13/4009Coupling between buses with data restructuring
    • G06F13/4018Coupling between buses with data restructuring with data-width conversion
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/382Information transfer, e.g. on bus using universal interface adapter
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0656Data buffering arrangements

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Human Computer Interaction (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses a method and a device for expanding a system interface, and relates to the technical field of mobile interconnection. The method for expanding the system interface comprises the following steps: after receiving a first interface input message, converting the first interface input message into a second interface input message, sending the second interface input message to a target system, and storing specified field information in the first interface input message to a buffer; and responding to a second interface output message which is sent by the target system and corresponds to the second interface input message, reading the appointed field information from the buffer, and assembling the appointed field information and the second interface output message to obtain a first interface output message. Through the steps, the expansion requirement of the system interface can be met under the condition that an old system is not required to be modified, and the method has the advantages of low implementation difficulty, short project period, low implementation cost and the like.

Description

Method and device for expanding system interface
Technical Field
The invention relates to the technical field of mobile interconnection, in particular to a method and a device for expanding a system interface.
Background
The application system typically interacts with the peripheral systems online in the form of an interface that specifies the message content of each transaction.
When the service requirement changes, the system interface needs to be expanded, and new fields are added, a new version is often released to meet the new requirement.
For an old system without source codes or an outsourcing system which is off-shelf in an original factory, the project period of redeveloping the old system or upgrading and transforming the outsourcing system is too long, and the project cost is too high, so that a solution with short period and low cost is needed to meet new requirements.
Disclosure of Invention
In view of this, the present invention provides a method and an apparatus for expanding a system interface, which can meet the requirement of expanding the system interface without modifying an old system, and have the advantages of low implementation difficulty, short project period, low implementation cost, and the like.
To achieve the above object, according to a first aspect of the present invention, there is provided a method of extending a system interface.
The method for expanding the system interface comprises the following steps: after receiving a first interface input message, converting the first interface input message into a second interface input message, sending the second interface input message to a target system, and storing specified field information in the first interface input message to a buffer; the designated field information is information of fields added by the first interface input message compared with the second interface input message; and responding to a second interface output message which is sent by the target system and corresponds to the second interface input message, reading the appointed field information from the buffer, and assembling the appointed field information and the second interface output message to obtain a first interface output message.
Optionally, the converting the first interface input packet into a second interface input packet includes: inquiring message conversion configuration information according to the identification of the first interface input message to determine a designated field in the first interface input message; and assembling to obtain a second interface input message according to the information of the fields except the specified field in the first interface input message.
Optionally, the packet conversion configuration information includes: the identification of the first interface input message, the identification of the second interface input message stored correspondingly to the first interface input message, and the designated field.
Optionally, the packet conversion configuration information includes: the identifier of the first interface input message, the identifier of the second interface input message stored correspondingly to the first interface input message, and the field contained in the second interface input message.
Optionally, before the assembling according to the information of the fields except the specified field in the first interface input message to obtain the second interface input message, the method further includes: and calling a resolver corresponding to the message type of the first interface input message, so as to resolve all field information contained in the first interface input message through the corresponding resolver.
Optionally, the resolver comprises at least one of: JSON message parser, XML message parser, FIX message parser.
Optionally, the storing the specified field information in the first interface input message to a buffer includes: generating a unique key value according to the identifier of the first interface input message and/or the identifier of the second interface input message; and correspondingly storing the unique key value and the appointed field information in the first interface input message in a buffer memory.
Optionally, the reading the specified field information from the buffer includes: generating a unique key value according to the identifier of the first interface input message and/or the identifier of the second interface input message; and querying the buffer according to the unique key value to obtain the specified field information in the first interface input message.
Optionally, the cache is constructed based on Map containers.
Optionally, before saving the specified field information in the first interface input message to the buffer, the method further includes: and judging whether the specified field is a field which does not need to be processed or not, and judging that the field is a field which does not need to be processed if the specified field is the field.
Optionally, the method further comprises: if the designated field is a field needing to be processed, processing the designated field information, and storing a processing result of the designated field information into a buffer; and responding to a second interface output message which is sent by the target system and corresponds to the second interface input message, reading the processing result of the appointed field information from the buffer, and assembling the second interface output message and the appointed field information to obtain a first interface output message.
Optionally, the determining whether the specified field is a field that does not need to be processed includes: acquiring a processing rule of the specified field in the message conversion configuration information; if the processing rule of the specified field is null, determining that the specified field is a field which does not need to be processed; otherwise, determining the designated field as the field needing to be processed.
To achieve the above object, according to a second aspect of the present invention, there is provided an apparatus for expanding a system interface.
The device for expanding the system interface comprises: the input adapter is used for converting a first interface input message into a second interface input message after receiving the first interface input message, sending the second interface input message to a target system, and storing specified field information in the first interface input message to a buffer; the designated field information is information of a field newly added to the first interface input message compared with the second interface input message; and the output adapter is used for responding to a second interface output message which is sent by the target system and corresponds to the second interface input message, reading the appointed field information from the buffer, and assembling the appointed field information and the second interface output message to obtain a first interface output message.
To achieve the above object, according to a third aspect of the present invention, there is provided an electronic apparatus.
The electronic device of the present invention includes: one or more processors; and storage means for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the method of extending a system interface of the present invention.
To achieve the above object, according to a fourth aspect of the present invention, there is provided a computer-readable medium.
The computer-readable medium of the invention has stored thereon a computer program which, when executed by a processor, implements the method of extending a system interface of the invention.
One embodiment of the above invention has the following advantages or benefits: converting a first interface input message into a second interface input message after receiving the first interface input message, sending the second interface input message to a target system, and storing specified field information in the first interface input message to a buffer; the method comprises the steps of reading the appointed field information from the buffer after receiving a second interface output message, and assembling the appointed field information and the second interface output message to obtain a first interface output message, can meet the expansion requirement of a system interface under the condition of not modifying an old system, and has the advantages of low implementation difficulty, short project period, low implementation cost and the like.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
FIG. 2 is a schematic diagram of application system interaction in an embodiment of the invention;
FIG. 3 is a schematic main flow diagram of a method of expanding a system interface according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of the main modules of an apparatus for expanding a system interface according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of an application system of an apparatus employing an extended system interface according to an embodiment of the present invention;
FIG. 6 is a schematic block diagram of a computer system suitable for use with the electronic device to implement an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
It should be noted that the embodiments and technical features of the embodiments of the present invention may be combined with each other without affecting the implementation of the present invention.
Fig. 1 illustrates an exemplary system architecture 100 to which the method of extending a system interface or the apparatus of extending a system interface of an embodiment of the present invention may be applied.
As shown in fig. 1, the system architecture 100 may include a first server 101, a network 102, a second server 103, a network 104, and a third server 105. Network 102 is used to provide the medium for a communication link between first server 101 and second server 103, and network 104 is used to provide the medium for a communication link between second server 103 and third server 105. Networks 102, 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The first server 101 may interact with the second server 103 via the network 102 to receive or send messages or the like. The second server 103 may interact with a third server 105 via a network 104 to receive or send messages or the like. The first server 101, the second server 103, and the third server 105 may be servers that provide various services, such as a background management server that supports a financial website browsed by a user using a terminal device.
It should be noted that the method for extending the system interface provided by the embodiment of the present invention is generally executed by the second server 103, and accordingly, the apparatus for extending the system interface is generally disposed in the second server 103.
It should be understood that the number of first servers, networks, second servers, and third servers in fig. 1 is merely illustrative. There may be any number of networks and servers, as desired for implementation.
Fig. 2 is a schematic diagram of application system interaction in the embodiment of the present invention. As shown in fig. 2, application system X interacts with application system Y through the old system. The application system X, the old system, and the application system Y may be systems providing arbitrary services. For example, application system X old system, application system Y is a system that provides banking services, and application system X may send transaction fields to application system Y through the old system.
When an external supervision or business expansion requires an old system to transmit a new field, because both input and output interfaces of the old system cannot be modified, the conventional solution is to borrow a reserved field or a comment field in the existing interface of the old system to support the requirement of the new field. However, if there are no reserved or annotated fields in the existing interface of the old system, or the number of reserved or annotated fields is less than the number of new fields, the solution does not hold. In view of this, the present invention proposes a new solution for extending system interfaces that does not rely on old system interfaces.
Fig. 3 is a main flow diagram of a method for extending a system interface according to an embodiment of the present invention. As shown in fig. 3, the method for extending a system interface according to the embodiment of the present invention includes:
step S301: after receiving a first interface input message, converting the first interface input message into a second interface input message, sending the second interface input message to a target system, and storing specified field information in the first interface input message to a buffer.
The designated field information refers to information of fields added by the first interface input message compared with the second interface input message. For example, if the first interface input message includes field 1, field 2, field 3, and field 4, and the second interface input message includes field 1, field 2, and field 3, the field information is designated as field 4 and the value of the field.
Exemplarily, in step S301, converting the first interface input packet into a second interface input packet includes: firstly, inquiring message conversion configuration information according to the identification of the first interface input message to determine a designated field in the first interface input message; and then, assembling according to the information of the fields except the specified field in the first interface input message to obtain a second interface input message.
Further, the message conversion configuration information may include an identifier of the first interface input message, an identifier of the second interface input message stored in correspondence with the first interface input message, and a configuration item such as a designated field. Furthermore, after receiving the first interface input message, inquiring message conversion configuration information according to the identifier of the message to determine what the designated field is, and then assembling the fields, except the designated field, analyzed from the first interface input message and the corresponding field values to obtain a second interface input message.
Or, the message conversion configuration information may include an identifier of the first interface input message, and a corresponding stored identifier of the second interface input message, a field included in the second interface input message, and other configuration items. Furthermore, after receiving the first interface input message, inquiring message conversion configuration information according to the identifier of the message to determine the field contained in the second interface input message, and determining what the designated field is by comparing the field analyzed from the first interface input message with the field contained in the second interface input message; in addition, the fields except the appointed field analyzed from the first interface input message and the corresponding field values are assembled to obtain a second interface input message.
Exemplarily, in step S301, the saving the specified field information in the first interface input message to the buffer includes: generating a unique key value according to the identifier of the first interface input message and/or the identifier of the second interface input message; and correspondingly storing the unique key value and the appointed field information in the first interface input message in a buffer memory. Wherein the cache may be constructed based on a Map container (Map is a collection of key-value pairs, Map type is generally understood to be an associative array). In addition, the buffer can also be constructed by Redis (a log type and Key-Value database which can be based on the memory and can also be persistent) and the like.
Further, before assembling the second interface input message according to the information of the fields except the specified field in the first interface input message, the method of the embodiment of the present invention may further include the following steps: and calling a resolver corresponding to the message type of the first interface input message, so as to resolve all field information contained in the first interface input message through the corresponding resolver. Illustratively, the parser comprises at least one of: JSON (which is a lightweight data exchange format) message parser, XML (extensible markup language) message parser, and FIX (financial information exchange protocol) message parser. By setting multiple resolvers, the message resolution requirements of multiple formats can be met, and therefore the flexibility and the applicability of the method for expanding the system interface are improved.
Step S302: and responding to a second interface output message which is sent by the target system and corresponds to the second interface input message, reading the appointed field information from the buffer, and assembling the appointed field information and the second interface output message to obtain a first interface output message.
And after receiving the second interface input message, the target system generates a second interface output message. In step S302, in response to the second interface output packet sent by the target system, the specified field information in the first interface input packet stored in step S301 is read from the buffer. The designated field information refers to information of fields added by the first interface input message compared with the second interface input message.
Illustratively, the reading the specified field information from the cache comprises: generating a unique key value according to the identifier of the first interface input message and/or the identifier of the second interface input message; and querying the buffer according to the unique key value to obtain the specified field information in the first interface input message. For example, when the buffer is written in, a unique key value is generated according to the identifier of the first interface input message, and when the buffer is read, a unique key value is generated according to the identifier of the first interface input message; generating a unique key value according to the identifier of the second interface input message when the buffer is written in, and generating a unique key value according to the identifier of the second interface input message when the buffer is read; and generating a unique key value according to the identifier of the first interface input message and the identifier of the second interface input message when the buffer is written in, and generating a unique key value according to the identifier of the first interface input message and the identifier of the second interface input message when the buffer is read.
After the designated field information in the first interface input message is acquired from the buffer, the designated field information can be assembled to the second interface output message to obtain a new message, namely the first interface output message.
In an alternative example, the method of the present invention further comprises: before the appointed field information in the first interface input message is stored in a buffer, judging whether the appointed field is a field which does not need to be processed, and judging that the appointed field is a field which does not need to be processed.
Further, in this optional example, if the specified field is a field that needs to be processed, the specified field information is processed, and a processing result of the specified field information is stored in a buffer; and responding to a second interface output message which is sent by the target system and corresponds to the second interface input message, reading the processing result of the appointed field information from the buffer, and assembling the second interface output message and the appointed field information to obtain a first interface output message. The processing on the information of the specified field includes, but is not limited to, performing form conversion such as case conversion on the value of the specified field, performing desensitization processing on the value of the specified field, and the like.
The determining whether the designated field is a field that does not need to be processed may specifically include: acquiring a processing rule of the specified field in the message conversion configuration information; if the processing rule of the specified field is null, determining that the specified field is a field which does not need to be processed; otherwise, determining the designated field as the field needing to be processed. In specific implementation, the processing rules can be set according to actual requirements.
In the embodiment of the invention, the flexibility of the interface expansion method can be improved and the applicability of the expanded target system can be improved by judging whether the specified field is a field which does not need to be processed and directly caching the specified field information or caching the specified field information after processing according to different judgment results.
In the embodiment of the invention, the expansion requirement of the system interface can be met without modifying an old system through the steps, and the method has the advantages of low implementation difficulty, short project period, low implementation cost and the like.
Fig. 4 is a schematic diagram of main blocks of an apparatus for expanding a system interface according to an embodiment of the present invention. As shown in fig. 4, the apparatus 400 for extending a system interface in an embodiment of the present invention includes: an input adapter 401, an output adapter 402.
The input adapter 401 is configured to, after receiving a first interface input packet, convert the first interface input packet into a second interface input packet, send the second interface input packet to a target system, and store specified field information in the first interface input packet to a cache.
The designated field information is information of a field newly added to the first interface input message compared with the second interface input message. For example, if the first interface input message includes field 1, field 2, field 3, and field 4, and the second interface input message includes field 1, field 2, and field 3, the field information is designated as field 4 and the value of the field.
For example, the converting the first interface input message into the second interface input message by the input adapter 401 includes: firstly, the input adapter 401 queries message conversion configuration information according to the identifier of the first interface input message to determine a designated field in the first interface input message; then, the input adapter 401 assembles the second interface input message according to the information of the fields except the specified field in the first interface input message.
Further, the message conversion configuration information may include an identifier of the first interface input message, an identifier of the second interface input message stored in correspondence with the first interface input message, and a configuration item such as a designated field. Furthermore, after receiving the first interface input message, the input adapter 401 queries the message conversion configuration information according to the identifier of the message to determine what the designated field is, and then the input adapter 401 assembles the field, which is parsed from the first interface input message and is other than the designated field, and the corresponding field value to obtain the second interface input message.
Or, the message conversion configuration information may include an identifier of the first interface input message, and a corresponding stored identifier of the second interface input message, a field included in the second interface input message, and other configuration items. Furthermore, after receiving the first interface input message, the input adapter 401 may determine the field included in the second interface input message by querying the message conversion configuration information according to the identifier of the message, and may determine what the designated field is by comparing the field analyzed from the first interface input message with the field included in the second interface input message; in addition, the input adapter 401 assembles the fields, which are analyzed from the first interface input message and are except for the designated field, and the corresponding field values to obtain a second interface input message.
For example, the input adapter 401 storing the specified field information in the first interface input message to the buffer includes: the input adapter 401 generates a unique key value according to the identifier of the first interface input message and/or the identifier of the second interface input message; the input adapter 401 correspondingly stores the unique key value and the designated field information in the first interface input message in a buffer. Wherein the cache may be constructed based on a Map container (Map is a collection of key-value pairs, Map type is generally understood to be an associative array). In addition, the buffer can also be constructed by Redis (a log type and Key-Value database which can be based on the memory and can also be persistent) and the like.
Further, before the second interface input message is obtained by assembling according to the information of the fields except the specified field in the first interface input message, the input adapter 401 may be further configured to call a parser corresponding to the message type of the first interface input message, so as to parse all the field information included in the first interface input message through the corresponding parser. Illustratively, the parser comprises at least one of: JSON (which is a lightweight data exchange format) message parser, XML (extensible markup language) message parser, and FIX (financial information exchange protocol) message parser. By setting multiple resolvers, the message resolution requirements of multiple formats can be met, and therefore the flexibility and the applicability of the method for expanding the system interface are improved.
An output adapter 402, configured to, in response to a second interface output packet that is sent by the target system and corresponds to the second interface input packet, read the specified field information from the cache, and assemble the specified field information and the second interface output packet to obtain a first interface output packet.
In the embodiment of the invention, the input adapter, the output adapter and the buffer are arranged, the conversion of the first input interface is realized through the input adapter, the buffer of the newly added field is realized, and the assembly of the newly added field and the second output interface is realized through the output adapter, so that the expansion requirement of the system interface can be met under the condition of not modifying an old system, and the invention has the advantages of low implementation difficulty, short project period, low implementation cost and the like.
Fig. 5 is a schematic diagram of an application system of a device adopting an extended system interface according to an embodiment of the present invention. As shown in fig. 5, the apparatus for expanding a system interface includes an input adapter, an output adapter, and a buffer.
The input adapter is deployed in front of the old system, the application system X sends the new interface input message to the input adapter, the input adapter stores newly added field information (namely information of fields added by the new interface input message compared with the old interface input message) in the new interface input message to the buffer, converts the new interface input message into the old interface input message and then sends the old interface input message to the old system.
The buffer provides storage and reading services, and supports the function of reading and writing the specified information according to a unique key value, and the unique key value can be declared and specified by a calling party and can also be generated by the buffer. In specific implementation, the input adapter and the output adapter can read and write the designated information by calling the read-write function of the buffer.
The output adapter is deployed behind the old system. And after the old system sends the output message of the old interface to the output adapter, the output adapter reads the newly added field information from the buffer and assembles the newly added field information into the output message of the old interface so as to obtain the output message of the new interface. And then, the output adapter sends the output message of the new interface to the application system Y. The application system X, the old system, and the application system Y may be systems providing arbitrary services.
In the embodiment of the invention, the new input adapter, the output adapter and the buffer are added, the conversion of the new and old input interfaces is realized through the input adapter, the buffer of the new field is realized, the assembly of the new field and the old output interface is realized through the output adapter, the expansion requirement of the system interface can be met under the condition of not modifying an old system, and the invention has the advantages of low implementation difficulty, short project period, low implementation cost and the like.
Referring now to FIG. 6, shown is a block diagram of a computer system 600 suitable for use with the electronic device implementing an embodiment of the present invention. The computer system illustrated in FIG. 6 is only one example and should not impose any limitations on the scope of use or functionality of embodiments of the invention.
As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU)601 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 601.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes an input adapter, an output adapter. Where the names of these modules do not in some cases constitute a limitation on the module itself, for example, an input adapter may also be described as an "input adaptation module" and an output adapter may also be described as an "output adaptation module".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to perform the following: after receiving a first interface input message, converting the first interface input message into a second interface input message, sending the second interface input message to a target system, and storing specified field information in the first interface input message to a buffer; the designated field information is information of fields added by the first interface input message compared with the second interface input message; and responding to a second interface output message which is sent by the target system and corresponds to the second interface input message, reading the appointed field information from the buffer, and assembling the appointed field information and the second interface output message to obtain a first interface output message.
According to the technical scheme of the embodiment of the invention, the expansion requirement of the system interface can be met under the condition of not modifying an old system, and the method has the advantages of low implementation difficulty, short project period, low implementation cost and the like.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (15)

1. A method of extending a system interface, the method comprising:
after receiving a first interface input message, converting the first interface input message into a second interface input message, sending the second interface input message to a target system, and storing specified field information in the first interface input message to a buffer; the designated field information is information of fields added by the first interface input message compared with the second interface input message;
and responding to a second interface output message which is sent by the target system and corresponds to the second interface input message, reading the appointed field information from the buffer, and assembling the appointed field information and the second interface output message to obtain a first interface output message.
2. The method of claim 1, wherein converting the first interface input message to a second interface input message comprises:
inquiring message conversion configuration information according to the identification of the first interface input message to determine a designated field in the first interface input message; and assembling to obtain a second interface input message according to the information of the fields except the specified field in the first interface input message.
3. The method of claim 2, wherein the message conversion configuration information comprises: the identification of the first interface input message, the identification of the second interface input message stored correspondingly to the first interface input message, and the designated field.
4. The method of claim 2, wherein the message conversion configuration information comprises: the identifier of the first interface input message, the identifier of the second interface input message stored correspondingly to the first interface input message, and the field contained in the second interface input message.
5. The method according to claim 2, wherein before assembling the second interface input message according to the information of the fields except the specified field in the first interface input message, the method further comprises:
and calling a resolver corresponding to the message type of the first interface input message, so as to resolve all field information contained in the first interface input message through the corresponding resolver.
6. The method of claim 3, wherein the parser comprises at least one of: JSON message parser, XML message parser, FIX message parser.
7. The method of claim 1, wherein saving the specified field information in the first interface input message to a buffer comprises:
generating a unique key value according to the identifier of the first interface input message and/or the identifier of the second interface input message; and correspondingly storing the unique key value and the appointed field information in the first interface input message in a buffer memory.
8. The method of claim 1, wherein reading the specified field information from the cache comprises:
generating a unique key value according to the identifier of the first interface input message and/or the identifier of the second interface input message; and querying the buffer according to the unique key value to obtain the specified field information in the first interface input message.
9. The method of claim 1, wherein the cache is constructed based on Map containers.
10. The method of claim 1, wherein prior to saving the specified field information in the first interface input message to a buffer, the method further comprises:
and judging whether the specified field is a field which does not need to be processed or not, and judging that the field is a field which does not need to be processed if the specified field is the field.
11. The method of claim 10, further comprising:
if the designated field is a field needing to be processed, processing the designated field information, and storing a processing result of the designated field information into a buffer;
and responding to a second interface output message which is sent by the target system and corresponds to the second interface input message, reading the processing result of the appointed field information from the buffer, and assembling the second interface output message and the appointed field information to obtain a first interface output message.
12. The method of claim 10, wherein determining whether the specified field is a field that does not require processing comprises:
acquiring a processing rule of the specified field in the message conversion configuration information; if the processing rule of the specified field is null, determining that the specified field is a field which does not need to be processed; otherwise, determining the designated field as the field needing to be processed.
13. An apparatus for extending a system interface, the apparatus comprising:
the input adapter is used for converting a first interface input message into a second interface input message after receiving the first interface input message, sending the second interface input message to a target system, and storing specified field information in the first interface input message to a buffer; the designated field information is information of a field newly added to the first interface input message compared with the second interface input message;
and the output adapter is used for responding to a second interface output message which is sent by the target system and corresponds to the second interface input message, reading the appointed field information from the buffer, and assembling the appointed field information and the second interface output message to obtain a first interface output message.
14. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-12.
15. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-12.
CN202110339206.7A 2021-03-30 2021-03-30 Method and device for expanding system interface Pending CN112948306A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110339206.7A CN112948306A (en) 2021-03-30 2021-03-30 Method and device for expanding system interface

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110339206.7A CN112948306A (en) 2021-03-30 2021-03-30 Method and device for expanding system interface

Publications (1)

Publication Number Publication Date
CN112948306A true CN112948306A (en) 2021-06-11

Family

ID=76227464

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110339206.7A Pending CN112948306A (en) 2021-03-30 2021-03-30 Method and device for expanding system interface

Country Status (1)

Country Link
CN (1) CN112948306A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114040008A (en) * 2021-11-05 2022-02-11 光大科技有限公司 Message processing method and device
CN114900549A (en) * 2022-05-06 2022-08-12 建信金融科技有限责任公司 Message sending method and device, electronic equipment and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102546442A (en) * 2012-03-09 2012-07-04 北京神州数码思特奇信息技术股份有限公司 Communication protocol conversion technology
CN104346466A (en) * 2014-11-12 2015-02-11 中国建设银行股份有限公司 Method and device of adding new attribute data in database
CN105187559A (en) * 2015-09-30 2015-12-23 成都智信电子技术有限公司 Data fusion governance system
US20170060878A1 (en) * 2015-09-01 2017-03-02 Sap Se Field Extension in Database System
CN108769028A (en) * 2018-05-31 2018-11-06 阿里巴巴集团控股有限公司 Assemble the method and device of message
CN111241180A (en) * 2020-01-13 2020-06-05 中国建设银行股份有限公司 Information processing method, device, equipment and storage medium
CN111695840A (en) * 2019-03-11 2020-09-22 北京京东尚科信息技术有限公司 Method and device for realizing flow control
CN111953780A (en) * 2020-08-13 2020-11-17 中国工商银行股份有限公司 Micro-service gray level publishing method, device, equipment, system and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102546442A (en) * 2012-03-09 2012-07-04 北京神州数码思特奇信息技术股份有限公司 Communication protocol conversion technology
CN104346466A (en) * 2014-11-12 2015-02-11 中国建设银行股份有限公司 Method and device of adding new attribute data in database
US20170060878A1 (en) * 2015-09-01 2017-03-02 Sap Se Field Extension in Database System
CN105187559A (en) * 2015-09-30 2015-12-23 成都智信电子技术有限公司 Data fusion governance system
CN108769028A (en) * 2018-05-31 2018-11-06 阿里巴巴集团控股有限公司 Assemble the method and device of message
CN111695840A (en) * 2019-03-11 2020-09-22 北京京东尚科信息技术有限公司 Method and device for realizing flow control
CN111241180A (en) * 2020-01-13 2020-06-05 中国建设银行股份有限公司 Information processing method, device, equipment and storage medium
CN111953780A (en) * 2020-08-13 2020-11-17 中国工商银行股份有限公司 Micro-service gray level publishing method, device, equipment, system and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114040008A (en) * 2021-11-05 2022-02-11 光大科技有限公司 Message processing method and device
CN114900549A (en) * 2022-05-06 2022-08-12 建信金融科技有限责任公司 Message sending method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
US11550599B2 (en) Method and apparatus for running applet
CN111198751A (en) Service processing method and device
CN110908967B (en) Method, device, equipment and computer readable medium for storing log
CN109766127B (en) Method for updating application version information
CN110688828A (en) File processing method and device, file processing system and computer equipment
CN112948306A (en) Method and device for expanding system interface
CN110688096B (en) Method and device for constructing application program containing plug-in, medium and electronic equipment
CN111666293A (en) Database access method and device
US11934287B2 (en) Method, electronic device and computer program product for processing data
CN114285793A (en) Distribution method, distribution device, distribution equipment and storage medium
CN113779004A (en) Data verification method and device
CN113778725A (en) Data verification method and device
CN116737662A (en) Method, device, electronic equipment and storage medium for processing business data
CN111460020B (en) Method, device, electronic equipment and medium for resolving message
CN112671877B (en) Data processing method and device
CN114866628A (en) Message processing method, device, equipment and storage medium
CN115174375A (en) Message unpacking method, device, equipment and medium
CN112783903B (en) Method and device for generating update log
CN113742235A (en) Method and device for checking codes
CN110309121B (en) Log processing method and device, computer readable medium and electronic equipment
CN112084114A (en) Method and apparatus for testing an interface
CN112433752A (en) Page parsing method, device, medium and electronic equipment
CN113468041A (en) Interface comparison test method and device
CN109376023B (en) Method and equipment for generating calling information and issuing return code group
CN112214500A (en) Data comparison method and device, electronic equipment and storage medium

Legal Events

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