CN114546370A - Data docking method and related device - Google Patents

Data docking method and related device Download PDF

Info

Publication number
CN114546370A
CN114546370A CN202210174919.7A CN202210174919A CN114546370A CN 114546370 A CN114546370 A CN 114546370A CN 202210174919 A CN202210174919 A CN 202210174919A CN 114546370 A CN114546370 A CN 114546370A
Authority
CN
China
Prior art keywords
docking
data
channel
type
request
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
CN202210174919.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.)
Ping An Puhui Enterprise Management Co Ltd
Original Assignee
Ping An Puhui Enterprise Management 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 Ping An Puhui Enterprise Management Co Ltd filed Critical Ping An Puhui Enterprise Management Co Ltd
Priority to CN202210174919.7A priority Critical patent/CN114546370A/en
Publication of CN114546370A publication Critical patent/CN114546370A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/36Software reuse
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/76Adapting program code to run in a different environment; Porting

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The application relates to the field of computers, and provides a data docking method and a related device, wherein the method comprises the following steps: the method comprises the steps of obtaining a docking request, wherein the docking request comprises a first identifier, and the first identifier is used for identifying a first docking channel; determining that the docking type corresponding to the first docking channel is a first docking type according to a first incidence relation, and determining that the docking entrance corresponding to the first docking channel is a first docking entrance according to the first incidence relation, wherein the first incidence relation is used for representing incidence relations among the docking channel, the docking type and the docking entrance; determining that the docking method corresponding to the first docking type is the first docking method according to a second incidence relation, wherein the second incidence relation is used for representing the incidence relation between the docking type and the docking method; and carrying out data docking according to the first docking inlet, the first docking method and the first docking channel. The same docking method is used by the same docking channel for realizing the same docking type, and the code amount of program development is reduced.

Description

