CN115080274A - Service processing method, device and system and interface mapping system - Google Patents

Service processing method, device and system and interface mapping system Download PDF

Info

Publication number
CN115080274A
CN115080274A CN202210800862.7A CN202210800862A CN115080274A CN 115080274 A CN115080274 A CN 115080274A CN 202210800862 A CN202210800862 A CN 202210800862A CN 115080274 A CN115080274 A CN 115080274A
Authority
CN
China
Prior art keywords
interface
service
target
request
name
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210800862.7A
Other languages
Chinese (zh)
Inventor
杨旭东
银涛
吴红光
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Tuoxian Technology Co Ltd
Original Assignee
Beijing Jingdong Tuoxian 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 Tuoxian Technology Co Ltd filed Critical Beijing Jingdong Tuoxian Technology Co Ltd
Priority to CN202210800862.7A priority Critical patent/CN115080274A/en
Publication of CN115080274A publication Critical patent/CN115080274A/en
Pending legal-status Critical Current

Links

Images

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/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/541Interprogram communication via adapters, e.g. between incompatible applications
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/44Program or device authentication
    • 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/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4482Procedural
    • G06F9/4484Executing subprograms
    • 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/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • 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/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services

Abstract

The invention discloses a service processing method, a service processing device, a service processing system and an interface mapping system, and relates to the technical field of computers. One embodiment of the method comprises: determining a target calling party identifier, an interface full-qualified name and a request parameter according to a received service request; judging whether an open point logic implementation class corresponding to the interface full-restriction name is loaded in a target virtual machine corresponding to the target calling party identifier; and under the condition that the open point logic implementation class corresponding to the fully qualified interface name is loaded in the target virtual machine, executing the open point logic implementation class in the target virtual machine according to the request parameter, and generating a response result corresponding to the service request. The implementation mode can support the expansion of the interface more flexibly, delivers the customizable content to a specific caller, avoids the repeated development of the interface to a greater extent, is convenient for code maintenance and improves the production efficiency.

Description

