CN114116067B - Information configuration method and device for internal and external systems, electronic equipment and readable storage medium - Google Patents

Information configuration method and device for internal and external systems, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN114116067B
CN114116067B CN202111458426.8A CN202111458426A CN114116067B CN 114116067 B CN114116067 B CN 114116067B CN 202111458426 A CN202111458426 A CN 202111458426A CN 114116067 B CN114116067 B CN 114116067B
Authority
CN
China
Prior art keywords
parameter
request
type
value
configuration
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111458426.8A
Other languages
Chinese (zh)
Other versions
CN114116067A (en
Inventor
赵嘉杰
田程
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Duodian Life Wuhan Technology Co ltd
Original Assignee
Duodian Life Wuhan Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Duodian Life Wuhan Technology Co ltd filed Critical Duodian Life Wuhan Technology Co ltd
Priority to CN202111458426.8A priority Critical patent/CN114116067B/en
Publication of CN114116067A publication Critical patent/CN114116067A/en
Application granted granted Critical
Publication of CN114116067B publication Critical patent/CN114116067B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

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

Abstract

The application provides an information configuration method, device, electronic equipment and readable storage medium of an internal and external system, wherein when an access request of an external system is received, a development platform is matched with corresponding parameter configuration according to a request path in the access request, and the parameter configuration is obtained by configuring in advance based on a visual interface. Inquiring the type of the request parameters required by the access request by traversing the matched parameter configuration, converting the values of the request parameters based on the type of each request parameter, analyzing the converted values of the request parameters through the internal service system corresponding to the access request, converting the values into corresponding parameter objects, and returning the parameter objects to the external system. In the scheme, the parameter configuration is performed on the basis of the visual interface in advance so as to be used for the subsequent request parameter conversion basis, the conversion basis can be obtained on the basis of interface operation in a configuration mode, the problem of high coupling degree of a hard coding mode is avoided, and the maintenance cost of the platform is reduced.

Description

Information configuration method and device for internal and external systems, electronic equipment and readable storage medium
Technical Field
The present invention relates to the field of system development technologies, and in particular, to an information configuration method and apparatus for an internal and external system, an electronic device, and a readable storage medium.
Background
The open platform is used as a system for connecting an external merchant and an internal system, and when the data structure returned by the internal system is not uniform, error codes are not uniform, field names with the same meaning are not uniform, and the like, the maintenance cost of the platform is greatly increased. In order to solve the unification of the structure, the field and the definition of the externally output content, the unification conversion processing of the externally output data structure, the error code, the field name and the like is required.
In the conventional method, when performing unified conversion processing of external output, a hard coding method is often adopted to modify conversion logic in codes. The method can only realize targeted conversion processing, and under the condition of adding or modifying conversion logic, the code needs to be copied and secondarily developed, so that the code maintenance cost is high.
Disclosure of Invention
The purpose of the application includes, for example, providing an information configuration method, an information configuration device, an electronic device and a computer readable storage medium of an internal and external system, wherein the method, the device, the electronic device and the computer readable storage medium can be used for carrying out parameter configuration through a visual interface so as to reduce the maintenance cost of a platform.
Embodiments of the present application may be implemented as follows:
in a first aspect, the present application provides an information configuration method of an internal and external system, applied to an open platform, where the open platform is integrated with a plurality of internal service systems, the method includes:
when an access request of an external system is received, matching corresponding parameter configuration according to a request path in the access request, wherein the parameter configuration is obtained by configuring in advance based on a visual interface;
traversing the matched parameter configuration, inquiring the type of the request parameter required by the access request, and converting the value of the request parameter based on the type of each request parameter and the parameter configuration;
analyzing the value of the converted request parameter through the internal service system corresponding to the access request, and converting the value into a corresponding parameter object;
and returning the parameter object to the external system.
In an alternative embodiment, the step of converting the value of the request parameter based on the type of each request parameter and the parameter configuration includes:
judging whether parameter plug-ins corresponding to the request parameters are configured in advance for each request parameter;
if a parameter plug-in is configured, filtering the value of the request parameter according to the parameter plug-in;
and converting the filtered value according to the type of the request parameter and the parameter configuration.
In an alternative embodiment, the step of converting the value of the request parameter based on the type of each request parameter and the parameter configuration includes:
detecting whether the type of the request parameter is an aggregate type or an array type, if so, traversing each element in the request parameter, converting the value of each element into a value corresponding to the type of the parameter in the parameter configuration, and packaging all the converted elements into an aggregate or an array;
if the type of the request parameter is not the set type and the array type, directly converting the value of the request parameter into a value corresponding to the type of the request parameter in the parameter configuration.
In an alternative embodiment, when the type of the request parameter is not a set type or an array type, the step of directly converting the value of the request parameter into a value corresponding to the type to which the request parameter belongs in the parameter configuration includes:
when the type of the request parameter is a basic type, converting the value of the request parameter into a value of a corresponding basic type in the parameter configuration;
when the type of the request parameter is a complex type, the request parameter is converted into a Map object, each key value pair in the Map object is traversed, and each value is converted into a value of a corresponding complex type in the parameter configuration.
In an optional embodiment, before the step of parsing the value of the converted request parameter by the internal service system corresponding to the access request, the method further includes:
packaging the request parameters based on the dubbo framework, and transmitting the values of the converted request parameters into the packaged request parameters;
the step of analyzing the converted value of the request parameter by the internal service system corresponding to the access request comprises the following steps:
and automatically analyzing the packaged request parameters by using the dubbo framework through the internal service system corresponding to the access request, and converting the values of the analyzed request parameters into corresponding parameter objects.
In an alternative embodiment, the method further comprises:
establishing a gateway interface between the open platform and the external system, and configuring interface information of the gateway interface;
and constructing service interfaces of the internal service systems in the open platform, and configuring interface information of the service interfaces.
In an optional embodiment, the interface information of the gateway interface includes at least one of a unique identifier name of the gateway interface, a gateway interface packet, an interface description, a system to which the gateway interface belongs, and external system access restriction information;
the interface information of each service interface comprises at least one of an address of an internal service system, an application name of the internal service system, an interface method, an interface timeout duration and a service call retry number.
In a second aspect, the present application provides an information configuration apparatus for an internal and external system, applied to an open platform, where a plurality of internal service systems are integrated in the open platform, the apparatus includes:
the matching module is used for matching corresponding parameter configuration according to a request path in an access request when the access request of an external system is received, wherein the parameter configuration is obtained by configuring the parameter configuration in advance based on a visual interface;
the conversion module is used for traversing the matched parameter configuration, inquiring the type of the request parameter required by the access request, and converting the value of the request parameter based on the type of each request parameter and the parameter configuration;
the analysis module is used for analyzing the value of the converted request parameter through the internal service system corresponding to the access request and converting the value into a corresponding parameter object;
and the feedback module is used for returning the parameter object to the external system.
In a third aspect, the present application provides an electronic device, comprising: a memory and a processor, wherein the memory is configured to store a computer program, and the processor is configured to execute the computer program to implement the information configuration method of the internal and external system according to any one of the foregoing embodiments.
In a fourth aspect, the present application provides a computer readable storage medium storing a computer program, where the computer program when executed by a processor implements the method for configuring information of an internal and external system according to any one of the foregoing embodiments.
The beneficial effects of the embodiment of the application include, for example:
the application provides an information configuration method, device, electronic equipment and readable storage medium of an internal and external system, wherein when an access request of an external system is received, a development platform is matched with corresponding parameter configuration according to a request path in the access request, and the parameter configuration is obtained by configuring in advance based on a visual interface. Inquiring the type of the request parameters required by the access request by traversing the matched parameter configuration, converting the values of the request parameters based on the type of each request parameter, analyzing the converted values of the request parameters through the internal service system corresponding to the access request, converting the values into corresponding parameter objects, and returning the parameter objects to the external system. In the scheme, the parameter configuration is performed on the basis of the visual interface in advance so as to be used for the subsequent request parameter conversion basis, the conversion basis can be obtained on the basis of interface operation in a configuration mode, the problem of high coupling degree of a hard coding mode is avoided, and the maintenance cost of the platform is reduced.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered limiting the scope, and that other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of an information configuration method of an internal and external system provided in an embodiment of the present application;
fig. 2 is a flowchart of an interface information configuration method in the information configuration method of the internal and external systems provided in the embodiment of the present application;
FIG. 3 is a flow chart of sub-steps included in step S202 of FIG. 1;
FIG. 4 is a schematic diagram of a parameter plug-in configuration application provided in an embodiment of the present application;
FIG. 5 is another flow chart of sub-steps included in step S202 of FIG. 1;
FIG. 6 is a schematic diagram of mapping request parameters of a set type or an array type according to an embodiment of the present application;
FIG. 7 is a schematic diagram of mapping complex types of request parameters provided in the prior art and the present application;
fig. 8 is an interaction schematic diagram of an information configuration method of an internal and external system according to an embodiment of the present application;
fig. 9 is a block diagram of an electronic device according to an embodiment of the present application;
fig. 10 is a functional block diagram of an information configuration apparatus of an internal and external system according to an embodiment of the present application.
Icon: 110-a storage medium; a 120-processor; 130-information configuration means of the internal and external systems; 131-a matching module; a 132-conversion module; 133-a parsing module; 134-a feedback module; 140-communication interface.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. The components of the embodiments of the present application, which are generally described and illustrated in the figures herein, may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present application, as provided in the accompanying drawings, is not intended to limit the scope of the application, as claimed, but is merely representative of selected embodiments of the application. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures.
In the description of the present application, it should be noted that, without conflict, features in the embodiments of the present application may be combined with each other.
Fig. 1 is a schematic flow chart of an information configuration method of an internal and external system according to an embodiment of the present application, where the information configuration method may be implemented by an open platform, and the development platform may be deployed in a server, may be a single server, or may be a cluster formed by multiple servers. The open platform can integrate a plurality of internal service systems, and can be externally connected with an external system, namely the open platform can realize the connection between the external system and the internal service system, and is a system for connecting the request of the external system and the response of the internal system.
It should be understood that, in other embodiments, the order of part of the steps in the information configuration method of the internal and external systems of the present embodiment may be interchanged according to actual needs, or part of the steps may be omitted or deleted. The detailed steps of the information configuration method of the internal and external systems are described as follows.
S201, when an access request of an external system is received, matching corresponding parameter configuration according to a request path in the access request, wherein the parameter configuration is obtained by configuring in advance based on a visual interface.
S202, traversing the matched parameter configuration, inquiring the type of the request parameter required by the access request, and converting the value of the request parameter based on the type of each request parameter and the parameter configuration.
S203, analyzing the converted value of the request parameter through the internal service system corresponding to the access request, and converting the value into a corresponding parameter object.
S204, returning the parameter object to the external system.
In this embodiment, the open platform may be a platform in various application scenarios, for example, an e-commerce platform, a flow management platform, and the like. The embodiment is described by taking an open platform as an e-commerce platform as an example.
The open platform may receive access requests from external systems, which may be any external merchant, for any one or more internal service systems of the open platform. The access request includes a request path and requested request parameters.
In this embodiment, corresponding parameter configurations are preconfigured for different request paths, where the parameter configurations include types of request parameters under specified request paths, and rules for converting values of the request parameters are defined.
In this embodiment, the pre-performed parameter configuration may be implemented based on the visual interface, and stored after the configuration is completed, and then the configured parameter configuration information may be directly invoked after the corresponding parameter configuration is matched in a matching manner.
The access request of the external system involves a plurality of nodes in the request path, namely involves multi-level request parameters, and the matched parameter configuration information correspondingly contains the related information of the multi-level request parameters. And traversing the matched parameter configuration so as to inquire the types of the request parameters of each level.
The types of the request parameters may include Java basic types, such as double, float, byte, short, int, long, char, and the like, and may further include Java complex types, that is, data types inherited from Object classes. And may constitute a set type or an array type based on the basic type or the complex type.
On this basis, the values of the request parameters may be converted based on the type of each request parameter and the parameter configuration. In this way, the conversion of the values of the request parameters may be adapted to the type to which they belong and be obtained in a uniform manner as specified by the parameter configuration. The method can ensure that the parameters returned to the external system in the follow-up process have uniform definition specifications, and avoid the problem of high maintenance cost of the platform.
In this embodiment, the processing procedure may be processed by a gateway of the open platform, and the access request of the external system is directed at any one or more internal service systems in the open platform, and the internal service systems need to parse and obtain the corresponding parameter objects, so that the parameter objects are returned to the external system through the gateway of the open platform. The parameter object may be a specific object corresponding to a request parameter requested by the access request, for example, when the request parameter is specific order information, the parameter object may be a parameter object loaded with specific order data. And, the parameter object may be converted according to unified data format information, unified error code information, unified field name information, and the like configured in the parameter configuration.
In this embodiment, by performing parameter configuration based on the visual interface in advance, the method can be used for subsequent request parameter conversion basis, can be based on interface operation and obtain conversion basis in a configuration mode, so that the problem of higher coupling degree in a hard coding mode is avoided, and the maintenance cost of the platform is reduced.
Referring to fig. 2, before performing the related information configuration operation, the information configuration method provided in this embodiment may further include the following steps:
s101, establishing a gateway interface between the open platform and the external system, and configuring interface information of the gateway interface.
S102, constructing service interfaces of the internal service systems in the open platform, and configuring interface information of the service interfaces.
In this embodiment, the gateway interface is a docking interface between the open platform and the external system, and related information needs to be set in advance for the gateway interface. The interface information of the gateway interface includes a unique identifier name of the gateway interface, which may be dmall.reflows.application.list. The corresponding pair may also include a chinese name of the gateway interface. In addition, a gateway interface packet may be included, and the gateway interface packet may be grouped according to a type of an external system, for example, the external system is a POP order related system, and the packet may be a POP order.
In addition, the interface information of the gateway interface may further include at least one of interface description, belonging system, and external system access restriction information. The interface description may be populated with relevant description information based on demand. Account information of the affiliated person and the like can be included in the affiliated system. And the external system access restriction information may include a restriction of the number of times of access per external system, for example, 500 times/min at the maximum. A total access count limit may also be included, for example 50000 times/min.
The service interface is an interface for interfacing each internal service system in the open platform with the open platform. The interface information of each service interface comprises at least one of an address of an internal service system, an application name of the internal service system, an interface method, an interface timeout duration and a service call retry number. In addition, whether or not the dependent package needs to be uploaded can be set as required.
Based on the above, the parameter configuration can be further performed based on the visual interface, and the parameter configuration includes the type of the request parameter under the request path and the rule of value conversion of the request parameter under the related type. That is, the parameter configuration includes an internal and external system parameter mapping relationship, for example, it may be defined that the parameter objects subsequently returned to the external system are unified into a character string type. While parameters that are passed to the internal service system may be parameters of a corresponding type, such as basic type, complex type, etc.
In practical applications, sometimes the same field is in different interfaces, and the special processing mode is different. Where different interfaces are understood to be different internal service systems, e.g. an amount field, two decimal parts are required to be formatted on the a interface and integers on the B interface. In the existing processing mode, special processing logic is written in codes, and the mode increases the maintenance cost of the system.
Based on the above consideration, in this embodiment, by pre-configuring the parameter plug-ins, different special processing modes are set in each parameter plug-in, and then the corresponding parameter plug-in can be directly invoked for processing. Accordingly, referring to fig. 3, in this embodiment, when the above-mentioned conversion of the request parameters is performed, the following manner may be implemented:
S2021A determines whether or not a parameter plug-in corresponding to the request parameter is configured in advance for each request parameter, and if a parameter plug-in is configured, the following step S2022A, S2023A is executed, and if a parameter plug-in is not configured, the following step S2024A is executed.
S2022A, filtering the value of the request parameter according to the parameter plug-in.
S2023A, converting the filtered value according to the type of the request parameter and the parameter configuration.
S2024A converts the value of the request parameter based on the type of the request parameter and the parameter configuration.
In this embodiment, a corresponding parameter plug-in may be configured at an interface with special filtering requirements, where the parameter plug-in may be, for example, that the formatted amount remains two decimal places, that the formatted amount is an integer, and so on. Before executing the conversion of the request parameters, it may be detected whether the interface is configured with a parameter plug-in, and if the interface is configured with the parameter plug-in, the value of the request parameters is filtered based on a filtering mode specified by the parameter plug-in, and then a subsequent conversion process is performed. If the interface does not have the parameter plug-in, the filtering processing is not performed, and the subsequent conversion processing is continued.
For example, as shown in fig. 4, where the a interface is not configured with a parameter plug-in, when the amount field is 10.132, the output of the interface is 10.132. The B interface is configured with a parameter plug-in which is used for reserving the two-bit decimal for the formatted amount of the amount field, and filtering according to the mode specified by the parameter plug-in, and filtering 10.132 under the amount field is 10.13. In addition, the C interface is configured with a parameter plug-in that specifies formatting the amount field into an integer. Then a filtering process is performed in the manner specified by the parameter plug-in to filter 10.132 under the monetary field to 10.
As can be seen from the foregoing, in this embodiment, the types of request parameters required in the access request may be basic types and complex types, and the basic types or complex types may further form a set type or an array type. The above conversion of the request parameters may be performed as follows, please refer to fig. 5 in combination:
S2021B, detecting whether the type of the request parameter is a set type or an array type, if so, executing the following step S2022B, and if not, executing the following step S2023B.
And S2022B, traversing each element in the request parameters, converting the value of each element into a value corresponding to the type of the element in the parameter configuration, and packaging all the converted elements into a set or an array.
S2023B directly converts the value of the request parameter into a value corresponding to the type to which it belongs in the parameter configuration.
In this embodiment, please refer to fig. 6 in combination, a conversion schematic of request parameters of a set type or an array type is schematically shown in fig. 6. The request parameters of the set type or the array type comprise a plurality of elements, and each element can be a basic type parameter or a complex type parameter. For request parameters of the set type or the array type, after each element is converted according to the type to which the element belongs, the elements in the set or the elements converted in the array are finally packaged.
When the request parameter is not of the set type or the array type, the request parameter indicates that the request parameter is possibly of the basic type or the complex type, and the basic type or the complex type can be directly converted.
Accordingly, when the request parameter is not of the set type or the array type, the request parameter can be converted in the following manner.
And when the type of the request parameter is a basic type, converting the value of the request parameter into the value of the corresponding basic type in the parameter configuration.
When the type of the request parameter is a complex type, the request parameter is converted into a Map object, each key value pair in the Map object is traversed, and each value is converted into a value of a corresponding complex type in the parameter configuration.
In this embodiment, the request parameter of the basic type may be directly converted based on a conversion mode specified in the parameter configuration, for example, if the external parameter type specified in the parameter configuration is a string type, the value of the request parameter may be converted into a corresponding string type.
The complex type is understood as a type in a tree structure, which includes a multi-level structure and corresponds to multi-level parameters. In the prior art, there is no conversion mode for parameters of complex types, but rather, type conversion needs to be added in code logic, and the conversion is performed into a common type by using a strong conversion mode, so that service logic coupling is increased and errors are easy to occur, for example, as shown in the left side of fig. 7.
In this embodiment, by configuring a conversion manner related to a complex type in a manner of pre-configuring parameters, automatic conversion is implemented in the underlying logic, so that the abstract of the parameters is maintained and the post-maintenance can be reduced, for example, conversion as shown in the right side of fig. 7 can be implemented.
When the conversion of the request parameters of the complex type is carried out, the request parameters are firstly converted into Map objects, and the Map objects are presented in a key value pair mode. Each key value pair in the object is traversed, so that each value is converted into a value specified by the parameter configuration pair.
On the basis of the above, the converted request parameters can be analyzed through the corresponding internal service system and the corresponding parameter objects can be returned.
In this embodiment, before the request parameter is transmitted to the internal service system, the request parameter may be encapsulated based on the dubbo framework, and the value of the converted request parameter may be transmitted to the encapsulated request parameter.
In this embodiment, the open platform internal call may be a dubbo call, and the dubbo request may be manually initiated to mainly execute the $invoke method of GenericService provided by the dubbo framework, and the implementation code may be as follows:
the args of the invoke method is the request parameter array, i.e. the request parameters after conversion. If the request parameter is of the basic type, the value is written directly to args. If the request parameter is a complex type, the request parameter is defined as Map, the complex type is defined as map.put ("class", "complex type"), and then the complex type is subjected to JSON conversion. Wherein, the class definition code of the complex type is in the form of:
the JSON structure after args conversion is as follows:
after the encapsulation described above is completed, the internal service system may parse by:
and automatically analyzing the packaged request parameters by using the dubbo framework through the internal service system corresponding to the access request, and converting the values of the analyzed request parameters into corresponding parameter objects.
The open platform can initiate a dubbo request, and after the corresponding internal service system receives the dubbo request, the dubbo framework automatically analyzes the package parameters and loads corresponding data to be converted into parameter objects.
The open platform converts the parameter object into json format and feeds it back to the external system.
In order to enable those skilled in the art to more clearly understand the information configuration method provided by the present embodiment, the following description is provided with reference to the interaction diagram in fig. 8.
An external system may initiate an access request to the open platform, where the external system is any system that may dock with the open platform, such as an external merchant system.
And in the access request received by the gateway in the open platform, matching the request path in the access request to the corresponding parameter configuration, wherein the parameter configuration is obtained by configuring in advance based on the visual interface. And inquiring the type of the request parameters required by the access request by traversing the matched parameter configuration, and converting the values of the request parameters based on the type of the request parameters and the parameter configuration.
The gateway of the open platform encapsulates the request parameters based on the dubbo framework and transmits the values of the converted request parameters into the encapsulated request parameters.
And the gateway of the open platform initiates a dubbo request to the internal service system corresponding to the access request.
And the internal service system receives the dubbo request, automatically analyzes the packaged request parameters by utilizing the dubbo framework, and converts the values of the analyzed request parameters into corresponding parameter objects. The internal service system sends the parameter object to the gateway of the open platform.
The gateway of the open platform converts the parameter object into json format (when the parameter object is of a complex type). And the gateway of the open platform returns the converted parameter object to an external system. The external system responds to and receives the parameter object.
Referring to fig. 9, a schematic diagram of exemplary components of an electronic device according to an embodiment of the present application is provided, where the electronic device may be a server that provides an open platform. The electronic device may include a storage medium 110, a processor 120, an information configuration apparatus 130 of an internal and external system, and a communication interface 140. In this embodiment, the storage medium 110 and the processor 120 are both located in the electronic device and are separately disposed. However, it should be understood that the storage medium 110 may also be separate from the electronic device and accessible to the processor 120 through a bus interface. Alternatively, the storage medium 110 may be integrated into the processor 120, for example, as a cache and/or general purpose registers.
The information configuration apparatus 130 of the internal and external system may be understood as the above-mentioned electronic device or the processor 120 of the electronic device, or may be understood as a software functional module for implementing the information configuration method of the internal and external system under the control of the electronic device, independently of the above-mentioned electronic device or the processor 120.
As shown in fig. 10, the information configuration apparatus 130 of the above-mentioned internal and external system may include a matching module 131, a conversion module 132, an parsing module 133, and a feedback module 134. The functions of the respective functional blocks of the information configuration apparatus 130 of the inside and outside system will be described in detail.
The matching module 131 is configured to match, when an access request of an external system is received, a corresponding parameter configuration according to a request path in the access request, where the parameter configuration is configured based on a visual interface in advance;
it will be appreciated that the matching module 131 may be used to perform step S201 described above, and reference may be made to the details of step S201 regarding the implementation of the matching module 131.
The conversion module 132 is configured to traverse the matched parameter configuration, query the type of the request parameter required by the access request, and convert the value of the request parameter based on the type of each request parameter and the parameter configuration;
it will be appreciated that the conversion module 132 may be used to perform step S202 described above, and reference may be made to the details of step S202 regarding the implementation of the conversion module 132.
The parsing module 133 is configured to parse the value of the converted request parameter through the internal service system corresponding to the access request, and convert the value into a corresponding parameter object;
it is understood that the parsing module 133 may be used to perform the step S203, and the detailed implementation of the parsing module 133 may refer to the content related to the step S203.
A feedback module 134, configured to return the parameter object to the external system.
It is understood that the feedback module 134 may be used to perform the step S204 described above, and reference may be made to the details of the implementation of the feedback module 134 regarding the step S204 described above.
In one possible implementation, the conversion module 132 may be specifically configured to:
judging whether parameter plug-ins corresponding to the request parameters are configured in advance for each request parameter;
if a parameter plug-in is configured, filtering the value of the request parameter according to the parameter plug-in;
and converting the filtered value according to the type of the request parameter and the parameter configuration.
In one possible implementation, the conversion module 132 may be specifically configured to implement conversion by:
detecting whether the type of the request parameter is an aggregate type or an array type, if so, traversing each element in the request parameter, converting the value of each element into a value corresponding to the type of the parameter in the parameter configuration, and packaging all the converted elements into an aggregate or an array;
if the type of the request parameter is not the set type and the array type, directly converting the value of the request parameter into a value corresponding to the type of the request parameter in the parameter configuration.
In one possible implementation, the conversion module 132 may be specifically configured to:
when the type of the request parameter is a basic type, converting the value of the request parameter into a value of a corresponding basic type in the parameter configuration;
when the type of the request parameter is a complex type, the request parameter is converted into a Map object, each key value pair in the Map object is traversed, and each value is converted into a value of a corresponding complex type in the parameter configuration.
In one possible implementation, the information configuration apparatus 130 of the internal and external system further includes an encapsulation module, where the encapsulation module may be used to:
packaging the request parameters based on the dubbo framework, and transmitting the values of the converted request parameters into the packaged request parameters;
the parsing module 133 may be used to:
and automatically analyzing the packaged request parameters by using the dubbo framework through the internal service system corresponding to the access request, and converting the values of the analyzed request parameters into corresponding parameter objects.
In a possible implementation manner, the information configuration apparatus 130 of the internal and external system further includes a construction module, which may be used for:
establishing a gateway interface between the open platform and the external system, and configuring interface information of the gateway interface;
and constructing service interfaces of the internal service systems in the open platform, and configuring interface information of the service interfaces.
In one possible implementation manner, the interface information of the gateway interface includes at least one of a unique identification name of the gateway interface, a gateway interface packet, an interface description, a system to which the gateway interface belongs, and external system access restriction information;
the interface information of each service interface comprises at least one of an address of an internal service system, an application name of the internal service system, an interface method, an interface timeout duration and a service call retry number.
In an embodiment of the present application, a computer readable storage medium is provided corresponding to the above-mentioned information configuration method of the internal and external systems, where a computer program is stored in the computer readable storage medium, and the computer program executes each step of the above-mentioned information configuration method of the internal and external systems when running.
The steps executed when the computer program runs are not described in detail herein, and reference may be made to the explanation of the method for configuring information of the internal and external systems.
In summary, the application provides an information configuration method, an information configuration device, an electronic device and a readable storage medium of an internal and external system, when an access request of an external system is received by a development platform, the development platform is matched with corresponding parameter configuration according to a request path in the access request, and the parameter configuration is configured based on a visual interface in advance. Inquiring the type of the request parameters required by the access request by traversing the matched parameter configuration, converting the values of the request parameters based on the type of each request parameter, analyzing the converted values of the request parameters through the internal service system corresponding to the access request, converting the values into corresponding parameter objects, and returning the parameter objects to the external system. In the scheme, the parameter configuration is performed on the basis of the visual interface in advance so as to be used for the subsequent request parameter conversion basis, the conversion basis can be obtained on the basis of interface operation in a configuration mode, the problem of high coupling degree of a hard coding mode is avoided, and the maintenance cost of the platform is reduced.
The foregoing is merely specific embodiments of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions easily conceivable by those skilled in the art within the technical scope of the present application should be covered in the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (9)

1. An information configuration method of an internal and external system, which is applied to an open platform, wherein the open platform is integrated with a plurality of internal service systems, the method comprising:
when an access request of an external system is received, matching corresponding parameter configuration according to a request path in the access request, wherein the parameter configuration is obtained by configuring in advance based on a visual interface;
traversing the matched parameter configuration, inquiring the type of the request parameter required by the access request, and converting the value of the request parameter based on the type of each request parameter and the parameter configuration;
analyzing the value of the converted request parameter through the internal service system corresponding to the access request, and converting the value into a corresponding parameter object;
returning the parameter object to the external system;
the step of converting the values of the request parameters based on the type of each of the request parameters and the parameter configuration includes:
and judging whether parameter plug-ins corresponding to the request parameters are configured in advance for each request parameter, wherein corresponding parameter plug-ins are configured for different internal service systems, if the parameter plug-ins are configured, the values of the request parameters are filtered according to the parameter plug-ins, and the filtered values are converted according to the types of the request parameters and the parameter configuration.
2. The information configuration method of an internal and external system according to claim 1, wherein said step of converting the value of a request parameter based on the type of each of said request parameters and said parameter configuration comprises:
detecting whether the type of the request parameter is an aggregate type or an array type, if so, traversing each element in the request parameter, converting the value of each element into a value corresponding to the type of the parameter in the parameter configuration, and packaging all the converted elements into an aggregate or an array;
if the type of the request parameter is not the set type and the array type, directly converting the value of the request parameter into a value corresponding to the type of the request parameter in the parameter configuration.
3. The method according to claim 2, wherein when the type of the request parameter is not a set type or an array type, the step of directly converting the value of the request parameter into a value corresponding to the type to which the request parameter belongs in the parameter configuration includes:
when the type of the request parameter is a basic type, converting the value of the request parameter into a value of a corresponding basic type in the parameter configuration;
when the type of the request parameter is a complex type, the request parameter is converted into a Map object, each key value pair in the Map object is traversed, and each value is converted into a value of a corresponding complex type in the parameter configuration.
4. The method for configuring information of an internal and external system according to claim 1, wherein before the step of parsing the value of the converted request parameter by the internal service system corresponding to the access request, the method further comprises:
packaging the request parameters based on the dubbo framework, and transmitting the values of the converted request parameters into the packaged request parameters;
the step of analyzing the converted value of the request parameter by the internal service system corresponding to the access request comprises the following steps:
and automatically analyzing the packaged request parameters by using the dubbo framework through the internal service system corresponding to the access request, and converting the values of the analyzed request parameters into corresponding parameter objects.
5. The information configuration method of an internal and external system according to claim 1, characterized in that the method further comprises:
establishing a gateway interface between the open platform and the external system, and configuring interface information of the gateway interface;
and constructing service interfaces of the internal service systems in the open platform, and configuring interface information of the service interfaces.
6. The method according to claim 5, wherein the interface information of the gateway interface includes at least one of a unique identifier name of the gateway interface, a gateway interface packet, an interface description, a system to which the gateway interface belongs, and external system access restriction information;
the interface information of each service interface comprises at least one of an address of an internal service system, an application name of the internal service system, an interface method, an interface timeout duration and a service call retry number.
7. An information configuration apparatus of an internal and external system, applied to an open platform, the open platform integrating a plurality of internal service systems, the apparatus comprising:
the matching module is used for matching corresponding parameter configuration according to a request path in an access request when the access request of an external system is received, wherein the parameter configuration is obtained by configuring the parameter configuration in advance based on a visual interface;
the conversion module is used for traversing the matched parameter configuration, inquiring the type of the request parameter required by the access request, and converting the value of the request parameter based on the type of each request parameter and the parameter configuration;
the analysis module is used for analyzing the value of the converted request parameter through the internal service system corresponding to the access request and converting the value into a corresponding parameter object;
the feedback module is used for returning the parameter object to the external system;
the conversion module is used for:
and judging whether parameter plug-ins corresponding to the request parameters are configured in advance for each request parameter, wherein corresponding parameter plug-ins are configured for different internal service systems, if the parameter plug-ins are configured, the values of the request parameters are filtered according to the parameter plug-ins, and the filtered values are converted according to the types of the request parameters and the parameter configuration.
8. An electronic device, comprising: a memory and a processor, wherein the memory is configured to store a computer program, and the processor is configured to execute the computer program to implement the information configuration method of the internal and external system according to any one of claims 1 to 6.
9. A computer-readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the method of configuring information of an internal and external system according to any one of claims 1 to 6.
CN202111458426.8A 2021-12-02 2021-12-02 Information configuration method and device for internal and external systems, electronic equipment and readable storage medium Active CN114116067B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111458426.8A CN114116067B (en) 2021-12-02 2021-12-02 Information configuration method and device for internal and external systems, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111458426.8A CN114116067B (en) 2021-12-02 2021-12-02 Information configuration method and device for internal and external systems, electronic equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN114116067A CN114116067A (en) 2022-03-01
CN114116067B true CN114116067B (en) 2024-02-27

Family

ID=80365287

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111458426.8A Active CN114116067B (en) 2021-12-02 2021-12-02 Information configuration method and device for internal and external systems, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN114116067B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101778124A (en) * 2009-12-22 2010-07-14 卓望数码技术(深圳)有限公司 Method for accessing Internet by mobile client end and page access server
CN106856434A (en) * 2015-12-08 2017-06-16 阿里巴巴集团控股有限公司 The method and apparatus of access request conversion
CN107770225A (en) * 2016-08-22 2018-03-06 北京京东尚科信息技术有限公司 A kind of webService accesses system and the method for accessing webService
CN109298950A (en) * 2018-08-15 2019-02-01 深圳壹账通智能科技有限公司 Enterprise Service Bus system, data processing method, terminal and storage medium
CN109298954A (en) * 2018-09-14 2019-02-01 北京数聚鑫云信息技术有限公司 A kind of intelligence calls the method and device of Dubbo remote service
CN109816347A (en) * 2019-01-16 2019-05-28 深圳市买买提信息科技有限公司 It is a kind of applied to the information processing method, system and the relevant apparatus that help loan
CN111741016A (en) * 2020-07-23 2020-10-02 南京梦饷网络科技有限公司 Method, computing device, and computer storage medium for managing application interfaces
CN112306645A (en) * 2020-12-24 2021-02-02 北京百度网讯科技有限公司 Transaction processing method, device, equipment, program and medium of Etheng virtual machine
CN112379951A (en) * 2020-11-19 2021-02-19 北京百度网讯科技有限公司 Service interface access method, device, electronic equipment and medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101778124A (en) * 2009-12-22 2010-07-14 卓望数码技术(深圳)有限公司 Method for accessing Internet by mobile client end and page access server
CN106856434A (en) * 2015-12-08 2017-06-16 阿里巴巴集团控股有限公司 The method and apparatus of access request conversion
CN107770225A (en) * 2016-08-22 2018-03-06 北京京东尚科信息技术有限公司 A kind of webService accesses system and the method for accessing webService
CN109298950A (en) * 2018-08-15 2019-02-01 深圳壹账通智能科技有限公司 Enterprise Service Bus system, data processing method, terminal and storage medium
CN109298954A (en) * 2018-09-14 2019-02-01 北京数聚鑫云信息技术有限公司 A kind of intelligence calls the method and device of Dubbo remote service
CN109816347A (en) * 2019-01-16 2019-05-28 深圳市买买提信息科技有限公司 It is a kind of applied to the information processing method, system and the relevant apparatus that help loan
CN111741016A (en) * 2020-07-23 2020-10-02 南京梦饷网络科技有限公司 Method, computing device, and computer storage medium for managing application interfaces
CN112379951A (en) * 2020-11-19 2021-02-19 北京百度网讯科技有限公司 Service interface access method, device, electronic equipment and medium
CN112306645A (en) * 2020-12-24 2021-02-02 北京百度网讯科技有限公司 Transaction processing method, device, equipment, program and medium of Etheng virtual machine

Also Published As

Publication number Publication date
CN114116067A (en) 2022-03-01

Similar Documents

Publication Publication Date Title
CN111600909B (en) Data processing method, device, protocol conversion equipment and storage medium
CN103139234B (en) A kind of device and method of data, services encapsulation
CN110601880A (en) Cloud platform, service processing method, command interface and computer equipment
CN107360261A (en) A kind of HTTP request processing method, device and electronic equipment
CN111290753A (en) Method, device, equipment and storage medium for building front-end development environment
CN112738216B (en) Equipment adaptation method, device, equipment and computer readable storage medium
CN111818158A (en) Gateway control method, device, electronic equipment and storage medium
CN115033301A (en) Equipment access method, device, equipment and storage medium of edge computing host
CN112988409A (en) Interface calling method and device, computer equipment and storage medium
CN114116067B (en) Information configuration method and device for internal and external systems, electronic equipment and readable storage medium
CN111324395B (en) Calling method, device and computer readable storage medium
US11803786B2 (en) Enterprise integration platform
CN111459819B (en) Software testing method and device, electronic equipment and computer readable medium
CN114024822A (en) Block chain-based Internet of things equipment management method, equipment, server and medium
CN112395339B (en) Intersystem data admission verification method, device, computer equipment and storage medium
CN114925120A (en) Insurance business information query method and related equipment
CN113626001A (en) API dynamic editing method and device based on script
CN113515325A (en) Software system extension plug-in application method of command word communication mode
CN109842620B (en) Service publishing method and device
CN115934305A (en) Cloud platform management method, server and computer-readable storage medium
CN114051058B (en) Interface calling method, platform, electronic equipment and computer storage medium
CN114205098B (en) Method, device, equipment and computer readable storage medium for inquiring operation authority
CN116560756B (en) Service orchestration method, electronic device, computer-readable storage medium
WO2024113273A1 (en) Verification method and apparatus for communication nodes in communication model
CN110191141B (en) Service calling information processing method and device and computer system

Legal Events

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