CN112764726B - Data synthesis method and device - Google Patents

Data synthesis method and device Download PDF

Info

Publication number
CN112764726B
CN112764726B CN201911074275.9A CN201911074275A CN112764726B CN 112764726 B CN112764726 B CN 112764726B CN 201911074275 A CN201911074275 A CN 201911074275A CN 112764726 B CN112764726 B CN 112764726B
Authority
CN
China
Prior art keywords
interface
sub
data
calling
configuration data
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
CN201911074275.9A
Other languages
Chinese (zh)
Other versions
CN112764726A (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.)
Beijing Jingdong Zhenshi Information Technology Co Ltd
Original Assignee
Beijing Jingdong Zhenshi Information 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 Beijing Jingdong Zhenshi Information Technology Co Ltd filed Critical Beijing Jingdong Zhenshi Information Technology Co Ltd
Priority to CN201911074275.9A priority Critical patent/CN112764726B/en
Publication of CN112764726A publication Critical patent/CN112764726A/en
Application granted granted Critical
Publication of CN112764726B publication Critical patent/CN112764726B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/315Object-oriented languages
    • 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)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computing Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses a data synthesis method and device, and relates to the technical field of computers. One embodiment of the method comprises the following steps: responding to a service call request, and generating a dynamic proxy class of a call interface according to an SDK software package of the call interface; the SDK software package of each sub-interface of the calling interface is realized by using the dynamic proxy class, and parameter output result data of each sub-interface is obtained; the SDK software package includes: interface configuration data, parameter entering configuration data and parameter exiting configuration data; and merging the parameter output result data of each sub-interface to obtain request data corresponding to the service call request. According to the implementation mode, request data corresponding to the service call request can be automatically synthesized according to the SDK software package of the call interface, the cross-system communication cost and repeated code development are reduced, and the realization efficiency of a service system is improved.

Description

