CN109144919B - Interface switching method and device - Google Patents

Interface switching method and device Download PDF

Info

Publication number
CN109144919B
CN109144919B CN201811042181.9A CN201811042181A CN109144919B CN 109144919 B CN109144919 B CN 109144919B CN 201811042181 A CN201811042181 A CN 201811042181A CN 109144919 B CN109144919 B CN 109144919B
Authority
CN
China
Prior art keywords
interface
target
external system
universal
client
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811042181.9A
Other languages
Chinese (zh)
Other versions
CN109144919A (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.)
Sichuan Zhongdian Aostar Information Technologies Co ltd
State Grid Information and Telecommunication Co Ltd
Original Assignee
Sichuan Zhongdian Aostar Information Technologies Co ltd
State Grid Information and Telecommunication 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 Sichuan Zhongdian Aostar Information Technologies Co ltd, State Grid Information and Telecommunication Co Ltd filed Critical Sichuan Zhongdian Aostar Information Technologies Co ltd
Priority to CN201811042181.9A priority Critical patent/CN109144919B/en
Publication of CN109144919A publication Critical patent/CN109144919A/en
Application granted granted Critical
Publication of CN109144919B publication Critical patent/CN109144919B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/382Information transfer, e.g. on bus using universal interface adapter
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/70Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer
    • G06F21/71Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure computing or processing of information
    • G06F21/73Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure computing or processing of information by creating or determining hardware identification, e.g. serial numbers

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention provides an interface switching method and device, which can determine a target universal interface of a target external system by utilizing a target system identifier and a target interface number obtained by analyzing an interface switching request through allocating a unique interface number to the universal interface of the external system and adding interface description content, thereby transmitting an interface parameter value obtained by analysis into a parameter item of the target universal interface to complete interface switching. Based on the method, enterprise-level support can be provided for the external system, and safe and reliable universal access is provided on the basis of high concurrency and large capacity of the system.

Description