Data docking method and related device
Technical Field
The present application relates to the field of computers, and in particular, to a data docking method and a related apparatus.
Background
With the rapid development of mobile internet technology, more and more users transact financial services online. The traffic platform side hopes to recommend richer financial products to different customers, and needs to complete the product line of the traffic platform side by interfacing different internet financial platforms.
However, the docking interfaces, parameters and other modes of each channel are different, and most of the current flow platform parties usually modify their own platform background codes according to docking channels provided by the docked different internet financial platforms, and dock one channel and modify once when docking different internet financial platforms.
According to the docking method, each newly added docking channel needs to be newly added with the corresponding background code, and the problem of large code workload exists.
Disclosure of Invention
Therefore, it is necessary to provide a data docking method and a related apparatus for achieving that the same docking method is used in the same docking channel, so as to reduce the code amount of program development and improve the system stability.
In a first aspect, the present application provides a data interfacing method, including: the method comprises the steps of obtaining a docking request, wherein the docking request comprises a first identifier, and the first identifier is used for identifying a first docking channel; determining that the docking type corresponding to the first docking channel is a first docking type according to a first association relation, and determining that the docking inlet corresponding to the first docking channel is a first docking inlet according to the first association relation, wherein the first association relation is used for representing association relations among the docking channel, the docking type and the docking inlet; determining that the docking method corresponding to the first docking type is the first docking method according to a second incidence relation, wherein the second incidence relation is used for representing the incidence relation between the docking type and the docking method; and carrying out data docking according to the first docking inlet, the first docking method and the first docking channel.
For example, the docking request may be a data docking request with parameters or a data docking request without parameters.
The method provided by the first aspect is implemented, the docking information of the docking channels is abstracted into the docking types and the docking entries, the corresponding docking methods are set according to the docking principle of each docking type, and the docking channels of the same docking type share the same docking method. Therefore, when a new docking channel needs to be added, if the docking type of the new docking channel is a docking type that is currently supported by the data docking device configuration provided in the embodiment of the present application (it can also be understood that the second association relationship stored in the data docking device includes a docking method corresponding to the docking type of the new docking channel), only docking information (for example, the docking type and the docking entry) corresponding to the new docking channel needs to be added to the first association relationship, and a front-end page corresponding to receive information (for example, the first identifier) input by the user is developed, so that data docking can be performed through the system corresponding to the new docking channel through the new docking channel without developing codes again, the code amount of program development is reduced, the code maintenance cost is reduced, the system stability is improved, and the problem of background errors caused by later docking of a new platform is reduced, meanwhile, the method is also beneficial to the rapid expansion of products.
In a possible implementation manner, the first association relationship is represented by a class (e.g. a first docking class), the attributes of the first docking class include a docking type and a docking entry, and one of the first docking class is used for representing a docking channel; the determining that the docking type of the first docking channel is a first docking type according to the first association relationship and the docking entrance of the first docking channel is a first docking entrance according to the first association relationship includes: and taking the value of the attribute of the docking type of the first instantiation object of the first docking class corresponding to the first identifier as the first docking type, and taking the value of the attribute of the docking entry of the first instantiation object as the first call entry, wherein the first instantiation object corresponds to the docking request.
In one possible implementation, before the obtaining the docking request, the method further includes: generating one or more first docking classes corresponding to the first incidence relation according to a computer programming language java reflection mechanism and a second database, wherein the first docking class and the first docking inlet corresponding to the first docking channel are stored in the second database; determining the first identifier according to user input, and obtaining the first instantiation object according to the first identifier and a first docking class corresponding to the first identifier, wherein the first instantiation object carries the first identifier; and acquiring the docking request according to the first instantiation object.
In a possible implementation manner, the docking request further includes first data, and the docking data according to the first docking inlet, the first docking method, and the first docking channel includes: inputting the first docking port and the first data into the first docking method, and operating the first docking method to realize data docking between devices corresponding to the first docking channel.
It is understood that the device corresponding to the first docking channel may be other data docking devices, systems or servers different from the data docking device performing the data docking method of the embodiment of the present application.
Illustratively, the docking request further includes first data, which is used to indicate that data of a data docking device executing the data docking method of the embodiment of the present application and a device corresponding to the first docking channel are docked into data with parameters.
In one possible implementation, before the inputting the first docking port and the first data into the first docking method, the method further comprises: determining the parameter format corresponding to the first docking channel as a first parameter format according to the first incidence relation, wherein the first incidence relation is used for representing the incidence relation among the docking channel, the docking type, the docking entry and the parameter format; if the data format of the first data is not consistent with the first parameter format, converting the first data into data consistent with the first parameter format to obtain first data with an updated format; said inputting said first pair of access ports and said first data into said first docking method comprises: and inputting the first butt-joint inlet and the first data with the updated format into the first butt-joint method.
In one possible implementation, before the inputting the first docking port and the first data into the first docking method, the method further comprises: determining that the encryption mode corresponding to the first docking channel is a first encryption mode according to the first incidence relation, wherein the first incidence relation is used for representing the incidence relation among the docking channel, the docking type, the docking entrance and the encryption mode; encrypting the first data by adopting the first encryption mode to obtain encrypted first data; said inputting said first pair of access ports and said first data into said first docking method comprises: inputting the first docking port and the encrypted first data into the first docking method.
In a possible implementation manner, the first association relationship is further configured to record an association relationship between a docking channel and the participating content, where the participating content of the docking channel is configured to indicate that a request result of a data processing request of the docking channel is a request success, and after the first docking method is executed by inputting the first docking port and the first data into the first docking method, the method further includes: receiving a response message sent by a system corresponding to the first docking channel, wherein the response message comprises request result feedback information used for indicating whether the processing request of the first data is a request success; determining first participating content corresponding to the first docking channel according to the first association relation; determining whether the request result feedback message is consistent with the first target participating content; if so, determining that the request result of the first data processing request is a request success, and if not, determining that the request result of the first data processing request is a request failure.
In the application, a principle that the docking channels with different docking types are consistent in processing modes of the same docking information (for example, a parameter format of parameter information required for data docking with a corresponding system through the docking channel, an encryption mode required by the parameter information, and the like) is also utilized, one or more of the parameter format, the parameter output content, and attributes of the encryption mode are added to the first association relationship, and the implementation modes of the different docking channels for format conversion of the parameter input content, encryption processing of the parameter input content, and analysis of a request result returned by a target interface are abstracted into the same processing flow, so that the code amount of program development is further reduced, the system stability is improved, the problem of errors in the existing service caused by later docking of a new platform is reduced, and meanwhile, the rapid expansion of the product is facilitated.
In a possible implementation manner, the first association relationship is represented by a class, the attributes of the classes include a docking type, a docking entry, a parameter format, and an encryption manner, and one of the classes is used for representing a docking channel; the determining that the docking type of the first docking channel is a first docking type according to the first association relationship and the docking entrance of the first docking channel is a first docking entrance according to the first association relationship includes: taking a value of an attribute of a docking type of a first instantiation object of the class corresponding to the first identifier as the first docking type, and taking a value of an attribute of a docking entry of the first instantiation object as the first call entry, wherein the first instantiation object corresponds to the docking request; the determining, according to the first association relationship, that the parameter format corresponding to the first docking channel is a first parameter format includes: taking the value of the attribute of the parameter format of the first instantiation object as the first parameter format; the determining that the encryption mode corresponding to the first docking channel is the first encryption mode according to the first association relationship includes: and taking the value of the attribute of the encryption mode of the first instantiation object as the first encryption mode.
In one possible implementation, before the obtaining the docking request, the method further includes: generating one or more classes corresponding to the first association relation according to a computer programming language java reflection mechanism and a first database, wherein any one or more of the following items corresponding to the first docking channel are stored in the first database: the first butt-joint type, the first butt-joint inlet, the first encryption mode and the first parameter format; determining the first identifier according to user input, and obtaining the first instantiation object according to the first identifier and a class corresponding to the first identifier, wherein the first instantiation object carries the first data and the first identifier; the obtaining the docking request comprises: and acquiring the docking request according to the first instantiation object.
The above-mentioned obtaining of the docking request according to the first instantiation object may also be understood as or may also be referred to as generating the docking request according to the first instantiation object, which is not limited herein.
In the application, the first association relation is expressed in a class mode, so that the problems of performance loss, poor system stability and the like caused by frequent reading of a database table or a file can be avoided. In addition, a java reflection mechanism is adopted to automatically generate a first docking class corresponding to the first association relationship, so that the code workload of project developers is reduced, and the problem of code errors caused by manual writing is reduced.
In a possible implementation manner, the attribute of the class further includes parameter information, and the obtaining the first instantiation object according to the first identifier and the class corresponding to the first identifier includes: displaying a front-end user page corresponding to the first identifier, wherein the front-end user page comprises a first input port for calling parameter information required by the first docking channel, and the parameter information comprises one or more of the name, the age, the telephone number, the identity card information or the face information of the user; receiving parameter information input by a user as the first data by the first input port; creating an instantiation object of the class corresponding to the first identifier as the first instantiation object; taking the first data as the value of the parameter information of the first instantiation object to obtain the assigned first instantiation object; the obtaining the docking request according to the first instantiation object comprises: and acquiring the docking request according to the assigned first instantiation object.
The above obtaining the docking request according to the assigned first instantiation object may also be understood as or may also be referred to as generating the docking request according to the assigned first instantiation object, which is not limited herein.
In a possible implementation manner, after determining, according to the first association relationship, that the docking type corresponding to the first docking channel is a first docking type, the method further includes: and under the condition that the second association relation does not include the docking method corresponding to the first docking type, determining that the request result of the docking request is a request failure, and outputting prompt information, wherein the prompt information is used for indicating that the docking method corresponding to the first docking type is not configured to a user.
In a second aspect, the present application provides a data interfacing apparatus, including: the device comprises an obtaining unit, a receiving unit and a processing unit, wherein the obtaining unit is used for obtaining a docking request, the docking request comprises a first identifier and first data corresponding to the first identifier, and the first identifier is used for identifying a first docking channel; the first determining unit is used for determining that the docking type corresponding to the first docking channel is a first docking type according to a first incidence relation, and determining that the docking inlet corresponding to the first docking channel is a first docking inlet according to the first incidence relation, wherein the first incidence relation is used for representing incidence relations among the docking channel, the docking type and the docking inlet; a second determining unit, configured to determine, according to a second association relationship, that the docking method corresponding to the first docking type is the first docking method, where the second association relationship is used to represent an association relationship between the docking type and the docking method; a docking unit for docking the first data according to the first docking inlet, the first docking method, and the first docking channel.
In a third aspect, the present application provides an electronic device, comprising: the device comprises a memory and a processor, wherein the memory stores program instructions; the program instructions, when executed by the processor, cause the processor to perform the method as described in the first aspect and any one of the possible implementations of the first aspect.
In a fourth aspect, an embodiment of the present application provides a chip system, where the chip system is applied to an electronic device, and the chip system includes one or more processors, and the processor is configured to invoke a computer instruction to cause the electronic device to execute the method shown in the first aspect or any possible implementation manner of the first aspect.
In a fifth aspect, the present application provides a computer readable storage medium having a computer program stored therein; the computer program, when run on one or more processors, causes the terminal device to perform the method as described in the first aspect and any possible implementation form of the first aspect.
In a sixth aspect, the present application provides a computer program product containing instructions that, when run on a terminal device, cause the terminal device to perform the method as described in the first aspect and any possible implementation manner of the first aspect.
It is to be understood that the data interfacing apparatus provided in the second aspect, the electronic device provided in the third aspect, the chip system provided in the fourth aspect, the computer storage medium provided in the fifth aspect, and the computer program product provided in the sixth aspect are all configured to perform the method shown in the first aspect of the embodiments of the present application or any implementation manner of the first aspect. Therefore, the beneficial effects achieved by the method can refer to the beneficial effects in the corresponding method, and are not described herein again.
Drawings
In order to more clearly illustrate the technical solution in the embodiments of the present invention, the drawings required to be used in the embodiments will be briefly described below.
Fig. 1 is a schematic view of a scene using a data docking method provided in an embodiment of the present application;
fig. 2 is a schematic view of another scenario in which the data docking method provided in the embodiment of the present application is used;
fig. 3 is a schematic flowchart of a data docking method according to an embodiment of the present application;
fig. 4 is a schematic flowchart of another data interfacing method according to an embodiment of the present application;
fig. 5 is a schematic flowchart of another data interfacing method according to an embodiment of the present application;
fig. 6 is a schematic flowchart of another data interfacing method according to an embodiment of the present application;
fig. 7 is a schematic flowchart of another data interfacing method according to an embodiment of the present application;
fig. 8 is a schematic flowchart of another data interfacing method according to an embodiment of the present application;
fig. 9 is a schematic flowchart of another data interfacing method according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of a data interfacing apparatus according to an embodiment of the present application;
fig. 11 is a schematic structural diagram of another data docking device according to an embodiment of the present application;
fig. 12 is a schematic structural diagram of another data docking device according to an embodiment of the present application.
Detailed Description
The present application is described in further detail below with reference to the attached figures.
The terminology used in the following embodiments of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the present application. As used in the specification of the present application and the appended claims, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
In this application, "at least one" means one or more, "a plurality" means two or more, "at least two" means two or three and three or more, "and/or" for describing an association relationship of associated objects, which means that there may be three relationships, for example, "a and/or B" may mean: only A, only B and both A and B are present, wherein A and B may be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. "at least one item(s) below" or similar expressions refer to any combination of these items. For example, at least one (one) of a, b, or c, may represent: a, b, c, "a and b," a and c, "" b and c, "or" a and b and c.
In order to describe the scheme of the present application more clearly, some knowledge related to data docking of the scheme is introduced below.
(1) Data interfacing
Data interfacing is also understood to mean data transmission, and data information can be transmitted between systems or between electronic devices through data interfacing. Data interfacing may be the transmission of data from one system to another external system, or the transmission of data between subsystems in one system to collectively process data requests using functions provided by the respective systems. Data interfacing between electronic devices is consistent with the concept of data interfacing between systems and will not be described in detail herein.
Illustratively, data interfacing between the traffic platform side and the internet financial platform. If the traffic platform side is understood as an internal system provided by a company with certain functions, such as an application (app), the internet financial platform can be understood as an external system, such as a third-party payment channel. One or more items of data in user information (such as user identification card information and the like), financial service information selected by a user or subscription information (such as a subscription contract and/or a subscription result and the like) are docked between the traffic platform party and the internet financial platform, and a financial service request of the user is cooperatively processed.
It is understood that the data interfacing may be data interfacing without parameters or data interfacing with parameters. For data docking without parameters, the first system only needs to initiate a docking request to the second system through a docking entry corresponding to the second system, and the docking request does not carry parameter information. For the data docking without the parameter, the data docking operation is embodied when the second system receives and processes the docking request and returns a processing result (for example, returns page data of the second system) to the first system. For data docking with parameters, a docking request initiated by a first system to a second system through a docking entry corresponding to the second system needs to carry parameter information, and a data docking operation thereof may be embodied in that the first system sends the parameter information to the second system through the docking entry, so that the second system responds according to the parameter information.
(2) Data docking channel
It can be understood that data interfacing between systems can be realized through the interfacing channel provided by each system. The docking information of the docking channel comprises docking entries, and data docking is carried out among the systems through the docking entries. Illustratively, the a system provides a docking portal a1, and the B system may initiate a docking request for data docking to the a system through the docking portal a1, for example, initiate a request for accessing data to the a system, or send data information to the a system, requesting the a system to respond to process the data information.
It will be appreciated that there may be a plurality of different docking types of docking channels, depending on the docking channel (which may also be understood as a docking means).
For example, the docking channel for data docking may include the following docking types:
1) an Application Programming Interface (API). And data docking can be carried out among the systems through the API provided by each system, and specifically, the API corresponding to the interface address is called through the interface address to process a data docking task. Illustratively, the API may be an http interface, an https interface, or the like. The interface address may be a Uniform Resource Locator (URL).
2) Software Development Kit (SDK). Data interfacing can be carried out between the systems through the SDK provided by the systems, and particularly, related function methods corresponding to the method name in the SDK corresponding to the class name can be called through the class name and the method name.
3) A Message Queue (MQ) is called. Data interfacing between the systems can be carried out through MQ provided by the systems. Illustratively, the a system provides MQ1, the B system may place the messages or data to be docked into the MQ1 queue via the production consumer ID of the MQ1, and the a system will in turn read the messages or data in the MQ1 queue, thereby effecting data docking.
Understandably, the interface address of the API, the class name and method name of the SDK, and the producer-consumer ID of the MQ are the docking entries of the docking channel.
In an embodiment of the present application, a docking type may correspond to a plurality of docking channels, and one docking channel corresponds to one docking entry.
It is understood that the data interfacing method of the embodiment of the present application can be performed by any one data interfacing device that needs to interface data with other data interfacing devices. The data interfacing apparatus may have a plurality of different forms, and for example, the data interfacing apparatus may be a software functional module, a chip module, an electronic device, a chip in the electronic device for executing the data interfacing method provided by the present application, a collection of a plurality of electronic devices, a server, or the like. The embodiment of the present application is not limited to a specific form of the data docking device. In the embodiment of the present application, the data docking apparatus may also be referred to as a system, a data docking system, or a data docking integrated system, and the system, the data docking system, or the data docking integrated system may have a variety of different forms, for example, the data docking system may be an electronic device, a server, or a collection of multiple electronic devices, and the embodiment of the present application is not limited to the specific form of the system, the data docking system, and the data docking integrated system.
The following describes a data docking apparatus (execution main body) for executing the data docking method provided by the embodiment of the present application with reference to a usage scenario of the data docking method provided by the embodiment of the present application shown in fig. 1 and fig. 2.
Using scenario one:
it can be understood that the data docking method provided by the embodiment of the application is suitable for data docking between the data docking devices. The following takes the data docking device as an example of a system (e.g., an internal system and an external system), and further describes an execution subject for implementing the data docking method provided by the embodiment of the present application in combination with a usage scenario. It will be appreciated that the two systems may be internal and external to each other. Illustratively, for system a, system a itself is an internal system, and the other systems other than system a are external systems. It will be appreciated that the external systems of the system a may also be referred to as internal systems themselves for the external systems of the system a. In a use scenario of data interfacing between the internal system and the external system, the internal system may send an interfacing request to the external system, and the external system may also send an interfacing request to the internal system.
Illustratively, the internal system may be a traffic platform side, the external system may be a third party payment channel, and it is understood that the third party payment channel may be various, so that the external system may be an external system 1, an external system 2, and an external system N (N is an integer greater than 2).
As shown in fig. 1, in the case that the internal system needs to use the payment function provided by the external system 1, the internal system may initiate a data docking request to the external system 1, and when the external system 1 needs to send data content to the internal system in response to the data docking request of the internal system, the external system B may initiate a data docking request to the internal system.
The description of data interfacing between the internal system and the external system 2 or between the internal system and the external system N (N is an integer greater than 1), etc. is the same as the description of data interfacing between the internal system and the external system 1, and will not be described in detail here.
That is, the internal system or the external system 1, the external system 2, and the external system N may all execute the data interfacing method provided in the embodiment of the present application. That is, the internal system, the external system 1, the external system 2, and the external system N may be execution subjects of the data docking method provided in the embodiment of the present application.
It can be understood that, if the internal system executes the data docking method provided in the embodiment of the present application, all docking channels provided by all or part of the external systems 1, 2 and N that the internal system docks with, and the association between multiple docking types and multiple docking entries corresponding to all or part of the docking channels may be recorded in the first association stored in the internal system, and the docking methods corresponding to the multiple docking types may be recorded in the second association stored in the internal system.
Using scenario two:
for example, as shown in fig. 2, in a usage scenario of data interfacing between systems, the data interfacing method provided in the embodiment of the present application may also be executed by a system other than two interfacing systems (for example, a data interfacing integrated system P).
The first system may be in data interfacing with a plurality of different second systems, and the same second system may also be in data interfacing with different first systems. Thus, the first system may be the first system 1, the first system 2, or the first system N (N is an integer greater than 2), and the second system may be the second system 1, the second system 2, or the second system N.
For example, a first system 1 needs to interface data with one or more of a second system 1, a second system 2, or a second system N; the first system 2 needs to perform data interfacing with one or more of the second system 1, the second system 2 or the second system N; the first system N needs to be data interfaced with the second system 1, the second system 2 or one or more of the second systems N. The data docking integrated system P may communicate or data dock with any one of the first system 1, the first system 2, the first system N, the second system 1, the second system 2, and the second system N.
Specifically, the data docking integrated system P may receive a docking request sent by any one of the first system 1, the first system 2, the first system N, the second system 1, the second system 2, and the second system N, and then execute the data docking method provided herein according to the docking request, so as to implement data docking with the external system according to the docking request.
For example, the first system 1 needs to perform data interfacing with the second system 1, and the first system 1 may determine a first identifier and first data through user input, generate an interfacing request according to the first identifier and the first data, and send the interfacing request to the data interfacing integrated system P. Accordingly, the data docking integrated system P receives (acquires) the docking request; then the data docking integration system P determines, according to a first association relationship, that the docking type of the first docking channel corresponding to the first identifier is a first docking type, determines, according to the first association relationship, that the docking entry of the first docking channel is a first docking entry, where the first association relationship is used to indicate an association relationship among the docking channel, the docking type, and the docking entry; determining the docking method corresponding to the first docking type as a first docking method according to a second association relation, wherein the second association relation is used for representing the association relation between the docking type and the docking method; thus, the data docking integrated system P can dock the first data with the second system 1 according to the first docking inlet, the first docking method and the first docking channel.
That is, the data docking method provided in the embodiment of the present application may also be executed by the data docking integrated system P. That is, the data docking integrated system P may also be an execution subject of the data docking method provided in the embodiment of the present application.
It can be understood that, if the data docking integrated system P executes the data docking method provided in the embodiment of the present application, all docking channels provided by each of the first system 1, the first system 2, the first system N, the second system 1, the second system 2, and the second system N and the association relations between a plurality of docking types and a plurality of docking entries corresponding to all docking channels need to be recorded in the first association relation stored in the data docking integrated system P, and the docking methods respectively corresponding to the plurality of docking types need to be recorded in the second association relation stored in the data docking integrated system P.
It can be understood that, by adopting the above-mentioned manner of the data docking integrated system P, since there are many docking methods corresponding to the docking types set in the data docking integrated system P, there are many supported docking types, the data docking capability is strong, the integration level is high, and various docking requirements between systems can be satisfied.
It is understood that, considering that the concept of the data docking integrated system may enable data docking between unauthorized systems, for example, subsystems of an internal system mutually grant data docking authority, but the data docking authority of the internal system is not granted to an external system, but the external system may dock the internal system through the shared data docking integrated system, thereby causing a data security problem, or may avoid the data security problem by adding a digital certificate verification, which is not limited herein.
It is understood that, when the data docking apparatus executes the data docking method provided in the embodiments of the present application, an execution body executing the data docking method provided in the embodiments of the present application is omitted below for convenience of description.
Example 1:
a data interfacing method provided in the embodiments of the present application is further described below with reference to the accompanying drawings.
As shown in fig. 3, a data interfacing method provided in an embodiment of the present application includes the following steps:
s301, a docking request is obtained, wherein the docking request comprises a first identifier, and the first identifier is used for identifying a first docking channel.
In the embodiment of the present application, the identifier of the docking channel is used to uniquely identify one docking channel, and the identifier of the docking channel and the docking channel are in a one-to-one correspondence relationship.
In this embodiment, the docking request may be a data docking request with parameters or a data docking request without parameters.
It can be understood that the docking request described in the embodiment of the present application may be a docking request that is initiated by a user and carries the first identifier, or the docking request may be generated after corresponding processing is performed on the docking request initiated by the user, or the docking request may be obtained (obtained) by receiving a docking request sent by another data docking device, which is not limited herein.
S302, determining the docking type of the first docking channel as a first docking type according to a first incidence relation, and determining the docking entrance of the first docking channel as a first docking entrance according to the first incidence relation.
In an embodiment of the present application, the first association relationship is used to represent an association relationship among a docking channel, a docking type, and a docking entrance, where docking information of the docking channel includes the docking type and the docking entrance.
Illustratively, the docking type (i.e., the first docking type) of the first docking channel may be an http interface or an https interface, an SDK, or an MQ. When the first docking type is an http interface or an https interface, the first docking port may be a URL, when the first docking type is an SDK, the first docking port may be a class and a method corresponding to the SDK, and when the first docking type is an MQ, the first docking port may be a production consumer ID.
Optionally, the first association relationship may be represented by any manner having a data indexing and searching function. Illustratively, the Markup Language (xml) file may be represented by a table (e.g., a database table) or an eXtensible Markup Language (eXtensible Markup Language), which is not limited herein.
Optionally, the first association relationship may also be represented in a class manner. For example, represented by way of a first docking class whose attributes include a docking type and a docking entry. Understandably, the first association relationship can correspond to one or more first docking classes, and one docking channel corresponds to one first docking class.
In particular, the class code for each first docking class may be written manually by a code developer. Docking information for each docking channel may also be configured in the database a, which may include an identification of the docking channel, a docking type, and a docking entry. And generating one or more first docking class files corresponding to the first association relationship according to a java (computer programming language) reflection mechanism and docking information configured in the database A. In some expressions, this database a may also be referred to as a second database.
Illustratively, the docking information of the docking channels configured in the database a is shown in table 1 below, and it can be understood that the docking information of the docking channels recorded in the database a is filled in by a developer or a user using a data docking method provided by the present scheme.
As shown in table 1, the docking information includes id, type, and head. It can be understood that id corresponds to the identification of the docking channel, type corresponds to the docking type of the docking channel, and head corresponds to the docking entry of the docking channel. And generating a class file corresponding to each first docking class according to the column attribute and the value of the column attribute in the database A by building a framework of a java reflection mechanism operating environment. The value of the identification of the docking channel is used as the class name of the first docking class, the type and the head are used as the attributes of the class, and the class file further comprises an assignment method and an access method of the attribute values of the type and the head attributes.
TABLE 1
id (identification of butt joint channel) type head
pingan http http:/pingan/com
kuaiqian http http:/kuaiqian/com
kuaijie sdk kuaijie () method
It can be understood that the docking type and the docking entry of the docking channel are generally fixed, so that each docking channel has a corresponding initial value for the value of type and head, and the initial value can be filled by a developer or a user according to the corresponding docking information of the docking channel of the system to be docked. When the docking type of the docking channel and the docking entrance are changed, the values of the docking type and the docking entrance are correspondingly modified in the database A, and a java reflection mechanism is adopted to update the corresponding class file code.
For example, if the identifier of the first docking channel is pingan, the class file of the first docking class corresponding to the first docking channel, which is generated according to the docking information corresponding to pingan and the java reflection mechanism in table 1, includes the following parts:
1) the class name of the class file of the first docking class corresponding to the first docking channel is as follows: pingan class;
2) attributes and attribute values of the pingan class: a type attribute of string type, wherein the value of the type is http and; the head attribute of the string type, wherein the value of the head attribute is http:/pingan/com';
3) the attribute assignment method and the attribute access method comprise the following steps: an assignment method setType (), an access method getType (), an assignment method setHead (), and an access method getHead (), respectively.
It can be understood that the first identifier and the first docking channel are different expressions of the same concept, and the first docking class corresponding to the first docking channel is the class corresponding to the first identifier.
It can be understood that the docking request described in the embodiment of the present application may also be a docking request that is initiated by a user and is processed accordingly.
For example, in this embodiment of the present application, before the obtaining of the docking request, the data docking method further includes the following steps S3021 to S3023:
and S3021, determining the first identifier according to user input.
For example, a front page is presented to the user, the front page includes an icon corresponding to the first docking channel, and the first identifier is determined when it is detected that the user clicks the icon corresponding to the first docking channel through the front page.
S3022, obtaining an instantiated object A according to the first identifier and the first docking class corresponding to the first identifier.
Specifically, an instantiation object of the first docking class corresponding to the first identifier is created as the first instantiation object, it can be understood that the instantiation object a corresponds to the first identifier, and it can also be understood that the instantiation object a carries the first identifier.
S3023, the obtaining the docking request includes: the docking request is generated from the instantiation object A.
Specifically, the docking request is generated by taking the instantiated object a as a parameter, for example, a class method executing the data docking method provided by the embodiment of the present application is M (object H), where M is a name of the class method and H is an entry content required for invoking the class method, and the embodiment of the present application may call the instantiated object a (e.g., H1) as the entry content H to generate the docking request, for example, the docking request is M (object H1). The docking request is a docking request initiated by a user, and the docking request is processed correspondingly.
In this embodiment of the application, the first association relationship is expressed by using the database a, and it can be understood that the determining that the docking type of the first docking channel is the first docking type according to the first association relationship and the docking entry of the first docking channel is the first docking entry according to the first association relationship specifically includes: and taking the value of the docking attribute of the instantiation object A as the first docking type, and taking the value of the attribute of the docking entry of the instantiation object A as the first call entry, wherein the instantiation object A corresponds to the docking request.
And S303, determining the docking method corresponding to the first docking type as the first docking method according to the second association relation.
In this embodiment of the present application, the second association relationship is used to represent an association relationship between a docking type and a docking method.
It is understood that the second association relationship can be represented by any manner with data indexing and searching functions. Illustratively, it may be represented by a table, an xml file, or a code statement. For example, the representation by using a code statement may specifically be that a case or if judgment statement is set in the class method m (object h), and the second association relationship is obtained by the docking type and the corresponding docking method supported by the listing system. It can be understood that the docking method (which can also be understood as the docking principle) is consistent for the docking channels with the same docking type. For example, the docking type is consistent with the docking code used by the docking channel with the http interface, so that the docking method of different docking channels with the same docking type can be set as the same docking method (also can be understood as multiplexing the code docked with the same channel).
In the embodiment of the application, the target docking method corresponding to the target docking type is realized as follows: and receiving a target docking inlet, and performing data docking (which can also be understood as sending a data docking request) through a docking principle corresponding to the target docking type and a system corresponding to the docking inlet and the docking inlet.
Illustratively, the target docking type is an http interface, and the target docking method (e.g., htpmethod (string url)) corresponding to the docking type of the http interface is implemented as follows: and after receiving the parameter value of the parameter URL, carrying out data docking with a system (or electronic equipment) corresponding to the URL through a docking principle corresponding to the http interface and the value of the URL. For example, the access parameter content of the target docking method corresponding to the http interface is a URL, and the target docking method implements calling the interface corresponding to the URL by using an http connection class, for example, implementing data docking with the system corresponding to the URL by using an http connection ═ URL. It is to be understood that the description of implementing the interface corresponding to the call URL by using the http URL connection class in the java programming language environment is only an example, and the interface corresponding to the call URL may also be implemented by using other programming language environments, which is not limited herein. The specific implementation of the docking method corresponding to other docking types (for example, docking types such as SDK or MQ) refers to the above-mentioned docking method corresponding to the http interface and related technologies in the field, which are not described in detail herein.
S304, performing data docking according to the first docking port, the first docking method and the first docking channel.
In this embodiment of the application, after determining the first docking method, the first docking channel is entered as a parameter into the first docking method, and the first docking method is operated, that is, the first docking channel is accessed through the first docking port to perform data docking (specifically, data docking is performed on a system, an electronic device, or a data docking apparatus corresponding to the first docking port).
For example, as shown in table 1 above, if the first identifier is pingan, a value of the first docking type corresponding to the first identifier is http, that is, the docking method for processing the docking request is a docking method corresponding to an http interface; the docking entry corresponding to the first identifier is http:/pingan/com, that is, the interface address (URL) of the http interface corresponding to the first identifier is http:/pingan/com. Taking the value of the http:/pingan/com interface address as the entry parameter, calling and running a http interface corresponding method http (string URL) method, for example, the value of the argument of the profile URL may be transmitted in an http:/pingan/com manner, calling and running a docking method corresponding to the http interface, and implementing data docking with the interface corresponding to the URL.
Generally, when a new docking channel is docked, a class method for docking the current docking channel needs to be reset according to the docking mode of the new docking channel and the corresponding docking method set for the docking entrance.
However, by using the method provided by the embodiment of the present application, the docking information of the docking channel is abstracted into the docking type and the docking entry, different docking methods are set for each of the commonly used docking types according to different docking information, and the same docking method is used for the docking channels of the same docking type.
Therefore, when a new docking channel is docked, if the docking type of the new docking channel is the docking type supported by the configuration of the current system (that is, the data docking apparatus executing the data docking method provided in the embodiment of the present application) (it can also be understood that the second association stored in the current system includes the docking method corresponding to the docking type of the new docking channel), data docking between the new docking channel and the system to be docked can be realized only by adding docking information corresponding to the new docking channel in the first association relationship and developing a corresponding front-end page for receiving information (such as the first identifier) input by the user, background codes do not need to be developed, code amount of program development is reduced, system stability is improved, the problem of error of the existing service caused by later docking of a new platform is reduced, and meanwhile, rapid expansion of products is facilitated.
In some implementation manners, the first association relationship is represented by a class, and a java reflection mechanism is adopted to generate a first docking class corresponding to each docking channel. The identifier of one docking channel corresponds to a first docking class, and the first docking class is configured with a docking type and a docking entry corresponding to the identifier of the docking channel, which may specifically refer to the relevant description of step S302.
Exemplarily, after the docking request including the first identifier is obtained, the first docking class corresponding to the first identifier is determined according to the first association relationship, and the instantiation object a of the first docking class corresponding to the first identifier is created, so that the first docking type and the first docking access port corresponding to the first identifier are obtained.
It can be understood that the database table or the xml file is used for representing the first association relationship, the database table or the xml file needs to be accessed once when a call request including the first identifier is received, and frequent reading of the database table or the xml file can bring large performance loss to system operation and bad influence to system stability.
However, if the first association relationship is represented by a class manner, the first docking type and the first docking port corresponding to the first identifier can be found only by implementing the instantiated object a of the first docking class corresponding to the first identifier and calling the attribute value by the instantiated object. For example, the instantiated object a is httpm, the attribute name of the docking type is type, the attribute name of the docking entry is head, the value of the first docking type can be obtained by adopting the method of httpm. The problems of performance loss, poor system stability and the like caused by frequent reading of a database table or an xml file can be avoided. In addition, a java reflection mechanism is adopted to automatically generate a first docking class corresponding to the first association relationship, so that the code workload of project developers is reduced, and the problem of code errors caused by manual writing is reduced.
Example 2:
the following further describes another data interfacing method provided by the embodiments of the present application with reference to the drawings.
It is understood that the first docking channel may also be a data docking channel with parameters, and a data docking method for data docking with parameters provided by the embodiment of the present application is described in detail below with reference to fig. 4.
As shown in fig. 4, the data interfacing method includes the steps of:
s401, a docking request is obtained, wherein the docking request comprises a first identifier and first data, and the first identifier is used for identifying a first docking channel.
For a detailed description of the docking request, the identification of the docking channel, the first identification, and the first docking channel, reference is made to the related description of other embodiments herein, and details thereof are not described herein.
In an embodiment of the present application, the docking information of the docking channel further includes parameter information, where the parameter information is used to indicate incoming access content required for data docking with a corresponding system using the docking channel. It can be understood that the first data is parameter information (which can also be understood as reference content) required for data interfacing with the corresponding system through the first interfacing channel.
Illustratively, the parameter information may include one or more items of data of a name, an age, a telephone number, identification card information, or face information of the user. Each parameter (e.g., name) in the parameter information may have a field format, such as a field name, a field type, a field length, or a field data size.
Alternatively, the parameter information may be represented by a class, and for convenience of description, a class corresponding to the parameter information is referred to as a parameter information class. The parameter information class may be generated, for example, by the java reflection mechanism. Specifically, the field format of each parameter of the parameter information class shown in table 2 below is configured in the database B. For example, attribute information of a parameter information class corresponding to the parameter information corresponding to the first docking channel is configured in the database B, and the parameter information class corresponding to the first docking channel is generated according to the java reflection mechanism and the parameter information configured in the database B.
It can be understood that after the java reflection mechanism and the database B are used to generate the corresponding parameter information class, before the docking request is obtained, the first identifier and the first data are obtained according to the user input, and then the first data is assigned to the instantiation object (for example, the instantiation object B) of the parameter information class corresponding to the first identifier, and the instantiation object B is used as the first data. The first data may also be stored in the database B, for example, in the "attribute value of user 1" column in table 2, and the parameter information included in the first data corresponding to user 1 is stored in the database B, so as to provide the user with a subsequent search function and the like.
TABLE 2
Figure BDA0003516349080000121
Figure BDA0003516349080000131
S402, determining the docking type of the first docking channel as a first docking type according to the first association relation, and determining the docking inlet of the first docking channel as a first docking inlet according to the first association relation.
In the embodiment of the present application, the first association relationship is used to indicate an association relationship among a docking channel, a docking type, and an access port.
For a detailed description of the first association relationship, the first docking type and the first docking port, please refer to the related description of other embodiments herein (for example, step S302 in fig. 3 described above), which is not detailed herein.
And S403, determining the docking method corresponding to the first docking type as the first docking method according to the second association relationship.
In this embodiment of the present application, the second association relationship is used to represent an association relationship between a docking type and a docking method.
For a detailed description of the second association relationship and the first docking method, reference is made to the related description of other embodiments herein, and details thereof are not described herein.
S404, inputting the first docking port and the first data into the first docking method, and operating the first docking method to realize data docking between the devices corresponding to the first docking channel.
For data docking with parameters, after determining the first docking method, the first docking port and the first data are transmitted into the first docking method as parameters, and the first docking method is operated so that data docking processing on the first data is performed through the first docking port. Specifically, the first data may be docked by the system, the electronic device or the data docking apparatus corresponding to the first docking channel through the first docking port, or a data docking request for docking the first data may be transmitted to the system, the electronic device or the data docking apparatus corresponding to the first docking channel through the first docking port.
For a detailed description of the first docking method, reference is made to the related description of other embodiments herein (for example, the related description of the docking method corresponding to the http interface in step S304 in fig. 3), and details thereof are not further described herein.
In some implementations, the docking information of the docking channel may further include a parameter format, and the first association is used to represent an association between the docking channel, the docking type, the docking entry, and the parameter format. For example, as shown in fig. 5, before the step S404, the data docking method provided in the embodiment of the present application further includes the following steps:
s501, determining the parameter format corresponding to the first docking channel as a first parameter format according to the first association relation.
In this embodiment of the application, the parameter Format may be a JS Object Notation (JavaScript Object Notation, json) Format, an eXtensible Markup Language (xml) Format, a Data Transfer Object (DTO) Format, a Portable Document Format (pdf), a word Format, or a file binary Format. It will be appreciated that the parameter format may also be other suitable parameter formats, based on the requirements, and is not limited herein.
S502, determining whether the data format of the first data is consistent with the first parameter format.
S503, converting the first data into data in accordance with the first parameter format, and obtaining formatted first data.
In this embodiment, if the data format of the first data is not consistent with the first parameter format, the first data is converted into data consistent with the first parameter format, so as to obtain formatted first data.
S504, the inputting the first docking port and the first data into the first docking method in step S404 includes: and inputting the first butt-joint inlet and the first data with the updated format into the first butt-joint method.
In an embodiment of the present invention, the first data is parameter information required for data interfacing with the corresponding system through the first interface channel, and the parameter format of the interface channel is used to indicate a data format of the parameter information required for data interfacing with the corresponding system through the first interface channel. That is, the first parameter format is used to indicate a data format corresponding to the first data. Therefore, if the data format of the first data is not consistent with the first parameter format, the data format of the first data needs to be converted into the data format consistent with the first parameter format. In the description herein of the present invention,
it is to be understood that the above description of data interfacing with a corresponding system through an interfacing channel can also be other descriptions, which are not limited herein, for example, interfacing with a corresponding system through an interfacing channel.
In some other implementation manners, the docking information of the docking channel further includes an encryption manner, and the first association relationship is used to indicate an association relationship among the docking channel, the docking type, and the access port, and specifically includes: the first incidence relation is used for expressing the incidence relation among the docking channel, the docking type, the docking entrance and the encryption mode. For example, as shown in fig. 6, before the step S404, the data docking method provided in the embodiment of the present application further includes the following steps:
s601, determining the encryption mode corresponding to the first docking channel as a first encryption mode according to the first association relation.
In this embodiment of the application, the Encryption manner may be Advanced Encryption Standard (AES), Data Encryption Standard (DES), or RSA Encryption (rsaalgorithms), and the Encryption manner may also be other Encryption algorithms, which is not limited herein.
S602, encrypt the first data by using the first encryption method, to obtain encrypted first data.
S603, the inputting the first docking port and the first data into the first docking method in step S404 includes: and inputting the first butt-joint inlet and the first data with the updated format into the first butt-joint method.
In an embodiment of the present invention, the first data is parameter information required for interfacing with the corresponding system through the first interface channel, and the encryption scheme of the interface channel is used to indicate an encryption scheme of the parameter information required for interfacing with the corresponding system through the first interface channel. Therefore, the first encryption mode encrypts the first data to obtain encrypted first data, and the encrypted first data is docked through the first docking channel.
It can be understood that the docking information of the docking channel may include any one or both of the above parameter format and the above encryption manner, that is, only the above step S501 to step S504 may be performed, or only the above step S601 to step S603 may be performed. When the docking information of the docking channel includes the parameter format and the encryption method, the steps S501 to S503 and the steps S601 to S602 may be executed simultaneously or sequentially, which is not limited herein.
Exemplarily, as shown in fig. 7, the docking information of the docking channel includes a parameter format and an encryption manner, and the first association relationship is used to represent the docking channel, the docking type, and the association relationship between the docking channel and the access port, and specifically includes: the first association relationship is used for representing the association relationship among the docking channel, the docking type, the docking entry, the parameter format and the encryption mode, and the steps S501 to S503 are executed in sequence with the steps S601 to S602. Specifically, as shown in fig. 7, before the step S404, the data docking method provided in the embodiment of the present application further includes the following steps:
s701, determining that the parameter format corresponding to the first docking channel is a first parameter format according to the first incidence relation, and determining that the encryption mode corresponding to the first docking channel is a first encryption mode according to the first incidence relation.
S702, under the condition that the data format of the first data is determined to be inconsistent with the first parameter format, converting the first data into data consistent with the first parameter format to obtain the formatted first data.
S703, encrypting the formatted first data by adopting the first encryption mode to obtain formatted and encrypted first data;
s704, the inputting the first docking port and the first data into the first docking method in the step S404 includes: and inputting the first butt-joint inlet and the encrypted first data into the first butt-joint method.
The data docking method provided by the embodiment of the present application is described in detail below by taking docking information of a docking channel as an example, where the docking information includes a docking type, a docking entry, parameter information, a parameter format, and an encryption manner.
In this embodiment of the application, the first association relationship is used to indicate an association relationship among a docking channel, a docking type, and an access port, and specifically includes: the first incidence relation is used for expressing the incidence relation of the docking channel, the docking type, the docking entry, the parameter information, the parameter format and the encryption mode.
In the embodiment of the present application, reference may be made to the description of the first association manner in other embodiments herein, for example, the description in step S302, and details of the manner of representing the first association relationship are not described herein.
Illustratively, the first association relationship may be represented by a class. For example, the attributes of the second docking class include docking type, docking entry, parameter format and encryption method, and a second docking class is used to indicate a docking channel. It can be understood that the first association relationship may correspond to one or more second docking classes, and one docking channel corresponds to one second docking class.
In this embodiment of the application, one or more second docking classes corresponding to the first association relationship may be generated according to a java reflection mechanism and a database C, where the database C stores a first docking type, a first docking port, a first encryption manner, and a first parameter format corresponding to the first docking channel. In other descriptions herein, the database C may also be referred to as a first database, which is a different representation of the same concept as the first database.
Illustratively, the docking information of the docking channels configured in the database C is shown in table 3 below, and it can be understood that the docking information of the docking channels recorded in the database C is filled in by a developer or a user using the data docking method provided by the present scheme.
TABLE 3
id (identification of butt joint channel) type head input format encrypt
pingan http http:/pingan/com pg class word AES
kuaiqian http http:/kuaiqian/com kq class pdf RAS
kuaijie sdk kuaijie () method kj class xml DES
Therefore, a class file of the second docking class corresponding to each docking channel is generated according to the table 3 and the java reflection mechanism. It should be understood that the second docking class provided in the embodiments of the present application refers to a docking class that corresponds to a docking channel (or an identifier of the docking channel) and has the above-mentioned parameter information class as an attribute.
For example, if the identifier of the first docking channel is pingan, the class file of the second docking class corresponding to the first docking channel, which is generated according to the docking information corresponding to pingan and the java reflection mechanism in table 3, includes the following parts:
1) the class name of the class file of the second docking class corresponding to the first docking channel is as follows: pingan class;
2) attributes and attribute values of the pingan class: a type attribute of string type, wherein the value of the type is http and; the head attribute of the string type, wherein the value of the head attribute is http:/pingan/com'; (ii) a An input attribute of the string type, wherein the value of the input attribute is a pg class (namely the parameter information class); a format attribute of the string type, wherein the value of the format attribute is word; and an encrypt attribute of the string type, wherein the value of the encrypt attribute is AES.
3) The attribute assignment method and the attribute access method comprise the following steps: an assignment method settype (), an access method gettype (), of a type attribute; an assignment method of the head attribute setead (), an access method of the head attribute getead (); pg class,; an assignment method setformat (), an access method getformat (), of the format attribute; an assignment method setescript () of the encrypt attribute, and an access method getescript () of the encrypt attribute.
It is understood that one or more docking channels may be included in the same system, and one or more docking channels of the same system may be configured in the database C (the first database), the identification and the docking entry of the one or more docking channels are different pairwise, and the docking type, the parameter information, the parameter format, and the encryption manner of the first one or more docking channels may be the same or different, which is not limited herein.
Illustratively, three major functions of login, registration and service processing are provided in the same system, the functions correspond to three different docking channels respectively, the identification, the docking entry and the parameter information of the three different docking channels are different in pairs, and the docking types, the parameter formats and the encryption modes of the three different docking channels are the same.
The following describes in detail how to obtain the docking request including the first identifier and the first data according to the second docking class corresponding to the first docking channel.
Before the step S401 (obtaining the docking request), the data docking method further includes: determining a first identifier according to user input, and obtaining a first instantiation object according to the first identifier and the second docking class corresponding to the first identifier, wherein the first instantiation object carries the first data and the first identifier; the obtaining of the docking request includes: and generating a docking request according to the first instantiation object.
Specifically, as shown in fig. 8, the determining a first identifier according to the user input and obtaining a first instantiated object according to the first identifier and the second docking class corresponding to the first identifier includes:
s801, determining a first identifier according to user input;
s802, displaying a front-end user page corresponding to the first identifier, wherein the front-end user page comprises a first input port for calling parameter information required by the first docking channel.
S803, the parameter information input by the user is received as the first data through the first input port.
S804, creating an instantiation object of the second docking class corresponding to the first identifier as the first instantiation object;
it can be understood that the values of the attributes of the docking type, the docking entry, the parameter format, and the encryption mode in the attributes of the first instantiated object are consistent with the values of the attributes corresponding to the second docking class corresponding to the first identifier. The value of the parameter information of the first instantiation object may be null (nul l) during creation, and the parameter information of the first instantiation object has a real value after the first data is used as the value of the parameter information of the first instantiation object in step S805.
S805, the first data is used as the value of the parameter information of the first instantiation object, and the assigned first instantiation object is obtained.
Understandably, the attribute of the parameter information in the second docking class is a parameter information class, so that the instantiated object (for example, the instantiated object B) of the parameter information class corresponding to the first identifier can be used to carry the first data, and the instantiated object B is used as the first data to be assigned to the parameter information of the first instantiated object, so as to obtain the assigned first instantiated object.
S806, the generating the docking request according to the first instantiation object specifically includes: and generating (acquiring) the docking request according to the assigned first instantiation object.
The following describes in detail how the first docking type, the first docking port, the first parameter format, and the first encryption scheme are obtained from the second docking type.
In this embodiment, if the first association relationship is expressed by using the second docking class (specifically, a class corresponding to a docking channel), the first docking type, the first docking access, the first parameter format, and the first encryption method need to be obtained according to the second docking class corresponding to the first association relationship. Specifically, the method comprises the following steps:
the determining that the docking type of the first docking channel is the first docking type according to the first association, and determining that the docking entrance of the first docking channel is the first docking entrance according to the first association specifically includes: and taking the value of the attribute of the docking type of the first instantiation object of the second docking class corresponding to the first identifier as the first docking type, and taking the value of the attribute of the docking entry of the first instantiation object as the first call entry, wherein the first instantiation object corresponds to the docking request. The determining, according to the first association relationship, that the parameter format corresponding to the first docking channel is the first parameter format includes: taking the value of the attribute of the parameter format of the first instantiation object as the first parameter format; the determining that the encryption mode corresponding to the first docking channel is the first encryption mode according to the first association relationship includes: and taking the value of the attribute of the encryption mode of the first instantiation object as the first encryption mode.
For example, as shown in fig. 9, after determining that the docking type of the first docking channel is the first docking type according to the first association relationship in step S302 or step S402, the data docking method further includes:
s901, determining whether the second association relation comprises a docking method corresponding to the first docking type.
If it is determined that the second association relationship includes the docking method corresponding to the first docking type, the step S303 is executed, that is, the docking method corresponding to the first docking type is determined to be the first docking method according to the second association relationship.
And S902, when determining that the second association does not include the docking method corresponding to the first docking type, determining that the request result of the docking request is a request failure, and outputting prompt information, wherein the prompt information is used for indicating that the docking method corresponding to the first docking type is not configured to the user.
It can be understood that by using the method shown in fig. 9, the prompt information can be output in time without including the docking method corresponding to the first docking type in the second association relationship, thereby avoiding unnecessary bug generated by code operation and improving the fault tolerance of the system.
It will be appreciated that the above-described prompt information may be used to indicate to the project programming user the types of docking that are not supported by the system. Illustratively, when there are many docking methods corresponding to the docking types stored in the second association relationship and a new docking channel needs to be added, if a manual checking manner is adopted, it is checked one by one according to the docking method corresponding to the docking type stored in the second association relationship whether the docking method corresponding to the docking type of the new docking channel is already configured, the workload is large, and an error is easy to occur, so that the method shown in fig. 9 may be adopted, and when the docking method corresponding to the docking type of the new docking channel is not configured in the second association relationship, the prompt information is output, so as to prompt whether the system supports the docking type corresponding to the new docking channel or not, and whether the docking method corresponding to the docking type needs to be configured in the system or not, according to the prompt information. The user requirements are met, and the user is helped to reduce the workload.
The data interfacing apparatus provided by the embodiment of the present invention will be described below.
Fig. 10 is a schematic structural diagram of a data docking device according to an embodiment of the present invention. As shown in fig. 10, the data interfacing apparatus according to the embodiment of the present invention may include:
an obtaining unit 1001, configured to obtain a docking request, where the docking request includes a first identifier and first data corresponding to the first identifier, and the first identifier is used to identify a first docking channel;
a first determining unit 1002, configured to determine, according to a first association relationship, that a docking type corresponding to the first docking channel is a first docking type, and determine, according to the first association relationship, that a docking entrance corresponding to the first docking channel is a first docking entrance, where the first association relationship is used to indicate an association relationship among the docking channel, the docking type, and the docking entrance;
a second determining unit 1003, configured to determine, according to a second association relationship, that the docking method corresponding to the first docking type is the first docking method, where the second association relationship is used to indicate an association relationship between the docking type and the docking method;
a docking unit 1004 for docking the first data according to the first docking port, the first docking method, and the first docking channel.
As shown in fig. 11, in a possible implementation manner, the docking unit 1004 is specifically configured to input the first docking port and the first data into the first docking method, and operate the first docking method to implement data docking between devices corresponding to the first docking channel.
In a possible implementation manner, the above-mentioned first association relationship is used to represent an association relationship among a docking channel, a docking type, and an access port, and includes: the first association relationship is used to represent an association relationship among a docking channel, a docking type, a docking entry, and a parameter format, and the data docking apparatus further includes:
a third determining unit 1005, configured to determine, according to the first association relationship, that a parameter format corresponding to the first docking channel is a first parameter format.
A conversion unit 1006, configured to, when a data format of the first data does not coincide with the first parameter format, convert the first data into data that coincides with the first parameter format, and obtain formatted first data;
the docking unit 1004 is specifically configured to input the first docking port and the first data with the updated format into the first docking method, and operate the first docking method to implement data docking between devices corresponding to the first docking channel.
In a possible implementation manner, the above-mentioned first association relationship is used to represent an association relationship among a docking channel, a docking type, and an access port, and includes: the first association relationship is used to represent an association relationship among a docking channel, a docking type, a docking entry, and an encryption manner, and the data docking apparatus further includes:
a fourth determining unit 1007, configured to determine, according to the first association relationship, that the encryption method corresponding to the first docking channel is the first encryption method, where the first association relationship is used to indicate an association relationship among the docking channel, the docking type, the docking entry, and the encryption method.
The encryption unit 1008 is configured to encrypt the first data by using the first encryption method to obtain encrypted first data.
The docking unit 1004 is specifically configured to input the first docking port and the encrypted first data into the first docking method, and operate the first docking method to implement data docking between devices corresponding to the first docking channel.
In a possible implementation manner, the first determining unit 1002 is specifically configured to use a value of an attribute of a docking type of a first instantiation object of a class corresponding to the first identifier as the first docking type, and use a value of an attribute of a docking entry of the first instantiation object as the first call entry; the third determining unit 1005 is specifically configured to take a value of an attribute in a parameter format of the first instantiation object as the first parameter format; the fourth determining unit 1007 is specifically configured to use a value of an attribute of an encryption scheme of the first instantiation object as the first encryption scheme.
In one possible implementation manner, the data interfacing apparatus further includes:
a generating unit 1009, configured to generate one or more classes corresponding to the first association relationship according to a computer programming language java reflection mechanism and a first database, where the first database stores any one or more of the following corresponding to the first docking channel: the first docking type, the first docking port, the first encryption scheme, and the first parameter format;
a fifth determining unit 1010, configured to determine the first identifier according to a user input, and obtain the first instantiation object according to the first identifier and a class corresponding to the first identifier, where the first instantiation object carries the first data and the first identifier;
the obtaining unit 1001 is specifically configured to obtain the docking request according to the first instantiation object.
In one possible implementation manner, the data interfacing apparatus further includes:
a display unit 1011, configured to display a front-end user page corresponding to the first identifier, where the front-end user page includes a first input port for calling parameter information required by the first docking channel, and the parameter information includes one or more of a name, an age, a phone number, identity card information, and face information of a user;
a receiving unit 1012, configured to receive, as the first data, parameter information input by a user through the first input port;
a creating unit 1013 configured to create an instantiation object of a class corresponding to the first identifier as the first instantiation object;
the assignment unit 1014 is configured to use the first data as a value of parameter information of the first instantiation object, and obtain an assigned first instantiation object;
the obtaining unit 1001 is specifically configured to obtain the docking request according to the assigned first instantiation object.
In one possible implementation manner, the data interfacing apparatus further includes:
an output unit 1015, configured to, if the second association does not include the docking method corresponding to the first docking type, determine that a request result of the docking request is a request failure, and output prompt information for indicating to the user that the docking method corresponding to the first docking type is not configured.
In the embodiment of the present application, for the above descriptions about the first identifier, the first docking channel, the first association, the second association, the first docking type, the first docking port, the first parameter format, the first encryption method, the parameter information, and the first instantiation object, reference may be made to the above illustrated method embodiment, and details are not described here.
It should be noted that, for a specific implementation process, reference may be made to specific descriptions of the method embodiments shown in fig. 3 to fig. 9, which are not described herein again.
It will be appreciated that the data docking device shown in FIG. 10 or FIG. 11 can be provided in a variety of product configurations. The data interfacing means may also be exemplarily a data interfacing means of a processor, a communication interface, a memory, and a communication bus as shown in fig. 12. Specifically, as shown in fig. 12, the data interfacing device 120 may include:
at least one processor 1201, e.g., a CPU, at least one communication interface 1203, memory 1204, at least one communication bus 1202. Wherein a communication bus 1202 is used to enable connective communication between these components. The communication interface 1203 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface or bluetooth interface, etc.). The memory 1204 may be a high-speed RAM memory or a non-volatile memory (e.g., at least one disk memory). The memory 1204 may optionally be at least one memory device located remotely from the processor 1201. As shown in fig. 12, memory 1204, which is a type of computer storage media, may include an operating system and program instructions.
For example, the processor 1201 may be configured to implement the steps or methods executed by the obtaining unit 1001, the first determining unit 1002, the second determining unit 1003, and the interfacing unit 1004 in fig. 10.
For example, the communication interface 1203 may also execute the steps or methods executed by the obtaining unit 1001, for example, the communication interface 1203 receives the docking request sent by another electronic device, and the communication interface 1203 sends the docking request to the processor 1201, which is not limited herein.
It is understood that the above-mentioned manners are merely examples, and the steps or methods executed by the obtaining unit 1001, the first determining unit 1002, the second determining unit 1003, and the docking unit 1004 in fig. 10 may also be executed by the processor 1201 and other modules in the data docking device 120, which is not limited herein.
For example, the processor 1201 may be further configured to implement the steps or methods performed by one or more units of the third determining unit 1005, the converting unit 1006, the fourth determining unit 1007, the encrypting unit 1008, the generating unit 1009, the fifth determining unit 1010, the displaying unit 1011, the receiving unit 1012, the creating unit 1013, or the assigning unit 1014 in fig. 11.
It is understood that the above-mentioned manners are merely examples, and the steps or methods performed by one or more units of the third determining unit 1005, the converting unit 1006, the fourth determining unit 1007, the encrypting unit 1008, the generating unit 1009, the fifth determining unit 1010, the displaying unit 1011, the receiving unit 1012, the creating unit 1013, or the assigning unit 1014 in fig. 10 may also be executed by the processor 1201 and other modules in the data interfacing apparatus 120, which is not limited herein.
In the data interfacing apparatus 120 shown in fig. 12, the processor 1201 may be configured to load program instructions stored in the memory 1204 and specifically perform the following operations:
the method comprises the steps of obtaining a docking request, wherein the docking request comprises a first identifier, and the first identifier is used for identifying a first docking channel;
determining that the docking type corresponding to the first docking channel is a first docking type according to a first association relationship, and determining that the docking entrance corresponding to the first docking channel is a first docking entrance according to the first association relationship, where the first association relationship is used to represent association relationships among the docking channel, the docking type, and the docking entrance;
determining that the docking method corresponding to the first docking type is the first docking method according to a second association relation, wherein the second association relation is used for representing the association relation between the docking type and the docking method;
and performing data docking according to the first docking port, the first docking method, and the first docking channel.
It should be noted that, for a specific implementation process, reference may be made to the specific description of the embodiment shown in fig. 3 or fig. 10, which is not described herein again.
An embodiment of the present invention further provides a computer storage medium, where the computer storage medium may store a plurality of instructions, where the instructions are suitable for being loaded by a processor and executing the method steps in the embodiments shown in fig. 3 to 10, and a specific execution process may refer to specific descriptions of the embodiments shown in fig. 3 to 9, which are not described herein again.
As used in the above embodiments, the term "when …" may be interpreted to mean "if …" or "after …" or "in response to determination …" or "in response to detection …", depending on the context. Similarly, depending on the context, the phrase "at the time of determination …" or "if (a stated condition or event) is detected" may be interpreted to mean "if the determination …" or "in response to the determination …" or "upon detection (a stated condition or event)" or "in response to detection (a stated condition or event)".
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. The procedures or functions described in accordance with the embodiments of the present application occur, in whole or in part, when the computer program instructions are loaded and executed on a computer. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, fiber optic, digital subscriber line) or wirelessly (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that includes one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid state drives), among others.
One of ordinary skill in the art will appreciate that all or part of the processes in the methods of the above embodiments may be implemented by hardware related to instructions of a computer program, which may be stored in a computer-readable storage medium, and when executed, may include the processes of the above method embodiments. And the aforementioned storage medium includes: various media capable of storing program codes, such as ROM or RAM, magnetic or optical disks, etc.