Data synthesis method and device
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for data synthesis.
Background
With the complex and diverse service requirements, the system involved in the service is not a single system, but a plurality of systems are completed together. The implementation of the service requirement often needs to interface with a plurality of other systems, acquire relevant data of the plurality of other systems, and then adapt each acquired data to service data applicable to the service system according to the service requirement. Business system refers to the system which the product manager needs to realize according to market demand and change. Referring to fig. 1, the first system, the second system, the third system and the fourth system refer to other systems which need to be in butt joint, and provide relevant data interfaces for the service systems, and the logic relationship among the first system, the second system, the third system and the fourth system is realized by the service systems.
In the process of implementing the present invention, the inventor finds that at least the following problems exist in the prior art:
(1) The service system is low in realization efficiency, a product manager firstly grasps related services of each department of a company, then communicates with each service line product manager one by one, and finally data butt joint among systems is completed. The whole process has long time, and cannot adapt to the market demand of instant change;
(2) The system codes can not be reused, the repeated development labor is realized, and the repeated development code error rate is high.
Disclosure of Invention
In view of this, the embodiments of the present invention provide a method and an apparatus for synthesizing data, which can automatically synthesize request data corresponding to a service call request according to an SDK software package of a call interface, reduce cross-system communication cost and repeated code development, and improve implementation efficiency of a service system.
According to an aspect of an embodiment of the present invention, there is provided a method of data synthesis, including:
responding to a service call request, and generating a dynamic proxy class of a call interface according to an SDK software package of the call interface;
the SDK software package of each sub-interface of the calling interface is realized by using the dynamic proxy class, and parameter output result data of each sub-interface is obtained; the SDK software package includes: interface configuration data, parameter entering configuration data and parameter exiting configuration data;
And merging the parameter output result data of each sub-interface to obtain request data corresponding to the service call request.
Optionally, the interface configuration data includes: class name, method name, annotation;
before generating the dynamic proxy class of the calling interface according to the SDK software package of the calling interface, the method further comprises the following steps: generating interface configuration data in the SDK software package of the sub-interface according to the following steps: and generating a class name of the sub-interface according to the name of the sub-interface, generating a method name of the sub-interface according to the calling address of the sub-interface, and generating comments of the sub-interface according to the description information of the sub-interface.
Optionally, before generating the dynamic proxy class of the call interface according to the SDK software package of the call interface, the method further includes: the SDK software package of the calling interface is generated according to the following steps:
traversing from the tree root node of the calling interface, circularly recursively taking the parameter entering configuration data and the parameter exiting configuration data of all sub-interfaces of the calling interface, taking the union of the parameter entering configuration data of each sub-interface of the calling interface as the parameter entering configuration data of the calling interface, and taking the union of the parameter exiting configuration data of each sub-interface of the calling interface as the parameter exiting configuration data of the calling interface;
And generating a class name of the calling interface according to the name of the calling interface, generating a method name of the calling interface according to the calling address of the calling interface, and generating comments of the calling interface according to the description information of the calling interface.
Optionally, before generating the dynamic proxy class of the call interface according to the SDK software package of the call interface, the method further includes:
authenticating the service call request and confirming that the authentication result is legal; and/or analyzing interface parameters from the service call request, checking the interface parameters and confirming that the check passes.
Optionally, the method further comprises: when reaching the preset triggering condition, sending out alarm information; wherein,,
the preset triggering conditions comprise: acquiring that the duration of the request data corresponding to the service call request is greater than a preset duration threshold; and/or acquiring that the overtime times of the request data corresponding to the service call request are greater than a preset time threshold.
Optionally, the method further comprises: and responding to the user operation request, and querying the log of the data synthesis.
Optionally, the method further comprises: generating a data synthesis document, the data synthesis document comprising at least one of: and presetting a duration threshold according to the description information, the return field information and the dependency relationship among the sub-interfaces of each sub-interface.
According to a second aspect of an embodiment of the present invention, there is provided an apparatus for data synthesis, including: an execution module, the execution module comprising:
the response unit is used for responding to the service call request and generating a dynamic proxy class of the call interface according to the SDK software package of the call interface;
the realization unit is used for realizing the SDK software package of each sub-interface of the calling interface by using the dynamic proxy class and obtaining the parameter output result data of each sub-interface; the SDK software package includes: interface configuration data, parameter entering configuration data and parameter exiting configuration data;
and the merging unit merges the parameter output result data of each sub-interface and acquires the request data corresponding to the service call request.
Optionally, the interface configuration data includes: class name, method name, annotation;
the device also comprises a configuration module, which is used for generating interface configuration data in the SDK software package of the sub-interface according to the following steps before the response unit generates the dynamic proxy class of the calling interface according to the SDK software package of the calling interface: and generating a class name of the sub-interface according to the name of the sub-interface, generating a method name of the sub-interface according to the calling address of the sub-interface, and generating comments of the sub-interface according to the description information of the sub-interface.
Optionally, the configuration module is further configured to: before the response unit generates the dynamic proxy class of the calling interface according to the SDK software package of the calling interface, the SDK software package of the calling interface is generated according to the following steps:
traversing from the tree root node of the calling interface, circularly recursively taking the parameter entering configuration data and the parameter exiting configuration data of all sub-interfaces of the calling interface, taking the union of the parameter entering configuration data of each sub-interface of the calling interface as the parameter entering configuration data of the calling interface, and taking the union of the parameter exiting configuration data of each sub-interface of the calling interface as the parameter exiting configuration data of the calling interface;
and generating a class name of the calling interface according to the name of the calling interface, generating a method name of the calling interface according to the calling address of the calling interface, and generating comments of the calling interface according to the description information of the calling interface.
Optionally, the apparatus further comprises an authentication module for: before the response unit generates a dynamic proxy class for the calling interface from the SDK software package for the calling interface,
authenticating the service call request and confirming that the authentication result is legal; and/or analyzing interface parameters from the service call request, checking the interface parameters and confirming that the check passes.
Optionally, the device further comprises an alarm module for: when reaching the preset triggering condition, sending out alarm information; wherein,,
the preset triggering conditions comprise: acquiring that the duration of the request data corresponding to the service call request is greater than a preset duration threshold; and/or acquiring that the overtime times of the request data corresponding to the service call request are greater than a preset time threshold.
Optionally, the apparatus further comprises: and the monitoring module is used for responding to the user operation request and inquiring the log synthesized by the data.
Optionally, the apparatus further comprises a document module for: generating a data synthesis document, the data synthesis document comprising at least one of: and presetting a duration threshold according to the description information, the return field information and the dependency relationship among the sub-interfaces of each sub-interface.
According to a third aspect of an embodiment of the present invention, there is provided an electronic device for data synthesis, including:
one or more processors;
storage means for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method provided by the first aspect of the embodiments of the present invention.
According to a fourth aspect of embodiments of the present invention, there is provided a computer readable medium having stored thereon a computer program which when executed by a processor implements the method provided by the first aspect of embodiments of the present invention.
One embodiment of the above invention has the following advantages or benefits: the technical means that the SDK software package of each sub-interface of the calling interface is realized by adopting the dynamic proxy class for generating the calling interface and the dynamic proxy class to acquire the parameter output result data of each sub-interface and synthesize the parameter output result data is adopted, so that the request data corresponding to the service calling request can be automatically synthesized according to the SDK software package of the calling interface, the cross-system communication cost and repeated code development are reduced, and the realization efficiency of a service system is improved.
Further effects of the above-described non-conventional alternatives are described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of a prior art implementation of business requirements;
FIG. 2 is a schematic diagram of a method of data synthesis in an embodiment of the present invention;
FIG. 3 is a schematic diagram of the main flow of the method of data synthesis in an embodiment of the invention;
FIG. 4 is a schematic diagram of a tree structure of a call interface in an alternative embodiment of the invention;
FIG. 5 is a flow chart of a method of data synthesis in an alternative embodiment of the invention;
FIG. 6 is a schematic flow chart of a method of data synthesis in an alternative embodiment of the invention;
FIG. 7 is a schematic diagram of the main modules of an apparatus for data synthesis according to an embodiment of the present invention;
FIG. 8 is a schematic diagram of the composition of an apparatus for data synthesis in accordance with an alternative embodiment of the invention;
FIG. 9 is an exemplary system architecture diagram in which embodiments of the present invention may be applied;
fig. 10 is a schematic diagram of a computer system suitable for use in implementing an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention will now be described with reference to the accompanying drawings, in which various details of the embodiments of the present invention are included to facilitate understanding, and are to be considered merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
According to one aspect of an embodiment of the present invention, a method of data synthesis is provided. For convenience in explaining the data synthesis method of the present invention, fig. 2 is a schematic diagram showing the architecture of the data synthesis method in the embodiment of the present invention, and the synthesis device in fig. 2 refers to a device for implementing the data synthesis method in the embodiment of the present invention. As can be seen from fig. 2, the data synthesis method according to the embodiment of the present invention is applied between a service system and a called system. For each service requirement, the service system only needs to be connected with the data interface of the synthesizing device, the synthesizing device calls the called systems such as the system I, the system II, the system III, the system N and the like according to the configuration, and the data of each called system is automatically synthesized once and returned to the service requirement party.
FIG. 3 is a schematic diagram of the main flow of the method for synthesizing data in the embodiment of the present invention, as shown in FIG. 3, the method for synthesizing data includes: step S301, step S302, and step S303.
And step 301, responding to a service call request, and generating a dynamic proxy class of the call interface according to an SDK software package of the call interface.
The calling interface is an interface connected with the service system in the device for realizing the data processing method, namely an interface called by the service system for sending the service calling request.
The SDK (Software Development Kit ) package includes: interface configuration data, in-parameter configuration data, out-parameter configuration data. The SDK software package of the call interface includes: interface configuration data of the calling interface, parameter entering configuration data of the calling interface and parameter exiting configuration data of the calling interface.
The interface configuration data of the calling interface refers to sub-interface related information contained in the calling interface, such as an interface name, an interface calling address (calling addresses of different calling interfaces, such as RPC, http, etc., are different), interface description information, an exception return value, an interface type, etc. The interface type enumeration is two: a composite interface and a generic interface. The dependency relationship between the interfaces is that the composite interface can comprise a sub-composite interface and a sub-general interface (a general interface is an interface without other interfaces), the composite interfaces can be nested, but the sub-interfaces included in the composite interface are independent of each other, have no inclusion relationship, and only have dependency relationship before and after.
FIG. 4 is a schematic diagram of a tree structure of a call interface in an alternative embodiment of the invention. In the figure, the a data interface is a call interface, and the sub-interface included in the a data interface is a B, C, D, E, F data interface. The relationship of B, C, D, F data interfaces is parallel, and E data interfaces need to be executed first by relying on D data interfaces. And part or all of the returned result of the D data interface is used as the participation of the E data interface. F is a composite data interface, which is made up of other interfaces (not shown). The A data interface is represented by a tree data structure, the B C D F data interface is used as a brother node, and the E data interface is used as a sub data interface of the D data interface.
The entry configuration data and the exit configuration data of the interface are represented by metadata. Metadata contains fields for field encoding, display name, data type, example value, description, whether it can be null, etc. The data type is a data type of a development language. If developed in java (an object-oriented programming language), list, string, integer, boolean, class, etc.
Table 1 shows an example of the entry configuration data.
TABLE 1 parameter configuration data
Each of the sub-entry entries may include a plurality of sub-entries, and the sub-entries may further include sub-entries. Taking table 1 as an example, row 2 in the table represents an entry "order", the entry "product" below it is a sub-entry of the entry "order", and the three entries below the entry "product" are sub-entries of the entry "product", respectively.
The entries of the interfaces can be configured in the manner shown in table 1, respectively, and for the composite interface, the entries do not need to be configured. Then the data is directly obtained from the input parameters of the corresponding sub-interface.
The parameter entering configuration data is characterized in a code form, and can be generated according to the pre-configured parameter entering information in the actual application process.
Taking the ginseng product in table 1 as an example, the corresponding ginseng configuration data is;
Class Product{
/**
* Product name
**/
@NotEmpty
String name= "millet earphone";
/**
* Product model
**/
@NotEmpty
String symbol= "millet";
/**
* Price of product
**/
@NotEmpty
float price=50.00;
}
Taking the parameter entering user in table 1 as an example, the corresponding parameter entering configuration data is;
Class User{
/**
* Name of name
**/
@NotEmpty
String name=“zhangsan”;
/**
* Password code
**/
@NotEmpty
String password=“123456”;
}
The configuration of the outgoing parameters and the generation of corresponding outgoing parameter configuration data are similar to those of the incoming parameters, and are not described here again.
The generation rule of the SDK software package is that the input parameter and the output parameter are firstly generated, and an interface is regenerated. Optionally, the interface configuration data includes: class name, method name, annotation. Before generating the dynamic proxy class of the calling interface according to the SDK software package of the calling interface, the method further comprises the following steps: generating interface configuration data in the SDK software package of the sub-interface according to the following steps: and generating a class name of the sub-interface according to the name of the sub-interface, generating a method name of the sub-interface according to the calling address of the sub-interface, and generating comments of the sub-interface according to the description information of the sub-interface.
After the configuration of each sub-interface of the calling interface is completed, SDK software packages of each sub-interface can be generated according to the language of the corresponding system of each interface. Taking fig. 4 as an example, after the data interface B, C, D, E is configured, the system program generates the SDK software package of the subinterface data interface B, C, D, E, F according to different languages. And downloading the SDK software package of the corresponding interface by each called system, and completing the implementation class according to the sub-interface software package.
And after the SDK software packages of all the sub-interfaces of the calling interface are generated, merging to generate the SDK software packages of the synthesized calling interface. The SDK software package of the calling interface also comprises interface configuration data, parameter-in configuration data and parameter-out configuration data. Optionally, before generating the dynamic proxy class of the call interface according to the SDK software package of the call interface, the method further includes: the SDK software package of the calling interface is generated according to the following steps:
traversing from the tree root node of the calling interface, circularly recursively taking the parameter entering configuration data and the parameter exiting configuration data of all sub-interfaces of the calling interface, taking the union of the parameter entering configuration data of each sub-interface of the calling interface as the parameter entering configuration data of the calling interface, and taking the union of the parameter exiting configuration data of each sub-interface of the calling interface as the parameter exiting configuration data of the calling interface;
and generating a class name of the calling interface according to the name of the calling interface, generating a method name of the calling interface according to the calling address of the calling interface, and generating comments of the calling interface according to the description information of the calling interface.
Illustratively, taking the a data interface of fig. 4 as an example, the step of generating the SDK software package of the call interface includes:
(1) The data storage format of the input parameters defining the data interface A is as follows: the method name of each sub-interface is added with the parameter of each sub-interface. Namely: a = { B } { enter }, C } { enter }, D }, E }, F { enter };
(2) Traversing from the tree-shaped root node of the data interface A, circularly recursively taking the input parameters of all child nodes, and generating the input parameter data of the data interface A;
(3) Generating a Class name of the A data interface according to the name of the A data interface, generating a method name of the A data interface according to the address of the A data interface, and generating comments of the A interface according to the description of the A data interface;
(4) And merging and packaging the files of the A data interface generated in the steps to generate an SDK software package of the A data interface.
After the configuration of each sub-interface is completed, an SDK software package of the sub-interface is generated for the called system to download and complete. And after the configuration of the A data interface is completed, generating an SDK software package of the A data interface for the service system to use and download.
And step S302, utilizing the dynamic proxy class to realize SDK software packages of all sub-interfaces of the calling interface, and obtaining parameter output result data of each sub-interface.
Each sub-interface of the calling interface corresponds to a called system. And downloading and realizing the SDK software package of the corresponding sub-interface by each called system to obtain corresponding parameter output result data. The parameter-out result data is data in which parameter-out configuration data in the SDK package is combined with each field value obtained by executing the SDK package.
Step S303, merging the parameter output result data of each sub-interface to obtain the request data corresponding to the service call request.
The invention adopts the technical means of generating the dynamic proxy class of the calling interface and utilizing the dynamic proxy class to realize the SDK software package of each sub-interface of the calling interface to acquire the parameter output result data of each sub-interface and synthesizing, thereby automatically synthesizing the request data corresponding to the service calling request according to the SDK software package of the calling interface, reducing the cross-system communication cost and repeated code development and improving the realization efficiency of the service system. In addition, in the process of calling the called system interface, the thread Chi Yibu can be adopted for calling, so that the data synthesis efficiency is greatly improved; the data interface is transparent and convenient to use.
Optionally, before generating the dynamic proxy class of the call interface according to the SDK software package of the call interface, the method further includes: authenticating the service call request and confirming that the authentication result is legal; and/or analyzing interface parameters from the service call request, checking the interface parameters and confirming that the check passes.
Authentication refers to determining the consistency of a data signature when a service system sends a service call request and a digital signature generated according to a key of the service system and the received service call request. When the assessment results are consistent, the authentication results are legal; otherwise, the authentication result is illegal. In an alternative embodiment, the service requirement user (i.e., the service system) is provided with an interface registration service of the web management end. The specific flow can be as follows: first, after the user has the user name and password of the synthesizing device (the user name and password is not registered), the public data interface can be selected for application operation, including filling in project names, project descriptions, validity periods, project managers, mails and the like. And secondly, after the user submits the application, the synthesizing device sends a mail to an administrator, and the administrator agrees or disagrees to send a mail reminder to the project manager of the user. Third, if the administrator agrees, the mail content will contain Token, secret key, etc. The user registration procedure ends. After the service system is registered, signing the validity period and the request data sent by the service call request according to the information such as Token, secretKey granted during registration, and the data Hmac (Hash-based Message Authentication Code, hash message authentication code). When the call interface is requested to be called, the signature is generated by acquiring Token, secretKey and other information according to the user ID. And comparing whether the signatures are consistent or not, and if so, judging that the signatures are legal.
Checking the interface parameters refers to checking whether the service call request contains all the access parameters required by the call interface. If so, confirming that the verification passes; otherwise, the verification is not passed. And when the verification fails, returning error result information to the service system.
Taking fig. 4 as an example, when the service system starts to call the a data interface, as shown in fig. 5, the synthesizing device first generates a dynamic proxy class of the a data interface, and the dynamic proxy class executes the background service logic, that is, calls B, C, D, E the data interface. The business logic is as shown in fig. 6, and comprises:
(1) When the authentication is legal, checking the request data analyzed from the service call request according to the call interface parameter entering request, and when the check fails, stopping logic from continuing downwards, and returning error result information;
(2) Setting an initialized value N, wherein the value N is equal to the number of primary child nodes of a tree data structure of an A data interface;
(3) Creating an initialization thread pool, wherein the number of threads is the number of system CPUs;
(4) Creating a task for each primary child node of the A data interface to call the corresponding interface;
(5) If the interfaces have a precedence dependency relationship, the parent interface is executed first, and then the child interface is executed. For example, the task interface D is executed first, and then the interface E is executed;
(6) When each task execution ends, the count is decremented by 1 until n=0, and the a data interface call is considered to end, and the call result set is merged back.
(7) If the sub-interface is a composite interface, e.g. F, then a recursive call service logic is required to repeat the process of steps 1 to 6.
Optionally, the method further comprises: when reaching the preset triggering condition, sending out alarm information; the preset triggering conditions comprise: acquiring that the duration of the request data corresponding to the service call request is greater than a preset duration threshold; and/or acquiring that the overtime times of the request data corresponding to the service call request are greater than a preset time threshold.
The time-to-time threshold may be selectively determined based on the actual situation, for example, set to the maximum value of the time that each sub-interface of the calling interface is allowed to timeout. Taking fig. 4 as an example, T (a) =max (T (B) T (C) (T (D) +t (E)) T (F)), and T represents time.
Optionally, the method further comprises: and responding to the user operation request, and querying the log of the data synthesis. By providing the log query function, the data return condition, the calling times and the failure times of the interface can be monitored each time. When the service system calls the synthesized interface each time, the client generates a unique identifier with a time stamp, and the synthesizing device transmits the unique identifier to the interface of each called system to inquire the data return condition of each interface according to the unique identifier, including the data return condition of the sub-synthesized interface F.
Optionally, the method further comprises: generating a data synthesis document, the data synthesis document comprising at least one of: and presetting a duration threshold according to the description information, the return field information and the dependency relationship among the sub-interfaces of each sub-interface. The step of generating the data composite document may be performed after responding to the service call request and transmitting the generated composite document to the service system together with the composite request data, or may be performed as required in conjunction with a query request operation of the service system or the user. The content of the document may include not only the interface functions, return field information, but also interface dependency order relationships, timeout periods, etc. If the generated document can not accurately express the description information of the synthesizing device, the operation and maintenance personnel can edit the document manually and then issue the document.
According to a second aspect of an embodiment of the present invention, there is provided an apparatus for implementing the above method.
Fig. 7 is a schematic diagram of main modules of an apparatus for data synthesis according to an embodiment of the present invention. As shown in fig. 7, the data synthesis apparatus 700 includes: an execution module, the execution module comprising:
a response unit 701, responding to a service call request, and generating a dynamic proxy class of the call interface according to an SDK software package of the call interface;
The implementation unit 702 is configured to obtain parameter output result data of each sub-interface by using the SDK software package of each sub-interface of the calling interface; the SDK software package includes: interface configuration data, parameter entering configuration data and parameter exiting configuration data;
and a merging unit 703, configured to merge the parameter output result data of each sub-interface, and obtain request data corresponding to the service call request.
Optionally, the sub-interface includes: a sub-composition interface and a sub-generic interface.
Optionally, the interface configuration data includes: class name, method name, annotation;
the device also comprises a configuration module, which is used for generating interface configuration data in the SDK software package of the sub-interface according to the following steps before the response unit generates the dynamic proxy class of the calling interface according to the SDK software package of the calling interface: and generating a class name of the sub-interface according to the name of the sub-interface, generating a method name of the sub-interface according to the calling address of the sub-interface, and generating comments of the sub-interface according to the description information of the sub-interface.
Optionally, the configuration module is further configured to: before the response unit generates the dynamic proxy class of the calling interface according to the SDK software package of the calling interface, the SDK software package of the calling interface is generated according to the following steps:
Traversing from the tree root node of the calling interface, circularly recursively taking the parameter entering configuration data and the parameter exiting configuration data of all sub-interfaces of the calling interface, taking the union of the parameter entering configuration data of each sub-interface of the calling interface as the parameter entering configuration data of the calling interface, and taking the union of the parameter exiting configuration data of each sub-interface of the calling interface as the parameter exiting configuration data of the calling interface;
and generating a class name of the calling interface according to the name of the calling interface, generating a method name of the calling interface according to the calling address of the calling interface, and generating comments of the calling interface according to the description information of the calling interface.
Optionally, the apparatus further comprises an authentication module for: before the response unit generates a dynamic proxy class for the calling interface from the SDK software package for the calling interface,
authenticating the service call request and confirming that the authentication result is legal; and/or analyzing interface parameters from the service call request, checking the interface parameters and confirming that the check passes.
Optionally, the device further comprises an alarm module for: when reaching the preset triggering condition, sending out alarm information; wherein,,
The preset triggering conditions comprise: acquiring that the duration of the request data corresponding to the service call request is greater than a preset duration threshold; and/or acquiring that the overtime times of the request data corresponding to the service call request are greater than a preset time threshold.
Optionally, the apparatus further comprises: and the monitoring module is used for responding to the user operation request and inquiring the log synthesized by the data.
Optionally, the apparatus further comprises a document module for: generating a data synthesis document, the data synthesis document comprising at least one of: and presetting a duration threshold according to the description information, the return field information and the dependency relationship among the sub-interfaces of each sub-interface.
Fig. 8 is a schematic diagram showing the composition of an apparatus for data synthesis according to an alternative embodiment of the present invention. As shown in fig. 8, the apparatus for data synthesis includes three functional parts, operation, execution and operation and maintenance, respectively.
1. And the operation part comprises a registration module, a configuration module and a downloading module.
And a registration module: an interface registration service of a web management end is provided for a service requirement user (namely a service system). The specific flow can be as follows: first, after the user has the user name and password of the synthesizing device (the user name and password is not registered), the public data interface can be selected for application operation, including filling in project names, project descriptions, validity periods, project managers, mails and the like. And secondly, after the user submits the application, the synthesizing device sends a mail to an administrator, and the administrator agrees or disagrees to send a mail reminder to the project manager of the user. Third, if the administrator agrees, the mail content will contain Token, secretKey and other information. The user registration procedure ends.
And (3) a configuration module: for maintaining configuration data, comprising: interface name, interface call address (different call interfaces, such as RPC, http, etc. investigation addresses are different), interface description information, out-of-parameters, in-parameters, exception return values, data interface types, interface dependencies, etc. For specific description, please refer to the description of the method of the present invention, and details are not repeated here.
And (3) a downloading module: after the configuration of each sub-interface is completed, generating an SDK software package of the sub-interface for the called system to download and complete; and generating an SDK software package of the calling interface for the service system to use and download after the calling interface is configured.
2. The execution part comprises an authentication module, an execution module and an alarm module.
For specific description, please refer to the description of the method of the present invention, and details are not repeated here.
3. And the operation and maintenance part comprises a monitoring module and a document module.
For specific description, please refer to the description of the method of the present invention, and details are not repeated here.
The device has the following beneficial effects:
(1) The service side product manager can use the service side product manager only by knowing the related documents according to the exposed interface of the synthesis device and performing registration authorization. The business system is built without interaction with each other system.
(2) The interface relation configuration of the synthesizer call is flexible, the interfaces are not only parallel, but also support front-back dependence, recursion nested call and powerful functions.
(3) The functions are rich, including functions such as early warning, control, when the problem appears, can supply to trace back the investigation.
(4) The security is good, the use security can be guaranteed after registration and authorization, and meanwhile, the management of access users is convenient.
According to a third aspect of an embodiment of the present invention, there is provided an electronic device for data synthesis, including:
one or more processors;
storage means for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method provided by the first aspect of the embodiments of the present invention.
According to a fourth aspect of embodiments of the present invention, there is provided a computer readable medium having stored thereon a computer program which when executed by a processor implements the method provided by the first aspect of embodiments of the present invention.
Fig. 9 illustrates an exemplary system architecture 900 of a data synthesis method or apparatus to which embodiments of the present invention may be applied.
As shown in fig. 9, system architecture 900 may include terminal devices 901, 902, 903, a network 904, and a server 905. The network 904 is the medium used to provide communications links between the terminal devices 901, 902, 903 and the server 905. The network 904 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
A user may interact with the server 905 over the network 904 using the terminal devices 901, 902, 903 to receive or send messages, etc. Various communication client applications may be installed on the terminal devices 901, 902, 903, such as shopping class applications, web browser applications, search class applications, instant messaging tools, mailbox clients, social platform software, and the like (by way of example only).
Terminal devices 901, 902, 903 may be a variety of electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop and desktop computers, and the like.
The server 905 may be a server that provides various services, such as a background management server (by way of example only) that provides support for shopping-type websites browsed by users using terminal devices 901, 902, 903. The background management server may analyze and process the received data such as the product information query request, and feedback the processing result (e.g., the target push information, the product information—only an example) to the terminal device.
It should be noted that, the method for synthesizing data provided in the embodiment of the present invention is generally executed by the server 905, and accordingly, the device for synthesizing data is generally disposed in the server X05.
It should be understood that the number of terminal devices, networks and servers in fig. 9 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 10, there is illustrated a schematic diagram of a computer system 1000 suitable for use in implementing an embodiment of the present invention. The terminal device shown in fig. 10 is only an example, and should not impose any limitation on the functions and the scope of use of the embodiment of the present invention.
As shown in fig. 10, the computer system 1000 includes a Central Processing Unit (CPU) 1001, which can execute various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 1002 or a program loaded from a storage section 1008 into a Random Access Memory (RAM) 1003. In the RAM 1003, various programs and data required for the operation of the system 1000 are also stored. The CPU 1001, ROM 1002, and RAM 1003 are connected to each other by a bus 1004. An input/output (I/O) interface 1005 is also connected to bus 1004.
The following components are connected to the I/O interface 1005: an input section 1006 including a keyboard, a mouse, and the like; an output portion 1007 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), etc., and a speaker, etc.; a storage portion 1008 including a hard disk or the like; and a communication section 1009 including a network interface card such as a LAN card, a modem, or the like. The communication section 1009 performs communication processing via a network such as the internet. The drive 1010 is also connected to the I/O interface 1005 as needed. A removable medium 1011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like, is installed as needed in the drive 1010, so that a computer program read out therefrom is installed as needed in the storage section 1008.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication portion 1009, and/or installed from the removable medium 1011. The above-described functions defined in the system of the present invention are performed when the computer program is executed by a Central Processing Unit (CPU) 1001.
The computer readable medium shown in the present invention may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units or modules involved in the embodiments of the present invention may be implemented in software or in hardware. The described units or modules may also be provided in a processor, for example, as: a processor comprising: the response unit is used for responding to the service call request and generating a dynamic proxy class of the call interface according to the SDK software package of the call interface; the realization unit is used for realizing the SDK software package of each sub-interface of the calling interface by using the dynamic proxy class and obtaining the parameter output result data of each sub-interface; the SDK software package includes: interface configuration data, parameter entering configuration data and parameter exiting configuration data; and the merging unit merges the parameter output result data of each sub-interface and acquires the request data corresponding to the service call request. Where the names of these units or modules do not in some way constitute a limitation of the unit or module itself, for example, a response unit may also be described as "a unit of an SDK software package implementing the respective sub-interfaces of the call interface with the dynamic proxy class".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be present alone without being fitted into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to include: responding to a service call request, and generating a dynamic proxy class of a call interface according to an SDK software package of the call interface; the SDK software package of each sub-interface of the calling interface is realized by using the dynamic proxy class, and parameter output result data of each sub-interface is obtained; the SDK software package includes: interface configuration data, parameter entering configuration data and parameter exiting configuration data; and merging the parameter output result data of each sub-interface to obtain request data corresponding to the service call request.
According to the technical scheme of the embodiment of the invention, the technical means that the SDK software package of each sub-interface of the calling interface is obtained by adopting the dynamic proxy class for generating the calling interface and utilizing the dynamic proxy class to realize the SDK software package of each sub-interface so as to obtain the parameter output result data of each sub-interface and synthesize the parameter output result data can be adopted, so that the request data corresponding to the service calling request can be automatically synthesized according to the SDK software package of the calling interface, the cross-system communication cost and repeated code development are reduced, and the realization efficiency of a service system is improved.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives can occur depending upon design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (10)