Interface switching method and device
Technical Field
The present invention relates to the field of information management technologies, and in particular, to an interface switching method and apparatus.
Background
The computer world's interface has two meanings: one is the interface of the external system itself, such as the software development API, and the other is the interactive interface between the user and the external system.
When a user accesses an external system through an interface, the external system has to request the external system in a targeted manner even if the interface belongs to a general interface due to difference of parameter transmission requested by the external system. Therefore, how to provide general access to an external system is a problem that needs to be solved by those skilled in the art.
Disclosure of Invention
In view of the above, to solve the above problems, the present invention provides an interface switching method and device, and the technical scheme is as follows:
an interface switching method comprises the following steps:
allocating a unique interface number for a universal interface of an external system, and adding interface description content for the universal interface; wherein the interface description content at least comprises parameter items of the universal interface and system identification of the external system;
under the condition of receiving an interface switching request sent by a client, analyzing the interface switching request to obtain a target system identifier, a target interface number and an interface parameter value;
determining a target external system corresponding to the target system identification and a target universal interface of the target external system corresponding to the target interface number;
and transmitting the interface parameter values to the parameter items of the target universal interface so as to enable the client to interface with the target universal interface.
Preferably, the passing the interface parameter values into the parameter items of the target universal interface includes:
transmitting the interface parameter values to the parameter items of the target universal interface according to a preset safety control logic; the preset security control logic comprises any one or more of security assessment, access control, intrusion detection, password authentication, security audit, malicious code prevention and encryption.
Preferably, the communication method with the client includes:
any one of a synchronous request/response mode, an asynchronous request/response mode, a session mode, a broadcast notification mode, an event subscription mode, a reliable message transmission mode, and a file transmission mode.
Preferably, the interface description further includes:
the parameter type and the interface type of the general interface.
Preferably, the method further comprises:
uploading the access request to the target external system through the target general interface under the condition of receiving the access request sent by the client;
and under the condition of receiving result data issued by the target external system through the target universal interface, sending the result data to the client.
Preferably, before sending the result data to the client, the method further includes:
and carrying out format conversion on the result data.
An interface adapter device comprising:
the system comprises a registration module, a data processing module and a data processing module, wherein the registration module is used for allocating a unique interface number for a general interface of an external system and adding interface description content for the general interface; wherein the interface description content at least comprises parameter items of the universal interface and system identification of the external system;
the analysis module is used for analyzing the interface switching request to obtain a target system identifier, a target interface number and an interface parameter value under the condition of receiving the interface switching request sent by the client;
a determining module, configured to determine a target external system corresponding to the target system identifier and a target universal interface of the target external system corresponding to the target interface number;
and the transmitting module is used for transmitting the interface parameter values to the parameter items of the target universal interface so as to enable the client to be in butt joint with the target universal interface.
Preferably, the incoming module is specifically configured to:
transmitting the interface parameter values to the parameter items of the target universal interface according to a preset safety control logic; the preset security control logic comprises any one or more of security assessment, access control, intrusion detection, password authentication, security audit, malicious code prevention and encryption.
Preferably, the apparatus further comprises:
the uploading module is used for uploading the access request to the target external system through the target general interface under the condition of receiving the access request sent by the client;
and the sending module is used for sending the result data to the client under the condition of receiving the result data sent by the target external system through the target universal interface.
Preferably, the sending module is further configured to:
and carrying out format conversion on the result data.
Compared with the prior art, the invention has the following beneficial effects:
in the interface switching method and device provided by the invention, the unique interface number is allocated to the universal interface of the external system and the interface description content is added, so that the target universal interface of the target external system can be determined by using the target system identifier and the target interface number obtained by analyzing the interface switching request, and the interface parameter value obtained by analyzing is transmitted to the parameter item of the target universal interface to complete interface switching. Based on the method, enterprise-level support can be provided for the external system, and safe and reliable universal access is provided on the basis of high concurrency and large capacity of the system.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a method of interface switching according to an embodiment of the present invention;
fig. 2 is a flowchart of another method of interface switching method according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an interface adapter according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of the invention provides an interface switching method, the flow chart of which is shown in figure 1, and the method comprises the following steps:
s10, allocating a unique interface number for the universal interface of the external system, and adding interface description content for the universal interface; wherein the interface description content at least comprises parameter items of the general interface and system identification of the external system.
In the process of executing step S10, the unified management is performed by gathering common interfaces of the external systems, such as an interface for acquiring user information. The unique interface number allocated to the general interface can be randomly generated and can also be set according to a certain rule.
Taking the interface for acquiring the user information as an example, the description content of the added interface includes a parameter item empNo and a system identifier of an external system including the interface, which may specifically be a system name, a system number, or a system abbreviation of the external system, and the like.
In addition, the interface description content may further include a parameter type and an interface type of the general interface, for example, the parameter type of the interface for acquiring the user information is string, and the interface type is POST. Of course, the interface types can also be extensible markup language XML, simple object Access protocol SOAP, session bean, entity bean, and message driven bean.
And S20, under the condition of receiving the interface transfer request sent by the client, analyzing the interface transfer request to obtain a target system identifier, a target interface number and an interface parameter value.
In order to improve the communication efficiency with the client, in this embodiment, the communication method with the client includes: any one of a synchronous request/response mode, an asynchronous request/response mode, a session mode, a broadcast notification mode, an event subscription mode, a reliable message transmission mode, and a file transmission mode.
The following briefly introduces the above communication modes:
synchronization request/response mode: the client sends a service request to the server, and the client blocks to wait for the server to return a processing result.
Asynchronous request/reply approach: the client sends a service request to the server, and the difference between the mode and the synchronous mode is that in the mode, the client continues to operate when the server processes the request; and returning a processing result when the server-side processing is finished.
Conversation mode: after the client and the server are connected, the client can send or receive data for many times and simultaneously store the context relationship of the information.
A broadcast notification mode: the server sends broadcast or notification messages to the client in a single or batch mode, and the client can check whether the messages are received and define the action taken after the messages are received when appropriate.
An event subscription mode: the client side can subscribe self-defined events to the server side in advance, when the events occur, the server side informs the client side of the occurrence of the events, and the client side can adopt corresponding processing. The event subscription mode enables the client to have a personalized event triggering function, and great convenience is brought to the client to respond to the subscribed events in time.
Reliable message transmission mode: in the interface communication, the transmission processing mode based on the message can adopt a reliable message transmission mode, namely, a storage queue mode, a client side and a server side are used for transmitting the message, and corresponding processing is adopted.
A file transmission mode: the client and the server transmit the message in a file mode and adopt corresponding processing.
And S30, determining the target external system corresponding to the target system identification and the target general interface of the target external system corresponding to the target interface number.
And S40, transferring the interface parameter values into the parameter items of the target universal interface so as to enable the client to interface with the target universal interface.
In order to ensure the safety of data transmission and data processing of the interface, a special safety technology implementation strategy can be formulated by combining the connection characteristics of the interface and the service characteristics. Specifically, interface parameter values can be transmitted to parameter items of the target universal interface according to a preset safety control logic; wherein,
the preset security control logic comprises any one or more of security assessment, access control, intrusion detection, password authentication, security audit, malicious code prevention and encryption.
In some other embodiments, to establish the client access mechanism, on the basis of the interface forwarding method shown in fig. 1, the following steps are further included, and a flowchart of the method is shown in fig. 2:
and S50, uploading the access request to the target external system through the target general interface under the condition of receiving the access request sent by the client.
In order to improve the throughput capacity of the interface and ensure the whole processing capacity. The target universal interface can process the access request sent by the client by adopting means of load balancing, scalability and dynamic configuration management or network scheduling.
Load balancing: to ensure maximum interface service throughput, the interface should automatically perform dynamic load balancing scheduling in the system.
Scalability and dynamic configuration management: the system realizes queue management, access resource management, recovery processing of interface application and the like in an automatic telescopic management mode or a dynamic configuration management mode.
Network scheduling: a plurality of network channels are arranged between the interfaces of the two parties, so that the multi-data channel and the fault tolerance of the interfaces are realized, the automatic switching is ensured when one network channel fails to communicate, and the automatic recovery of the interface connection is realized.
And S60, sending the result data to the client under the condition of receiving the result data sent by the target external system through the target universal interface.
In the process of executing step S60, the result data includes three parts, namely, status, type, and result value. The states are divided into success and failure, the types are divided into GET and POST by request mode, and if the states are failure, the result value is null.
In order to improve the legality of the result data, the format of the result data can be converted before the result data is sent to the client. Specifically, the result value in the result data is converted into a specified format. The type of the result value may be in text format, may also be in Json format, and so on.
According to the interface switching method provided by the embodiment of the invention, the unique interface number is allocated to the universal interface of the external system and the interface description content is added, so that the target universal interface of the target external system can be determined by using the target system identification and the target interface number obtained by analyzing the interface switching request, and the interface parameter value obtained by analyzing is transmitted to the parameter item of the target universal interface to complete interface switching. Based on the method, enterprise-level support can be provided for the external system, and safe and reliable universal access is provided on the basis of high concurrency and large capacity of the system.
Based on the interface switching method provided in the foregoing embodiment, an embodiment of the present invention correspondingly provides a device for executing the interface switching method, where a schematic structural diagram of the device is shown in fig. 3, and the device includes:
the registration module 10 is configured to assign a unique interface number to a universal interface of an external system, and add interface description content to the universal interface; wherein, the interface description content at least comprises parameter items of the general interface and system identification of the external system;
the analysis module 20 is configured to, in a case that an interface forwarding request sent by a client is received, analyze the interface forwarding request to obtain a target system identifier, a target interface number, and an interface parameter value;
a determining module 30, configured to determine a target external system corresponding to the target system identifier and a target general interface of the target external system corresponding to the target interface number;
and the transmitting module 40 is used for transmitting the interface parameter values to the parameter items of the target universal interface so as to enable the client to interface with the target universal interface.
Optionally, the importing module 40 is specifically configured to:
transmitting the interface parameter values to the parameter items of the target universal interface according to the preset safety control logic; the preset security control logic comprises any one or more of security assessment, access control, intrusion detection, password authentication, security audit, malicious code prevention and encryption.
Optionally, the apparatus further comprises:
the uploading module is used for uploading the access request to a target external system through a target general interface under the condition of receiving the access request sent by the client;
and the sending module is used for sending the result data to the client under the condition of receiving the result data sent by the target external system through the target universal interface.
Optionally, the sending module is further configured to:
and carrying out format conversion on the result data.
The interface switching device provided by the embodiment of the invention can provide enterprise-level support for an external system and provide safe and reliable universal access on the basis of high concurrency and large capacity of the system.
The interface switching method and device provided by the present invention are described in detail above, and a specific example is applied in the text to explain the principle and the implementation of the present invention, and the description of the above embodiment is only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
It is further noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include or include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (8)