Claims (11)

1. A method of data interfacing, the method comprising:
the method comprises the steps of obtaining a docking request, wherein the docking request comprises a first identifier, and the first identifier is used for identifying a first docking channel;
determining that the docking type corresponding to the first docking channel is a first docking type according to a first incidence relation, and determining that the docking inlet corresponding to the first docking channel is a first docking inlet according to the first incidence relation, wherein the first incidence relation is used for representing incidence relations among the docking channel, the docking type and the docking inlet;
determining that the docking method corresponding to the first docking type is the first docking method according to a second incidence relation, wherein the second incidence relation is used for representing the incidence relation between the docking type and the docking method;
and carrying out data docking according to the first docking inlet, the first docking method and the first docking channel.
2. The method of claim 1, wherein the docking request further comprises first data, the docking of data according to the first docking inlet, the first docking method, and the first docking channel comprising:
inputting the first docking port and the first data into the first docking method, and operating the first docking method to realize data docking between devices corresponding to the first docking channel.
3. The method of claim 2, wherein the first association representing an association between a docking channel, a docking type, and an access comprises: the first association is used for representing an association between a docking channel, a docking type, a docking entry and a parameter format, before the inputting the first pair of access ports and the first data into the first docking method, the method further comprises:
determining the parameter format corresponding to the first docking channel as a first parameter format according to the first incidence relation;
if the data format of the first data is not consistent with the first parameter format, converting the first data into data consistent with the first parameter format to obtain first data with an updated format;
said inputting said first pair of access ports and said first data into said first docking method comprises:
and inputting the first butt-joint inlet and the first data with the updated format into the first butt-joint method.
4. The method of claim 2, wherein the first association representing an association between a docking channel, a docking type, and an access comprises: the first association relationship is used for representing the association relationship among a docking channel, a docking type, a docking entry and an encryption mode, and before the inputting the first docking entry and the first data into the first docking method, the method further comprises:
determining that the encryption mode corresponding to the first docking channel is a first encryption mode according to the first incidence relation, wherein the first incidence relation is used for representing the incidence relation among the docking channel, the docking type, the docking entrance and the encryption mode;
encrypting the first data by adopting the first encryption mode to obtain encrypted first data;
said inputting said first pair of access ports and said first data into said first docking method comprises:
inputting the first docking port and the encrypted first data into the first docking method.
5. The method according to claim 3 or 4, wherein the first association relationship is represented by means of classes, the attributes of the classes include docking type, docking entry, parameter format and encryption mode, one of the classes is used for representing a docking channel;
the determining that the docking type of the first docking channel is a first docking type according to the first association relationship and the docking entrance of the first docking channel is a first docking entrance according to the first association relationship includes:
taking a value of an attribute of a docking type of a first instantiation object of the class corresponding to the first identifier as the first docking type, and taking a value of an attribute of a docking entry of the first instantiation object as the first call entry, wherein the first instantiation object corresponds to the docking request;
the determining, according to the first association relationship, that the parameter format corresponding to the first docking channel is a first parameter format includes:
taking the value of the attribute of the parameter format of the first instantiation object as the first parameter format;
the determining that the encryption mode corresponding to the first docking channel is the first encryption mode according to the first association relationship includes:
and taking the value of the attribute of the encryption mode of the first instantiation object as the first encryption mode.
6. The method of claim 5, wherein prior to the obtaining the docking request, the method further comprises:
generating one or more classes corresponding to the first association relation according to a computer programming language java reflection mechanism and a first database, wherein any one or more of the following items corresponding to the first docking channel are stored in the first database: the first butt-joint type, the first butt-joint inlet, the first encryption mode and the first parameter format;
determining the first identifier according to user input, and obtaining the first instantiation object according to the first identifier and a class corresponding to the first identifier, wherein the first instantiation object carries the first data and the first identifier;
the obtaining the docking request comprises:
and acquiring the docking request according to the first instantiation object.
7. The method of claim 6, wherein the attribute of the class further includes parameter information, and wherein obtaining the first instantiation object according to the first identifier and the class corresponding to the first identifier comprises:
displaying a front-end user page corresponding to the first identifier, wherein the front-end user page comprises a first input port for calling parameter information required by the first docking channel, and the parameter information comprises one or more of the name, the age, the telephone number, the identity card information or the face information of the user;
receiving parameter information input by a user as the first data by the first input port;
creating an instantiation object of the class corresponding to the first identifier as the first instantiation object;
taking the first data as the value of the parameter information of the first instantiation object to obtain the assigned first instantiation object;
the obtaining the docking request according to the first instantiation object comprises:
and acquiring the docking request according to the assigned first instantiation object.
8. The method of any one of claims 1 to 4 or 6 to 7, wherein after the determining that the docking type corresponding to the first docking channel is the first docking type according to the first association relationship, the method further comprises:
and under the condition that the second association relation does not include the docking method corresponding to the first docking type, determining that the request result of the docking request is a request failure, and outputting prompt information, wherein the prompt information is used for indicating that the docking method corresponding to the first docking type is not configured to a user.
9. A data interfacing apparatus, comprising:
the device comprises an obtaining unit, a receiving unit and a processing unit, wherein the obtaining unit is used for obtaining a docking request, the docking request comprises a first identifier and first data corresponding to the first identifier, and the first identifier is used for identifying a first docking channel;
the first determining unit is used for determining that the docking type corresponding to the first docking channel is a first docking type according to a first incidence relation, and determining that the docking inlet corresponding to the first docking channel is a first docking inlet according to the first incidence relation, wherein the first incidence relation is used for representing incidence relations among the docking channel, the docking type and the docking inlet;
a second determining unit, configured to determine, according to a second association relationship, that the docking method corresponding to the first docking type is the first docking method, where the second association relationship is used to represent an association relationship between the docking type and the docking method;
a docking unit for docking the first data according to the first docking inlet, the first docking method, and the first docking channel.
10. An electronic device, comprising: a memory, a processor, wherein the memory stores program instructions; the program instructions, when executed by the processor, cause the processor to perform the method of any of claims 1-8.
11. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium; the computer program, when run on one or more processors, performs the method of any one of claims 1-8.
CN202210174919.7A 2022-02-23 2022-02-23 Data docking method and related device Pending CN114546370A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210174919.7A CN114546370A (en) 2022-02-23 2022-02-23 Data docking method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210174919.7A CN114546370A (en) 2022-02-23 2022-02-23 Data docking method and related device