1. A method of data synthesis, comprising:
responding to a service call request, and generating a dynamic proxy class of a call interface according to an SDK software package of the call interface;
the SDK software package of each sub-interface of the calling interface is realized by using the dynamic proxy class, and parameter output result data of each sub-interface is obtained; the SDK software package includes: interface configuration data, parameter entering configuration data and parameter exiting configuration data;
combining the parameter output result data of each sub-interface to obtain request data corresponding to the service call request;
the method further comprises the steps of: before generating the dynamic proxy class of the calling interface according to the SDK software package of the calling interface, generating the parameter entering configuration data and the parameter exiting configuration data of the SDK software package of the calling interface according to the following steps: traversing from the tree root node of the calling interface, circularly recursively taking the parameter entering configuration data and the parameter exiting configuration data of all sub-interfaces of the calling interface, taking the union of the parameter entering configuration data of each sub-interface of the calling interface as the parameter entering configuration data of the calling interface, and taking the union of the parameter exiting configuration data of each sub-interface of the calling interface as the parameter exiting configuration data of the calling interface.
2. The method of claim 1, wherein the interface configuration data comprises: class name, method name, annotation;
before generating the dynamic proxy class of the calling interface according to the SDK software package of the calling interface, the method further comprises the following steps: generating interface configuration data in the SDK software package of the sub-interface according to the following steps: and generating a class name of the sub-interface according to the name of the sub-interface, generating a method name of the sub-interface according to the calling address of the sub-interface, and generating comments of the sub-interface according to the description information of the sub-interface.
3. The method of claim 2, further comprising, prior to generating the dynamic proxy class for the calling interface from the SDK software package for the calling interface: generating interface configuration data of the SDK software package of the calling interface according to the following steps:
and generating a class name of the calling interface according to the name of the calling interface, generating a method name of the calling interface according to the calling address of the calling interface, and generating comments of the calling interface according to the description information of the calling interface.
4. The method of claim 1, further comprising, prior to generating the dynamic proxy class for the calling interface from the SDK software package for the calling interface:
Authenticating the service call request and confirming that the authentication result is legal; and/or analyzing interface parameters from the service call request, checking the interface parameters and confirming that the check passes.
5. The method as recited in claim 1, further comprising: when reaching the preset triggering condition, sending out alarm information; wherein,,
the preset triggering conditions comprise: acquiring that the duration of the request data corresponding to the service call request is greater than a preset duration threshold; and/or acquiring that the overtime times of the request data corresponding to the service call request are greater than a preset time threshold.
6. The method as recited in claim 1, further comprising: and responding to the user operation request, and querying the log of the data synthesis.
7. The method as recited in claim 1, further comprising: generating a data synthesis document, the data synthesis document comprising at least one of: and presetting a duration threshold according to the description information, the return field information and the dependency relationship among the sub-interfaces of each sub-interface.
8. An apparatus for data synthesis, comprising: an execution module, the execution module comprising:
The response unit is used for responding to the service call request and generating a dynamic proxy class of the call interface according to the SDK software package of the call interface;
the realization unit is used for realizing the SDK software package of each sub-interface of the calling interface by using the dynamic proxy class and obtaining the parameter output result data of each sub-interface; the SDK software package includes: interface configuration data, parameter entering configuration data and parameter exiting configuration data;
the merging unit merges the parameter output result data of each sub-interface and acquires request data corresponding to the service call request;
the apparatus further comprises a configuration module for: before generating the dynamic proxy class of the calling interface according to the SDK software package of the calling interface, generating the parameter entering configuration data and the parameter exiting configuration data of the SDK software package of the calling interface according to the following steps: traversing from the tree root node of the calling interface, circularly recursively taking the parameter entering configuration data and the parameter exiting configuration data of all sub-interfaces of the calling interface, taking the union of the parameter entering configuration data of each sub-interface of the calling interface as the parameter entering configuration data of the calling interface, and taking the union of the parameter exiting configuration data of each sub-interface of the calling interface as the parameter exiting configuration data of the calling interface.
9. An electronic device for data synthesis, comprising:
one or more processors;
storage means for storing one or more programs,
when executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1-7.
10. A computer readable medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any of claims 1-7.
CN201911074275.9A 2019-11-04 2019-11-04 Data synthesis method and device Active CN112764726B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911074275.9A CN112764726B (en) 2019-11-04 2019-11-04 Data synthesis method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911074275.9A CN112764726B (en) 2019-11-04 2019-11-04 Data synthesis method and device