1. An interface switching method, comprising:
collecting a universal interface of each external system;
allocating a unique interface number for a universal interface of an external system, and adding interface description content for the universal interface; wherein the interface description content at least comprises parameter items of the universal interface and system identification of the external system;
under the condition of receiving an interface switching request sent by a client, analyzing the interface switching request to obtain a target system identifier, a target interface number and an interface parameter value;
determining a target external system corresponding to the target system identification and a target universal interface of the target external system corresponding to the target interface number;
transmitting the interface parameter values to the parameter items of the target universal interface so as to enable the client to be in interface with the target universal interface; the passing of the interface parameter values to the parameter items of the target generic interface comprises: transmitting the interface parameter values to the parameter items of the target universal interface according to a preset safety control logic; the preset security control logic comprises any one or more of security assessment, access control, intrusion detection, password authentication, security audit, malicious code prevention and encryption.
2. The method of claim 1, wherein the means of communicating with the client comprises:
any one of a synchronous request/response mode, an asynchronous request/response mode, a session mode, a broadcast notification mode, an event subscription mode, a reliable message transmission mode, and a file transmission mode.
3. The method of claim 1, wherein the interface description further comprises:
the parameter type and the interface type of the general interface.
4. The method of claim 1, further comprising:
uploading the access request to the target external system through the target general interface under the condition of receiving the access request sent by the client;
and under the condition of receiving result data issued by the target external system through the target universal interface, sending the result data to the client.
5. The method of claim 4, wherein prior to sending the result data to the client, the method further comprises:
and carrying out format conversion on the result data.
6. An interface adapter device, comprising:
the device is used for collecting the universal interfaces of all external systems;
the system comprises a registration module, a data processing module and a data processing module, wherein the registration module is used for allocating a unique interface number for a general interface of an external system and adding interface description content for the general interface; wherein the interface description content at least comprises parameter items of the universal interface and system identification of the external system;
the analysis module is used for analyzing the interface switching request to obtain a target system identifier, a target interface number and an interface parameter value under the condition of receiving the interface switching request sent by the client;
a determining module, configured to determine a target external system corresponding to the target system identifier and a target universal interface of the target external system corresponding to the target interface number;
an input module, configured to input the interface parameter value into a parameter item of the target universal interface, so that the client interfaces with the target universal interface;
the incoming module is specifically configured to: transmitting the interface parameter values to the parameter items of the target universal interface according to a preset safety control logic; the preset security control logic comprises any one or more of security assessment, access control, intrusion detection, password authentication, security audit, malicious code prevention and encryption.
7. The apparatus of claim 6, further comprising:
the uploading module is used for uploading the access request to the target external system through the target general interface under the condition of receiving the access request sent by the client;
and the sending module is used for sending the result data to the client under the condition of receiving the result data sent by the target external system through the target universal interface.
8. The apparatus of claim 7, wherein the sending module is further configured to:
and carrying out format conversion on the result data.
CN201811042181.9A 2018-09-07 2018-09-07 Interface switching method and device Active CN109144919B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811042181.9A CN109144919B (en) 2018-09-07 2018-09-07 Interface switching method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811042181.9A CN109144919B (en) 2018-09-07 2018-09-07 Interface switching method and device