Service processing method, device and system and interface mapping system
Technical Field
The present invention relates to the field of application development technologies, and in particular, to a method, an apparatus, and a system for processing a service, and an interface mapping system.
Background
For a large system, the same backend service can support multiple invocations, for example, a backend service simultaneously supports an enterprise service APP, an enterprise service H5, an enterprise health APP, and an internet hospital, where some services are similar but different. If these business logic are implemented in hard coding, it can make the code lengthy and difficult to maintain.
Disclosure of Invention
In view of this, embodiments of the present invention provide a service processing method, an apparatus and a system, and an interface mapping system, where an openpoint logic implementation class corresponding to a full interface definition name is loaded in a target virtual machine, and the openpoint logic implementation class in the target virtual machine is executed according to a request parameter, so that expansion of an interface can be supported more flexibly, customizable contents are handed to a specific caller, repeated development of the interface is avoided to a greater extent, code maintenance is facilitated, and production efficiency is improved.
In order to achieve the above object, according to an aspect of an embodiment of the present invention, a service processing method is provided, including:
determining a target calling party identifier, a fully qualified interface name and request parameters according to the received service request;
judging whether an open point logic implementation class corresponding to the interface full-restriction name is loaded in a target virtual machine corresponding to the target calling party identifier;
and under the condition that the open point logic implementation class corresponding to the fully qualified interface name is loaded in the target virtual machine, executing the open point logic implementation class in the target virtual machine according to the request parameter, and generating a response result corresponding to the service request.
Optionally, before determining whether the open point logic implementation class corresponding to the fully qualified interface name is loaded in the target virtual machine corresponding to the target caller id, the method further includes: in response to receiving an open point logic implementation class implemented by the target caller based on the open point interface protocol, loading the open point logic implementation class into the target virtual machine; the open point interface protocol is set for the interface in advance.
Optionally, the open point interface protocol includes a caller identification method, and at least one of: a sorting rule method, a call-back interface method, a service logic method and an extension method.
Optionally, the service request is generated by: analyzing the target calling party identification, the method name and the version number from the calling request sent by the target calling party, determining the service system interface information corresponding to the method name and the version number according to the interface details which are input in advance, and sending a service request to the service system which is generated according to the target calling party identification and the service system interface information.
According to a second aspect of the embodiments of the present invention, there is provided a service processing apparatus, including:
the service request receiving module is used for determining a target calling party identifier, an interface full-limited name and a request parameter according to the received service request;
the service logic judgment module is used for judging whether an open point logic realization class corresponding to the interface full-restriction name is loaded in the target virtual machine corresponding to the target calling party identifier;
and the service logic execution module is used for executing the open point logic implementation class in the target virtual machine according to the request parameter under the condition that the open point logic implementation class corresponding to the interface full-restriction name is loaded in the target virtual machine, and generating a response result corresponding to the service request.
Optionally, the apparatus further comprises a logic definition module configured to: in response to receiving an open point logic implementation class implemented by the target caller based on the open point interface protocol, loading the open point logic implementation class into the target virtual machine; the open point interface protocol is preset for the interface.
Optionally, the open point interface protocol includes a caller identification method, and at least one of: a sorting rule method, a call-back interface method, a service logic method and an extension method.
According to a third aspect of the embodiments of the present invention, there is provided an interface mapping system, including:
the call request receiving module receives a call request sent by a target caller and analyzes a target caller identification, a method name and a version number from the call request;
the interface information determining module is used for determining the service system interface information corresponding to the method name and the version number according to the interface details which are input in advance;
and a service request generation module, configured to generate a service request according to the target caller id and the service system interface information, and initiate the service request to a service processing apparatus provided in the second aspect of the embodiment of the present invention.
Optionally, the interface mapping system according to the embodiment of the present invention further includes a call request statistics module, configured to at least one of:
intercepting the call request under the condition that the target calling party identification exists in a preset first calling party list or a preset second calling party list;
intercepting the call request or triggering a preset alarm strategy under the condition that the number of times of the call request sent by the target caller exceeds a preset number threshold;
and authenticating the target calling party, and intercepting the calling request under the condition that the authentication is not passed.
According to a fourth aspect of the embodiments of the present invention, there is provided a service processing system, including a service processing apparatus and an interface mapping system; wherein the content of the first and second substances,
the interface mapping system receives a calling request sent by a target calling party, analyzes a target calling party identifier, a method name and a version number from the calling request, determines service system interface information corresponding to the method name and the version number according to interface details input in advance, generates a service request according to the target calling party identifier and the service system interface information, and sends the service request to the service processing device;
the service processing device determines a target caller identification, a fully qualified interface name and a request parameter according to a received service request, judges whether an open point logic implementation class corresponding to the fully qualified interface name is loaded in a target virtual machine corresponding to the target caller identification, executes the open point logic implementation class in the target virtual machine according to the request parameter under the condition that the open point logic implementation class corresponding to the fully qualified interface name is loaded in the target virtual machine, and generates a response result corresponding to the service request;
and the service processing device returns the response result to the interface mapping system, and the interface mapping system returns the response result to the target caller.
According to a fifth aspect of the embodiments of the present invention, there is provided an electronic device for service processing, including:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the method provided by the first aspect of the embodiments of the present invention.
According to a sixth aspect of embodiments of the present invention, there is provided a computer readable medium, on which a computer program is stored, 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: under the condition that the open point logic implementation class corresponding to the fully-defined name of the interface is loaded in the target virtual machine, the open point logic implementation class in the target virtual machine is executed according to the request parameters, so that the expansion of the interface can be supported more flexibly, customizable contents are given to a specific caller, the repeated development of the interface is avoided to a greater extent, the code maintenance is facilitated, and the production efficiency is improved. The embodiment of the invention realizes the communication between the calling party and the server by adopting the interface mapping system, can realize the decoupling of version mapping logic and a service system, and reduces the complexity of the service system; the multi-calling party is deployed for use at one time, and the version mapping system is extracted out for the access of the multi-service system and the multi-calling party, so that the production efficiency is improved; the original service is not influenced, the service system can be seamlessly accessed, and the compatibility of the system is ensured; the dynamic horizontal extension is supported, and the performance of the system is ensured; the interface version can be flexibly configured to take effect in real time, so that the elasticity of the system is increased; the multi-protocol calling is supported, and the calling party is unaware, so that the docking efficiency of the calling party is improved.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
fig. 1 is a schematic diagram of a main flow of a service processing method according to an embodiment of the present invention;
FIG. 2 is a flow diagram illustrating an implementation of an open point logic implementation class in an alternative embodiment of the invention;
FIG. 3 is a schematic diagram of an open point interface protocol in an alternative embodiment of the invention;
fig. 4 is a schematic diagram of an architecture of a service processing method in an alternative embodiment of the present invention;
FIG. 5 is a diagram of an interface version number mapping table in an alternative embodiment of the invention;
FIG. 6 is a schematic diagram of the main flow of interface mapping in an alternative embodiment of the invention;
fig. 7 is a schematic diagram of a main flow of a service processing method in an alternative embodiment of the present invention;
fig. 8 is a schematic diagram of main modules of a service processing apparatus according to an embodiment of the present invention;
FIG. 9 is a schematic diagram of the major modules of an interface mapping system of an embodiment of the present invention;
FIG. 10 is a schematic diagram of the principal components of a business processing system of an embodiment of the invention;
FIG. 11 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 12 is a schematic structural diagram of a computer system suitable for implementing a terminal device or a server according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
For a large system, the same backend service may support multiple invoker calls, with some services being very similar but distinct. For example, a backend service simultaneously supports enterprise business APPs, enterprise business H5, enterprise health APPs, and internet hospitals, some of which are similar but distinct, and if implemented by hard coding, make the code long and difficult to maintain. The embodiment of the invention supports the scenes with the same service and different processes through the open points.
Illustratively, the business system provides a family doctor service, and the process of inquiring the family doctor (also called family doctor, a personalized health care service) service which a user has signed up is as follows: acquiring a medical service package (including an activation state and a service package type) of a current user through a user ID; inquiring the signing state of the current service package; inquiring the signed doctor team information of the current service pack; inquiring the housekeeping information of the contracted doctor of the current service pack; inquiring the IM message information nearest to the current service package. Wherein:
the business process of the enterprise business APP is as follows: fifthly, after the inquiry in the step one is finished, filtering is needed to be carried out, only activated service packages are reserved, and the inactivated service packages are not displayed, so that the process is changed into the step one;
the business process of the enterprise health APP is as follows: fifthly, the difference from the business is that the enterprise health APP does not need to be filtered and activated, and newly-added inquiry time information is needed after the doctor information is obtained;
the business process of the internet hospital is as follows: firstly, a service pack of a mutual medical type is filtered, secondly, a corresponding department is obtained according to doctor information, and thirdly, the process has one more filtering and one additional information obtaining in the original service.
The logic of the bottom layer of the corresponding home medical service of different calling parties is not changed, if the filtering of the service package and the additional information of the doctor data can be used as two open points to be realized by the corresponding calling parties, the home medical only provides basic capabilities of the third step and the fifth step, so that the different calling parties can find the logic realization class of the open points and return customized result information after the logic realization class of the open points is executed.
In view of this, according to an aspect of the embodiments of the present invention, a method for processing a service is provided.
Fig. 1 is a schematic diagram of a main flow of a service processing method according to an embodiment of the present invention, and as shown in fig. 1, the service processing method includes step S101, step S102, and step S103.
And step S101, determining a target calling party identifier, an interface full-restriction name and a request parameter according to the received service request.
The caller is a system which is used for calling the service system, and the caller identification is used for uniquely representing one caller. The caller identification may be a system identification, such as an application program (APP) identification, or an identification of the user of the system. In the actual application process, the caller id and the system id may also be used as the caller id, for example, the system user D corresponds to four applications (the corresponding application ids are APP1, APP2, APP3, and APP4), and the corresponding caller ids may be D-APP1, D-APP2, D-APP3, and D-APP4, respectively.
The fully qualified interface name includes the class name and method name of the interface. The request parameter refers to data that the service interface of the service system requires to transmit, namely, the input parameter of the service interface, and the data returned by the service interface becomes the output parameter. Illustratively, the personal information of the employee is queried by name, the attendee is the name, and the attendee is the personal information.
Step S102, judging whether the target virtual machine corresponding to the target calling party identification is loaded with an open point logic implementation class corresponding to the interface full-restriction name.
The open point is a functional point supporting the calling party to realize, and the calling party configures the class name of the open point after realizing and issuing. In the embodiment of the invention, an open point is realized by using an SPI (Service Provider Interface, a set of interfaces used for being realized or expanded by a third party and used for starting frame expansion and replacing components). In the actual application process, some interfaces can be defined as open points according to actual situations. An implementation class is for an interface and refers to the content agreed in implementing the interface. The open point logic implementation class refers to a service execution rule or a related program code capable of implementing caller self-defined logic. Before judging whether the target virtual machine corresponding to the target caller identification is loaded with the open point logic implementation class corresponding to the interface full-definition name, if the interface is defined as an open point and the open point logic implementation class realized by the target caller is uploaded to a service system, the embodiment of the invention can directly load the corresponding open point logic implementation class. Before judging whether the target virtual machine corresponding to the target caller identification is loaded with the open point logic implementation class corresponding to the interface full-definition name, if the interface is defined as an open point, but the open point logic implementation class realized by the target caller is not uploaded to a service system or the target caller intends to update the open point logic implementation class, the open point logic implementation class can be loaded into the target virtual machine in response to receiving the open point logic implementation class realized by the target caller.
Fig. 2 is a flow chart illustrating implementation of an openpoint logic implementation class in an alternative embodiment of the present invention. As shown in fig. 2, the business system is an interface provider and the caller is an interface caller. After defining the open point by the service system, if the caller needs to define the open point by the user, the caller realizes the open point logic realization class on the defined open point, then pushes the service package of the realized open point logic realization class to the server of the service system, when the service is called, the service system realizes the loading of class files (all named as Java class files, which are binary files capable of running on the hardware platform and the operating system of the JVM) through the interface full-limit name and the class loader, and carries out the logic execution of the user-defined development point.
Illustratively, a service provider providerA provides an interface A and defines an open point, a caller consumerA pulls the interface definition, and a local implementation of an open point logic implementation class is realized (wherein the open point logic implementation class has a consumerA caller identifier to be distinguished from other callers), and then the open point logic implementation class is packaged into a jar packet and loaded into a JVM of providerA through a classloader (real-time effect). The ConsumerA initiates the invocation of the interface A, providerA executes the service logic and the open point logic realization class, wherein the caller identification enables the service system to accurately execute the logic code realized by the ConsumerA when executing the open point logic realization class, so that the whole invocation chain is completed, the middle part does not depend on any middleware to store data and state, the use is very convenient, the caller only needs to pay attention to the realization of the service logic, and no extra configuration needs to be added on any platform.
When the caller realizes the open point logic realization class, the caller identification method needs to be configured so as to search the corresponding open point logic realization class according to the caller identification. In the practical application process, a layer of standard protocol can be configured on the interface in advance, and the calling party realizes own logic according to the set of protocol. Fig. 3 is a schematic diagram of an openpoint interface protocol in an alternative embodiment of the present invention, where in fig. 3, a caller id method is used to search a corresponding openpoint logic implementation class according to a caller id, a service logic method is used to define an implementation method of each service, and a caller needs to implement the two methods when implementing the openpoint logic implementation class. The open point interface protocol may further include at least one of: a sorting rule method, a call-back interface method, a service logic method and an extension method. The sequencing rule method is used for defining the implementation sequence of the implementation method of each service, the callback interface method is used for defining the callback mode after the execution of the method is completed, and the extension method is used for defining other methods (the specific method can be customized, for example, a method for adding data screening or filtering among a plurality of service implementation methods). The sequencing rule method, the call-back interface method and the extension method can be selectively set according to actual conditions. In the embodiment, a layer of standard protocol is set, and the caller realizes the universal adaptation of the open point after realizing the service logic according to the standard protocol constraint. After the open point logic implementation class is realized according to the set of protocol specifications, unified constraint and unified management of the open point logic implementation class can be realized, and various service scenes can be flexibly supported.
Step S103, under the condition that the open point logic realization class corresponding to the interface full-restriction name is loaded in the target virtual machine, the open point logic realization class in the target virtual machine is executed according to the request parameter, and a response result corresponding to the service request is generated.
The embodiment of the invention executes the open point logic realization class in the target virtual machine according to the request parameter under the condition that the open point logic realization class corresponding to the interface full limit name is loaded in the target virtual machine, can more flexibly support the expansion of the interface, gives customizable contents to a specific caller, avoids the repeated development of the interface to a greater extent, is convenient for code maintenance and improves the production efficiency.
It should be noted that the service request in the embodiment of the present invention may be directly sent to the service system by the caller, or may be sent to the service system by the caller through another system.
The frequency of iterative update of the APP is increased day by day, the APP needs to be audited when a new version is issued each time, the auditing periods of all large application markets are different, several days are needed from the issuance to the update downloading of the client, and forced user upgrading cannot be realized along with the popularization of the national security law, so that application programs of different versions coexist, interfaces called by the APPs of different versions in the back end are possibly different, and in addition, the interfaces are the same but the logics are different. If different service logics are judged to be carried out in the code by judging different versions, for example, a client initiates call to a back-end application and carries version number information version as xxx, and the back-end interface judges that different service logics are carried out on a specific interface through the version number after receiving a client request, the later maintenance of the code is difficult, and the influence of newly-added logic on old logic cannot be ensured.
If an interceptor or section is made in the project, the route is processed and routed to different service logics through a unified version, for example, a client initiates call to a back-end application and carries version number information version as xxx, after a back-end interface receives a request of the client, a unified logic processor is called on a specific interface, and a logic processor unified processing method and corresponding version logics are carried out. The method for extracting the version number judged by each interface into a uniform version number reduces redundant codes, but the uniform version routing control in the project has high intrusiveness on the project and cannot realize flexible dynamic configuration.
Dynamic aliases can be added if service calls are made through the RPC framework, and different versions are distinguished to different application containers through aliases. For example, a client initiates a call to a back-end application, and different APP versions correspond to different gateway interfaces, for example, the gateway interface corresponding to the APP of the V1.0 version is f1_ prodA, and the gateway interface corresponding to the APP of the V2.0 version is f1_ prodB; different gateway interfaces correspond to different applications, a new gateway interface needs to be configured when a new version is released every time, the new version calls the corresponding gateway interface, and the old gateway interface is still reserved. The method depends on the client APP to carry the alias when initiating the call, and the gateway routes to different application containers through the alias. The scheme is simple and rough, most companies have gateways, but the scheme needs to apply for a new gateway interface and deploy a new application instance every time a release version is released, each alias corresponds to a set of application container, container resources are wasted along with the increase of iteration versions, the resource utilization rate is low, the maintenance cost is high, new aliases need to be manually configured on the gateways every time the new version is online, and the reliability is low.
Based on this, in some embodiments of the invention, the caller communicates with the business system through an interface mapping system. Specifically, the interface mapping system analyzes the target caller identification, the method name and the version number from the call request sent by the target caller, determines the service system interface information corresponding to the method name and the version number according to the interface details input in advance, and sends the service request according to the service system generated by the target caller identification and the service system interface information. The calling party only interacts with the interface mapping system, the interface mapping system communicates with the service system, and the result is returned to the calling party. The caller does not perceive specific business system behavior.
Fig. 4 is a schematic diagram of an architecture of a service processing method in an alternative embodiment of the present invention. In the embodiment shown in fig. 4, the caller is a client, such as an iOS client, an Android client, a Windows client, and the like. Interface details (interface-version-mapping in the present embodiment, an interface version mapping table), a local cache localCache, a distributed cache jimdb, a database (for example, an sql database), and a calling policy (for example, jsf calling policy (jsfClient), http calling policy (httpparent), etc.) are set in the interface mapping system. The interface details in the embodiment of the present invention may be stored in the form of an interface version number mapping table. Fig. 5 is a diagram of an interface version number mapping table in an alternative embodiment of the present invention. In the embodiment shown in fig. 5, type specifies a specific calling mode (such as jsf, http); request _ path is a specific method name or path; version is the supported version number (supported range, greater than, less than, equal to); fun _ label is an open point identification used for identifying an open point supported by a current interface, and an open point logic implementation class is judged in which link to execute through an open point identification system; class _ path, alias, token are the necessary information for the jsf generalization call. class _ path is an interface fully-defined class name used for jsf generalized call, and is used for specifying the class where the interface is located (jsf generalized call can be initiated by class name + method name; alias is a service alias used for specifying a specific call container or environment, different aliases correspond to different containers or environments, token is a key, and one alias corresponds to one key and is used for security authentication.
After the interface details are entered into the database, the interface mapper may query the interface details from the database. Certainly, after the interface details are recorded into the database, the interface details can also be synchronized to the distributed cache and the local cache, and the interface mapper queries the interface details from the distributed cache or the local cache so as to improve the subsequent query performance.
Fig. 6 is a schematic diagram of a main flow of interface mapping in an alternative embodiment of the present invention, and fig. 7 is a schematic diagram of a main flow of a service processing method in an alternative embodiment of the present invention. As shown in fig. 6 and 7, after a user accesses a client (APP), the APP obtains a version number of a current client, which carries a method name (request name), a version number, and a current caller id (the caller id is used to match an openpoint logic implementation class that implements which caller is executed). The interface mapping system inquires whether the local cache has corresponding interface details according to the current method and the version number, if so, the interface mapping system directly obtains the interface details, otherwise, the interface mapping system obtains the interface details from the distributed cache; and if the distributed cache does not exist, obtaining the data from the database. And if the corresponding interface details cannot be found in the local cache, the distributed cache and the database, returning prompt information to the client. The interface detail refers to information required by the interface mapping system to initiate a service request, and the database configuration information includes an interface type, a request path request _ path, a class name class _ path, an alias, a key, and the like. And the version mapper acquires the real interface and the type according to the current interface protocol and finds a corresponding request strategy (request client) according to the request type. If the request is an http request, the interface mapping system calls httpClient to initiate a request to a service system, if the request is an jsf request, the request is initiated by means of jsf generalization call, and meanwhile, the extension is supported, for example, if the request needs to be called in a webservice mode, only a webservice calling tool class needs to be newly added in a policy factory. The interface mapping system initiates a specific service request through a built-in client. The specific service request mainly comprises a request mode, a request parameter and a response result; for example, if the current service call is to acquire user information through a user pin (the pin refers to a unique ID of the user), the request mode is jsf, the parameter is the user pin, and the response result is the user head portrait, the nickname, the gender, and the account. The service system executes the method open point logic realization class, generates a corresponding response result and returns the response result to the interface mapping system. And the interface mapping system returns a response result of the service request to the APP after acquiring the response result.
In the embodiment of the invention, the interface mapping system does not depend on a specific service system, so that the dynamic horizontal extension is supported, and the method and the device can be suitable for various service scenes with different magnitudes. Because a uniform calling mode is provided for a calling party, and a specific calling protocol of a service system is processed by an interface mapping system, the calling party does not need to concern the calling mode and protocol of a specific service, and only needs to concern a specific method and access participation; the interface mapping system only initiates a service request without any logic processing, so the interface mapping system is suitable for both new and old systems and can also realize no perception on the service system.
The embodiment unifies the calling entries of the calling party, and is convenient for expanding some data statistics functions, such as statistics of the call volume of apps of different versions, statistics of the call volume of a certain interface, and even some customized functions and the like. Optionally, the interface mapping system according to the embodiment of the present invention may be further configured to at least one of:
and intercepting the call request under the condition that the target calling party identification exists in a preset first calling party list. For example, when it is detected that a certain user has a policy swiping behavior and the risk value is high (the risk value is a risk degree system for identifying a user), the user ID may be added to a first caller name list in the version mapping system, the first caller list is checked when the system accesses the interface, and if the user is in the first caller list, the bottom-of-pocket status code is directly returned without specific interface invocation, thereby reducing the pressure of the service system;
and intercepting the call request under the condition that the target caller identification does not have a preset second caller list. Exemplarily, in the actual application process, if the service corresponding to the service request is a special function and is only used by fixed personnel, for example, the health value ranking of the whole personnel can only be checked by some personnel of an enterprise, the user IDs of the personnel are configured in the second caller list, the second caller list is checked when the interface is accessed, if the user is not in the second caller list, the no-permission prompt is directly returned, the specific interface call is not performed, and if the second caller list is hit, the specific interface call is performed;
interface current limiting: and intercepting the call request under the condition that the number of times of the call request sent by the target caller exceeds a preset number threshold. Illustratively, the interface is only allowed to access 1W times per second, and specific service calling is not initiated or a preset alarm strategy alarm is not triggered after the access is exceeded, so that the machine list refreshing behavior is effectively prevented;
and (3) interface alarming: when the interface is abnormal or the calling frequency is exceeded, a preset alarm strategy (e.g. sending an email, notifying the inside of the system, notifying the instant messaging information, etc.) can be triggered;
interface authentication: and authenticating the target calling party, and intercepting the calling request under the condition that the authentication is not passed. Illustratively, only an authorized caller can initiate a call to the service interface, a unified authentication mechanism can be made, before initiating the interface call, whether the current caller passes the authentication is firstly checked, and if the current caller does not pass the authentication, no permission is returned.
The embodiment of the invention realizes the communication between the calling party and the server by adopting the interface mapping system, can realize the decoupling of version mapping logic and a service system, and reduces the complexity of the service system; the multi-calling party is deployed for use at one time, and the version mapping system is extracted out for the access of the multi-service system and the multi-calling party, so that the production efficiency is improved; the original service is not influenced, the service system can be seamlessly accessed, and the compatibility of the system is ensured; the dynamic horizontal extension is supported, and the performance of the system is ensured; the interface version can be flexibly configured to take effect in real time, so that the elasticity of the system is increased; the multi-protocol calling is supported, and the calling party is unaware, so that the docking efficiency of the calling party is improved.
According to a second aspect of the embodiments of the present invention, an apparatus for implementing the service processing method is provided. Fig. 8 is a schematic diagram of main modules of a service processing apparatus according to an embodiment of the present invention, and as shown in fig. 8, a service processing apparatus 800 includes:
a service request receiving module 801, which determines a target caller identifier, a fully qualified interface name and a request parameter according to a received service request;
a service logic judgment module 802, configured to judge whether an open point logic implementation class corresponding to the fully qualified interface name is loaded in the target virtual machine corresponding to the target caller id;
and a service logic execution module 803, which executes the open point logic implementation class in the target virtual machine according to the request parameter and generates a response result corresponding to the service request, when the open point logic implementation class corresponding to the fully qualified interface name is loaded in the target virtual machine.
Optionally, the apparatus further comprises a logic definition module configured to: in response to receiving an open point logic implementation class implemented by the target caller based on the open point interface protocol, loading the open point logic implementation class into the target virtual machine; the open point interface protocol is preset for the interface.
Optionally, the open point interface protocol includes a caller identification method, and at least one of: a sorting rule method, a call-back interface method, a service logic method and an extension method.
According to a third aspect of embodiments of the present invention, an interface mapping system is provided. Fig. 9 is a schematic diagram of main modules of an interface mapping system according to an embodiment of the present invention, and as shown in fig. 9, the interface mapping system 900 includes:
a calling request receiving module 901, which receives a calling request sent by a target calling party and analyzes a target calling party identifier, a method name and a version number from the calling request;
an interface information determining module 902, configured to determine, according to interface details entered in advance, service system interface information corresponding to the method name and the version number;
the service request generating module 903 is configured to generate a service request according to the target caller id and the service system interface information, and initiate the service request to a service processing apparatus provided in the second aspect of the embodiment of the present invention.
Optionally, the interface mapping system according to the embodiment of the present invention further includes a call request statistics module, configured to at least one of:
intercepting the call request under the condition that the target calling party identification exists in a preset first calling party list or a preset second calling party list;
intercepting the call request or triggering a preset alarm strategy under the condition that the number of times of the call request sent by the target caller exceeds a preset number threshold;
and authenticating the target calling party, and intercepting the calling request under the condition that the authentication is not passed.
According to a fourth aspect of the embodiments of the present invention, a service processing system is provided. Fig. 10 is a schematic diagram of the main components of a service processing system according to an embodiment of the present invention, and as shown in fig. 10, a service processing system 1000 includes a service processing apparatus 800 and an interface mapping system 900; wherein the content of the first and second substances,
the interface mapping system 900 receives a call request sent by a target caller, analyzes a target caller identification, a method name and a version number from the call request, determines service system interface information corresponding to the method name and the version number according to interface details input in advance, generates a service request according to the target caller identification and the service system interface information, and sends the service request to the service processing device;
the service processing apparatus 800 determines a target caller id, a fully qualified interface name and a request parameter according to a received service request, determines whether an open point logic implementation class corresponding to the fully qualified interface name is loaded in a target virtual machine corresponding to the target caller id, executes the open point logic implementation class in the target virtual machine according to the request parameter under the condition that the open point logic implementation class corresponding to the fully qualified interface name is loaded in the target virtual machine, and generates a response result corresponding to the service request;
the service processing apparatus 800 returns the response result to the interface mapping system 900, and the interface mapping system 900 returns the response result to the target caller.
According to a fifth aspect of the embodiments of the present invention, there is provided an electronic device for service processing, including:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the method provided by the first aspect of the embodiments of the present invention.
According to a sixth aspect of embodiments of the present invention, there is provided a computer readable medium, on which a computer program is stored, which when executed by a processor, implements the method provided by the first aspect of embodiments of the present invention.
Fig. 11 shows an exemplary system architecture 1100 of a service processing method or service processing apparatus to which embodiments of the present invention may be applied.
As shown in fig. 11, the system architecture 1100 may include terminal devices 1101, 1102, 1103, a network 1104, and a server 1105. The network 1104 is a medium to provide communication links between the terminal devices 1101, 1102, 1103 and the server 1105. Network 1104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
A user may use terminal devices 1101, 1102, 1103 to interact with a server 1105 over a network 1104 to receive or send messages or the like. Various messaging client applications, such as shopping applications, web browser applications, search applications, instant messaging tools, mailbox clients, social platform software, etc. (examples only) may be installed on the terminal devices 1101, 1102, 1103.
The terminal devices 1101, 1102, 1103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 1105 may be a server that provides various services, such as a backend management server (for example only) that provides support for shopping-like websites browsed by users using the terminal devices 1101, 1102, 1103. The backend management server may analyze and perform other processing on the received data such as the product information query request, and feed back a processing result (for example, target push information, product information — just an example) to the terminal device.
It should be noted that the service processing method provided by the embodiment of the present invention is generally executed by the server 1105, and accordingly, the service processing apparatus is generally disposed in the server 1105. Further, in the present embodiment, the terminal devices 1101, 1102, 1103 may also communicate with the server 1105 not directly with the server 1105 but with an interface mapping system.
It should be understood that the number of terminal devices, networks, and servers in fig. 11 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 12, shown is a block diagram of a computer system 1200 suitable for use with a terminal device implementing an embodiment of the present invention. The terminal device shown in fig. 12 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiment of the present invention.
As shown in fig. 12, the computer system 1200 includes a Central Processing Unit (CPU)1201, which can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)1202 or a program loaded from a storage section 1208 into a Random Access Memory (RAM) 1203. In the RAM 1203, various programs and data necessary for the operation of the system 1200 are also stored. The CPU 1201, ROM 1202, and RAM 1203 are connected to each other by a bus 1204. An input/output (I/O) interface 1205 is also connected to bus 1204.
The following components are connected to the I/O interface 1205: an input section 1206 including a keyboard, a mouse, and the like; an output portion 1207 including a display device such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 1208 including a hard disk and the like; and a communication section 1209 including a network interface card such as a LAN card, a modem, or the like. The communication section 1209 performs communication processing via a network such as the internet. A driver 1210 is also connected to the I/O interface 1205 as needed. A removable medium 1211, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like, is mounted on the drive 1210 as necessary, so that a computer program read out therefrom is mounted into the storage section 1208 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 1209, and/or installed from the removable medium 1211. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 1201.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor comprising: the system comprises a service request receiving module, a service logic judging module and a service logic executing module. The names of these modules do not form a limitation on the module itself in some cases, for example, the service logic determination module may also be described as a module that executes the openpoint logic implementation class in the target virtual machine according to the request parameter.
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: determining a target calling party identifier, a fully qualified interface name and request parameters according to the received service request; judging whether an open point logic implementation class corresponding to the interface full-restriction name is loaded in a target virtual machine corresponding to the target calling party identifier; and under the condition that the open point logic implementation class corresponding to the fully qualified interface name is loaded in the target virtual machine, executing the open point logic implementation class in the target virtual machine according to the request parameter, and generating a response result corresponding to the service request.
According to the technical scheme of the embodiment of the invention, under the condition that the open point logic implementation class corresponding to the interface full-definition name is loaded in the target virtual machine, the open point logic implementation class in the target virtual machine is executed according to the request parameter, so that the expansion of the interface can be supported more flexibly, the customizable content is handed to a specific caller, the repeated development of the interface is avoided to a greater extent, the code maintenance is convenient, and the production efficiency is improved. The embodiment of the invention realizes the communication between the calling party and the server by adopting the interface mapping system, can realize the decoupling of version mapping logic and a service system, and reduces the complexity of the service system; the multi-calling party is deployed for use at one time, and the version mapping system is extracted out to be accessed by a multi-service system and a multi-calling party, so that the production efficiency is improved; the original service is not influenced, the service system can be seamlessly accessed, and the compatibility of the system is ensured; the dynamic horizontal extension is supported, and the performance of the system is ensured; the interface version can be flexibly configured to take effect in real time, so that the elasticity of the system is increased; the multi-protocol calling is supported, and the calling party is unaware, so that the docking efficiency of the calling party is improved.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method for processing a service, comprising:
determining a target calling party identifier, a fully qualified interface name and request parameters according to the received service request;
judging whether an open point logic implementation class corresponding to the interface full-restriction name is loaded in a target virtual machine corresponding to the target calling party identifier;
and under the condition that the open point logic implementation class corresponding to the fully qualified interface name is loaded in the target virtual machine, executing the open point logic implementation class in the target virtual machine according to the request parameter, and generating a response result corresponding to the service request.
2. The method of claim 1, wherein prior to determining whether an openpoint logic implementation class corresponding to the fully qualified name of the interface is loaded in a target virtual machine corresponding to the target caller identification, the method further comprises:
in response to receiving an open point logic implementation class which is implemented by the target caller based on an open point interface protocol, loading the open point logic implementation class into the target virtual machine; the open point interface protocol is preset for the interface.
3. The method of claim 2, wherein the open point interface protocol includes a caller identification method and at least one of: a sorting rule method, a call-back interface method, a service logic method and an extension method.
4. The method of claim 1, wherein the service request is generated by: analyzing the target calling party identification, the method name and the version number from the calling request sent by the target calling party, determining the service system interface information corresponding to the method name and the version number according to the interface details which are input in advance, and sending a service request to the service system which is generated according to the target calling party identification and the service system interface information.
5. A traffic processing apparatus, comprising:
the service request receiving module is used for determining a target calling party identifier, an interface full-limited name and a request parameter according to the received service request;
the service logic judgment module is used for judging whether an open point logic realization class corresponding to the interface full-restriction name is loaded in the target virtual machine corresponding to the target calling party identifier;
and the service logic execution module is used for executing the open point logic implementation class in the target virtual machine according to the request parameter under the condition that the open point logic implementation class corresponding to the interface full-restriction name is loaded in the target virtual machine, and generating a response result corresponding to the service request.
6. An interface mapping system, comprising:
the calling request receiving module is used for receiving a calling request sent by a target calling party and analyzing a target calling party identifier, a method name and a version number from the calling request;
the interface information determining module is used for determining the service system interface information corresponding to the method name and the version number according to the interface details which are input in advance;
a service request generating module, which generates a service request according to the target caller id and the service system interface information, and initiates the service request to the service processing apparatus of any one of claims 1 to 5.
7. The interface mapping system of claim 6, further comprising a call request statistics module to at least one of:
intercepting the call request under the condition that the target calling party identification exists in a preset first calling party list or a preset second calling party list;
intercepting the call request or triggering a preset alarm strategy under the condition that the number of times of the call request sent by the target caller exceeds a preset number threshold;
and authenticating the target calling party, and intercepting the calling request under the condition that the authentication is not passed.
8. A transaction system, comprising: a service processing device and an interface mapping system; wherein the content of the first and second substances,
the interface mapping system receives a calling request sent by a target calling party, analyzes a target calling party identifier, a method name and a version number from the calling request, determines service system interface information corresponding to the method name and the version number according to interface details input in advance, generates a service request according to the target calling party identifier and the service system interface information, and sends the service request to the service processing device;
the service processing device determines a target caller identification, a fully qualified interface name and a request parameter according to a received service request, judges whether an open point logic implementation class corresponding to the fully qualified interface name is loaded in a target virtual machine corresponding to the target caller identification, executes the open point logic implementation class in the target virtual machine according to the request parameter under the condition that the open point logic implementation class corresponding to the fully qualified interface name is loaded in the target virtual machine, and generates a response result corresponding to the service request;
and the service processing device returns the response result to the interface mapping system, and the interface mapping system returns the response result to the target caller.
9. An electronic device for business processing, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-4.
10. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-4.
CN202210800862.7A 2022-07-08 2022-07-08 Service processing method, device and system and interface mapping system Pending CN115080274A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210800862.7A CN115080274A (en) 2022-07-08 2022-07-08 Service processing method, device and system and interface mapping system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210800862.7A CN115080274A (en) 2022-07-08 2022-07-08 Service processing method, device and system and interface mapping system