Publications (2)

Publication Number Publication Date
CN112764726A CN112764726A (en) 2021-05-07
CN112764726B true CN112764726B (en) 2023-09-01

Family

ID=75692968

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911074275.9A Active CN112764726B (en) 2019-11-04 2019-11-04 Data synthesis method and device

Country Status (1)

Country Link
CN (1) CN112764726B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113204396A (en) * 2021-05-21 2021-08-03 珠海金山网络游戏科技有限公司 Service processing system, method and device
CN113472687B (en) * 2021-07-15 2023-12-05 北京京东振世信息技术有限公司 Data processing method and device
CN114296823A (en) * 2021-12-29 2022-04-08 深圳市华宇讯科技有限公司 Information processing method and device for decoupling between service modules
CN115174683B (en) * 2022-06-29 2023-10-13 广州鲁邦通智能科技有限公司 Request method and system for calling query interface

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101354758A (en) * 2007-07-25 2009-01-28 中国科学院软件研究所 System and method for integrating real-time data and relationship data
CN107888631A (en) * 2016-09-28 2018-04-06 北京京东尚科信息技术有限公司 A kind of interface interchange method and apparatus of configurable combination
CN108958711A (en) * 2017-05-22 2018-12-07 北京京东尚科信息技术有限公司 A kind of implementation method and device of interface platform
CN109344642A (en) * 2018-08-31 2019-02-15 平安科技(深圳)有限公司 Interface rules method of calibration, device, computer equipment and storage medium
CN110389976A (en) * 2018-04-13 2019-10-29 北京京东尚科信息技术有限公司 A kind of dispatching method and device of multi-interface data

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7032014B2 (en) * 2002-01-18 2006-04-18 Sun Microsystems, Inc. Service management system for configuration information

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101354758A (en) * 2007-07-25 2009-01-28 中国科学院软件研究所 System and method for integrating real-time data and relationship data
CN107888631A (en) * 2016-09-28 2018-04-06 北京京东尚科信息技术有限公司 A kind of interface interchange method and apparatus of configurable combination
CN108958711A (en) * 2017-05-22 2018-12-07 北京京东尚科信息技术有限公司 A kind of implementation method and device of interface platform
CN110389976A (en) * 2018-04-13 2019-10-29 北京京东尚科信息技术有限公司 A kind of dispatching method and device of multi-interface data
CN109344642A (en) * 2018-08-31 2019-02-15 平安科技(深圳)有限公司 Interface rules method of calibration, device, computer equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
周敏等.基于MVC+MSSQL+EF的软件平台接口管理系统的设计与实现.计算机应用与软件.2017,第34 卷(第10期),全文. *