Publications (2)

Publication Number Publication Date
CN109144919A CN109144919A (en) 2019-01-04
CN109144919B true CN109144919B (en) 2022-03-29

Family

ID=64827601

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811042181.9A Active CN109144919B (en) 2018-09-07 2018-09-07 Interface switching method and device

Country Status (1)

Country Link
CN (1) CN109144919B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110336826B (en) * 2019-07-12 2021-06-08 北京字节跳动网络技术有限公司 Method, device, equipment and storage medium for acquiring interface parameter types
CN114608695B (en) * 2021-12-03 2024-01-19 北京复兴华创技术有限公司 Electronic scale reading system, method, medium and equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102090075A (en) * 2008-07-24 2011-06-08 三星电子株式会社 Method and apparatus for performing IPTV communication service
CN103957204A (en) * 2014-04-23 2014-07-30 福州柏科网安信息技术有限公司 Method for universal adaptation for communication with safety device interfaces
CN104252339A (en) * 2013-06-25 2014-12-31 腾讯科技(深圳)有限公司 Method and device for developing interface layers and realizing data interaction of interface layers
CN104852939A (en) * 2014-02-18 2015-08-19 中国电信股份有限公司 Capability interface deploying method and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102090075A (en) * 2008-07-24 2011-06-08 三星电子株式会社 Method and apparatus for performing IPTV communication service
CN104252339A (en) * 2013-06-25 2014-12-31 腾讯科技(深圳)有限公司 Method and device for developing interface layers and realizing data interaction of interface layers
CN104852939A (en) * 2014-02-18 2015-08-19 中国电信股份有限公司 Capability interface deploying method and system
CN103957204A (en) * 2014-04-23 2014-07-30 福州柏科网安信息技术有限公司 Method for universal adaptation for communication with safety device interfaces