Publications (1)

Publication Number Publication Date
CN115080274A true CN115080274A (en) 2022-09-20

Family

ID=83258641

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210800862.7A Pending CN115080274A (en) 2022-07-08 2022-07-08 Service processing method, device and system and interface mapping system

Country Status (1)

Country Link
CN (1) CN115080274A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115686888A (en) * 2022-12-30 2023-02-03 浙江城云数字科技有限公司 Rule-based disposal behavior flow arrangement method, device and application

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115686888A (en) * 2022-12-30 2023-02-03 浙江城云数字科技有限公司 Rule-based disposal behavior flow arrangement method, device and application

Similar Documents

Publication Publication Date Title
EP2947569A1 (en) Hybrid applications operating between on-premise and cloud platforms
CN110019080B (en) Data access method and device
US10033790B2 (en) Method for a connector providing transactional interoperability to multiple messaging providers to multiple application servers using the same implementation
CN111045833A (en) Interface calling method and device
CN111427701A (en) Workflow engine system and business processing method
CN111460129A (en) Method and device for generating identification, electronic equipment and storage medium
CN112202744B (en) Multi-system data communication method and device
WO2023011274A1 (en) Communication protocol conversion method, and device, system, and gateway device
EP1872256B1 (en) System and method of waste management
CN115080274A (en) Service processing method, device and system and interface mapping system
CN112764726A (en) Data synthesis method and device
CN111767157A (en) Request processing method and device based on service grid
US20190075018A1 (en) Managing a generation and delivery of digital identity documents
US20100241716A1 (en) System for interconnecting manifold entities across a real-time Meshed Information Exchange network
CN113778499A (en) Method, device, equipment and computer readable medium for publishing service
CN110795741B (en) Method and device for carrying out security processing on data
CN116244682A (en) Database access method, device, equipment and storage medium
CN112953719B (en) Token authentication method and device
CN112905273A (en) Service calling method and device
CN104980329B (en) Book management method and device, Mobile Agent Server
CN111984616A (en) Method, device and system for updating shared file
CN113765983A (en) Site service deployment method and device
CN113760481A (en) Distributed timed task scheduling system and method
CN113419878B (en) Data operation method and device
CN111190664A (en) Method and system for generating page

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