Also Published As

Publication number Publication date
CN112764726A (en) 2021-05-07

Similar Documents

Publication Publication Date Title
CN112764726B (en) Data synthesis method and device
US11340961B2 (en) Dynamically integrating a client application with third-party services
US11134071B2 (en) Data exchange during multi factor authentication
US20190082026A1 (en) Interface invocation method and apparatus for hybrid cloud
CN106101258B (en) Interface calling method, device and system of hybrid cloud
US10630671B2 (en) Dynamic web services server
US20100154041A1 (en) Transforming claim based identities to credential based identities
CN107888656B (en) Calling method and calling device of server-side interface
US11368447B2 (en) Oauth2 SAML token service
US8782397B2 (en) Compact attribute for cryptographically protected messages
CN110839004A (en) Method and device for access authentication
US9686266B2 (en) Utilizing X.509 authentication for single sign-on between disparate servers
CN112039826A (en) Login method and device applied to applet terminal
US20200111487A1 (en) Voice capable api gateway
US11411812B2 (en) Dynamic service creation for microservice-based integration service
CN114979295B (en) Gateway management method and device
CN115396180A (en) Micro service gateway unified authentication method, device, micro service gateway and storage medium
CN108768928A (en) A kind of information acquisition method, terminal and server
CN113778499B (en) Method, apparatus, device and computer readable medium for publishing services
CN117407195A (en) Interface system, integration method and device of application system and third party system
CN116244682A (en) Database access method, device, equipment and storage medium
KR102651156B1 (en) Transaction check notification methods and gateways, electronic devices, readable media, and computer program products
CN111258778B (en) Security management platform access management receiving method, security management platform access management sending method and security management system
CN110765445A (en) Method and device for processing request
CN117978445A (en) Method and system for authentication control processing based on gateway

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