Publications (1)

Publication Number Publication Date
CN114546370A true CN114546370A (en) 2022-05-27

Family

ID=81679926

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210174919.7A Pending CN114546370A (en) 2022-02-23 2022-02-23 Data docking method and related device

Country Status (1)

Country Link
CN (1) CN114546370A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115934158A (en) * 2023-02-23 2023-04-07 云筑信息科技(成都)有限公司 Personalized configuration method based on service identity

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115934158A (en) * 2023-02-23 2023-04-07 云筑信息科技(成都)有限公司 Personalized configuration method based on service identity

Similar Documents

Publication Publication Date Title
US10862979B2 (en) Techniques for supporting remote micro-services as native functions in spreadsheet applications
US8843646B2 (en) Multi-desktop interaction using nested remote desktop sessions
CN111291103B (en) Interface data analysis method and device, electronic equipment and storage medium
US20240012641A1 (en) Model construction method and apparatus, and medium and electronic device
JP2019511785A (en) Pre-formed instructions for mobile cloud services
CN113760565A (en) Data processing platform, data processing method, storage medium and electronic equipment
US11797271B2 (en) Dynamic web-based integrated development environment
CN111897842A (en) Data checking method, device, computer system and medium
CN110377273B (en) Data processing method, device, medium and electronic equipment
WO2022152018A1 (en) Method and device for identifying multiple accounts belonging to the same person
CN114546370A (en) Data docking method and related device
CN112714042B (en) Pressure testing method and device, electronic equipment and storage medium
CN110070394A (en) Data processing method, system, medium and calculating equipment
CN112732547B (en) Service testing method and device, storage medium and electronic equipment
CN113132400A (en) Business processing method, device, computer system and storage medium
CN115374207A (en) Service processing method and device, electronic equipment and computer readable storage medium
CN111626802A (en) Method and apparatus for processing information
CN112379967B (en) Simulator detection method, device, equipment and medium
CN113946816A (en) Cloud service-based authentication method and device, electronic equipment and storage medium
CN112905970A (en) Authority verification method and device, computer readable storage medium and electronic equipment
CN113468487B (en) Interface watermark rendering method and device, electronic equipment and computer readable medium
CN113989046A (en) Transaction processing method, apparatus, electronic device, storage medium, and program product
CN111125676B (en) Joint authorization method and device
CN112749073B (en) Service testing method and device, storage medium and electronic equipment
CN113988797A (en) Method and device for processing request, storage medium and electronic equipment

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