Also Published As

Publication number Publication date
CN109144919A (en) 2019-01-04

Similar Documents

Publication Publication Date Title
US11411897B2 (en) Communication method and communication apparatus for message queue telemetry transport
RU2291581C2 (en) Method for equal connection of devices in dynamically operating home networks
US10334406B2 (en) Methods and apparatus for analyzing and grouping service layer subscriptions and notifications for enhanced efficiency
US8898218B2 (en) Generic distributed processing for multi-agent systems
KR20200012981A (en) Network slice management methods, devices, and computer readable storage media
US11096051B2 (en) Connection establishment method, device, and system
CN103220292A (en) Cross-safe-area data transmission method and system
US11553021B2 (en) Media downlink transmission control method and related device
CN108156240B (en) Method and system for accessing industrial adapter to server
WO2014110820A1 (en) Notification push method, device, and system
CN105991412A (en) Method and device for pushing message
US11095747B2 (en) Method and apparatus for receiving response information in M2M system
CN104980448B (en) Remote monitoring method, device and system
CN109889454A (en) A kind of the message driving means and method of micro services framework
CN103476027A (en) File transmission method for mobile terminal
CN109144919B (en) Interface switching method and device
CN114338650A (en) File transmission method and device, electronic equipment and readable storage medium
CN106970843B (en) Remote calling method and device
EP2439881B1 (en) Cluster system and request message distribution method for processing multi-node transaction
CN107943541B (en) Communication method of Windows local component
CN115412329B (en) Information processing method and related device for Internet of things
WO2019201111A1 (en) Information processing method, apparatus and device, and computer-readable storage medium
CN107800715B (en) portal authentication method and access equipment
CN111385324A (en) Data communication method, device, equipment and storage medium
CN105491065A (en) Resource access method of message-oriented middleware, server, and resource access system

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