CN106789659B - Routing method and device of service function - Google Patents

Routing method and device of service function Download PDF

Info

Publication number
CN106789659B
CN106789659B CN201611175847.9A CN201611175847A CN106789659B CN 106789659 B CN106789659 B CN 106789659B CN 201611175847 A CN201611175847 A CN 201611175847A CN 106789659 B CN106789659 B CN 106789659B
Authority
CN
China
Prior art keywords
service
routing
function
service function
rule
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
CN201611175847.9A
Other languages
Chinese (zh)
Other versions
CN106789659A (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 58 Information Technology Co Ltd
Original Assignee
Beijing 58 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 58 Information Technology Co Ltd filed Critical Beijing 58 Information Technology Co Ltd
Priority to CN201611175847.9A priority Critical patent/CN106789659B/en
Publication of CN106789659A publication Critical patent/CN106789659A/en
Application granted granted Critical
Publication of CN106789659B publication Critical patent/CN106789659B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/302Route determination based on requested QoS
    • H04L45/306Route determination based on the nature of the carried application

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention provides a routing method and a device of a service function, wherein the method comprises the following steps: receiving service routing information through an API entrance; the service routing information comprises service functions and service parameters; performing service type matching according to the service routing information, and performing service parameter filtering to obtain a first service function and a service parameter corresponding to the first service function; performing routing rule matching according to the first service function and the service parameters corresponding to the first service function to obtain a first routing rule corresponding to the first service function; and dividing the service corresponding to the first routing rule into corresponding service logics for processing according to the routing mapping rule, reducing the access cost of a user by setting the same API (application program interface) inlets, and realizing low coupling, high flexibility and high compatibility in the SDK (software development kit) only by calling an interface and inputting service parameters by a service party.

Description

Routing method and device of service function
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a routing method and apparatus for a service function.
Background
With the continuous Development of internet companies, the tasks of improving the security of Software systems and opening accounts across platforms are generally realized by logging in a Software Development Kit (SDK). At present, due to differences of different service parties and different dependence degrees on an SDK login system, the service parties have high requirements on internal structure design of the SDK, such as low coupling, high flexibility, high compatibility and the like, the SDKs commonly used at present include Sina SDK, QQ SDK, WeChat SDK and the like, however, due to the fact that the Application Programming Interface (API) inlets are not uniform, the service parties need to consider the use scenes of various interfaces when accessing the SDK, and the access cost is high. The multi-style entry API raises the maintenance cost of the SDK while raising high coupling issues.
Therefore, how to solve the problem of diversified service logic and realize low coupling, high flexibility and high compatibility in the SDK becomes a problem to be solved urgently.
Disclosure of Invention
The invention provides a routing method and a routing device for service functions, which are used for solving the problem that the low coupling, high flexibility and high compatibility in an SDK become to be solved urgently in order to solve the logic problem of diversified services.
A first aspect of the present invention provides a routing method for a service function, including:
receiving service routing information through an Application Programming Interface (API) inlet; the service routing information comprises a service function and a service parameter;
performing service type matching according to the service routing information, and performing service parameter filtering to obtain a first service function and a service parameter corresponding to the first service function;
performing routing rule matching according to the first service function and the service parameter corresponding to the first service function to obtain a first routing rule corresponding to the first service function;
and dividing the service corresponding to the first routing rule into corresponding business logics according to a routing mapping rule for processing.
Optionally, the method further includes:
and when the service corresponding to the first routing rule is processed in the service logic, exiting through an API (application programming interface) outlet.
Optionally, the performing service type matching according to the service routing information includes:
and performing traversal query according to the service functions to perform service type matching, so as to obtain a plurality of first service functions.
Optionally, the filtering the service parameter includes:
and according to the service parameters, performing service parameter filtering through keyword query to obtain service parameters corresponding to the first service function.
A second aspect of the present invention provides a routing apparatus for service function, including:
the receiving module is used for receiving the service routing information through an Application Programming Interface (API) inlet; the service routing information comprises a service function and a service parameter;
the first processing module is used for carrying out service type matching according to the service routing information and carrying out service parameter filtering to obtain a first service function and a service parameter corresponding to the first service function;
the second processing module is used for carrying out routing rule matching according to the first service function and the service parameters corresponding to the first service function to obtain a first routing rule corresponding to the first service function;
the second processing module is further configured to divide the service corresponding to the first routing rule into corresponding service logics according to a routing mapping rule for processing.
Optionally, the apparatus further comprises:
and the output module is used for exiting through an API (application programming interface) outlet when the service corresponding to the first routing rule is processed and completed in the service logic.
Optionally, the first processing module is specifically configured to:
and performing traversal query according to the service functions to perform service type matching, so as to obtain a plurality of first service functions.
Optionally, the first processing module is specifically configured to:
and according to the service parameters, performing service parameter filtering through keyword query to obtain service parameters corresponding to the first service function.
The routing method and device for the service functions provided by the embodiment of the invention receive the service routing information comprising the service functions and the service parameters through the same API entrance, then carry out service type matching according to the service routing information, carry out service parameter filtering to obtain the service parameters corresponding to the first service function and the first service function, carry out routing rule matching according to the service parameters corresponding to the first service function and the first service function to obtain the first routing rule corresponding to the first service function, divide the services corresponding to the first routing rule into corresponding service logics according to the routing mapping rule for processing, reduce the access cost of a user by setting the same API entrance, and realize low coupling, high flexibility and high compatibility in the SDK by only calling an interface by a service party and inputting the service parameters.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without inventive exercise.
Fig. 1 is a flowchart of a first embodiment of a routing method for a service function according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating an example of a routing method for a service function according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a first embodiment of a routing apparatus for service functions according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a second embodiment of a routing apparatus for service functions provided in the embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a flowchart of a first embodiment of a routing method for a service function according to an embodiment of the present invention, and as shown in fig. 1, an execution main body of the scheme is a terminal device, and may run a program code, where the routing method for a service function includes the specific implementation steps of:
step S101, receiving service routing information through an API entrance; the service routing information includes service functions and service parameters.
In this step, the API entries are set uniformly, and the same entry is used for SDK internal for all the disabled service functions, and the service functions and the related service parameters are input.
Step S102, service type matching is carried out according to the service routing information, and service parameters are filtered to obtain a first service function and service parameters corresponding to the first service function.
In this step, the device performs traversal query according to the service function in the service routing information to perform service type matching, so as to obtain the first service function. And meanwhile, according to the service parameters in the service routing information, performing service parameter filtering through keyword query to obtain the service parameters corresponding to the first service function.
Optionally, if there are routing information inputs of multiple service functions at the same time, the service and the parameters may be distinguished by matching the service types and filtering the service parameters, so that the services can be subsequently distributed to different service logics according to the routing rules.
Step S103, performing routing rule matching according to the first service function and the service parameter corresponding to the first service function to obtain a first routing rule corresponding to the first service function.
In this step, the device needs to perform parameter integration and route matching processing according to any obtained service function and corresponding parameter thereof, so as to obtain a corresponding routing rule.
Taking the first service function as an example, the first routing rule corresponding to the first service function can be obtained.
Step S104, dividing the service corresponding to the first routing rule to the corresponding business logic for processing according to the routing mapping rule.
In this step, according to the routing mapping rule, the service is divided into different service logics, and then the special requirements of the service party are flexibly customized without keywords, so that the service is realized.
In a specific implementation, the scheme further includes:
and when the service corresponding to the first routing rule is processed in the service logic, exiting through an API (application programming interface) outlet.
In the scheme, API outlets are also unified, and all service functions can exit through the same API outlet after the non-ventilated service logic inside the SDK is processed.
The routing method for service functions provided by this embodiment receives service routing information including a service function and a service parameter through the same API entry, performs service type matching according to the service routing information, performs service parameter filtering to obtain a service parameter corresponding to a first service function and a first service function, performs routing rule matching according to the first service function and the service parameter corresponding to the first service function to obtain a first routing rule corresponding to the first service function, divides a service corresponding to the first routing rule into corresponding service logics according to a routing mapping rule, and reduces access cost of a user by setting the same API entry.
Fig. 2 is a schematic flow chart of an example of a routing method for a service function according to an embodiment of the present invention, and as shown in fig. 2, a specific implementation process of the scheme is as follows:
the first step, a user enters the SDK from a unified API inlet, service type matching is carried out through an aSDKSDServiceType, parameter filtering is carried out through params, a routing rule is matched, and the two parameters are necessary conditions for smoothly carrying out the routing rule.
And secondly, after services are divided into different service logics according to the routing mapping rule, flexibly customizing special requirements of a service party through params, such as Logo setting, partial function hiding and the like, so that the service party does not need to consider the coupling problem of the services when accessing the SDK.
And thirdly, processing the service logic in the SDK until the service logic is completed.
And fourthly, exiting the SDK through the unified API outlet.
In this process, the implementation code of the call service of the API entry:
Figure BDA0001184371990000051
Figure BDA0001184371990000061
the callable routing mapping relationship pre-stored in the device is shown in table 1 below.
TABLE 1
aSDKServiceType Route mapping service
WBLoginSDKServiceType_LoginAccount Account login
WBLoginSDKServiceType_LoginFinance Financial logging
WBLoginSDKServiceType_Register Account registration
WBLoginSDKServiceType_CheckPPU Login state detection
WBLoginSDKServiceType_LogOut Logging off
WBLoginSDKServiceType_MobileBind Binding mobile phone
WBLoginSDKServiceType_MobileUnbind Unbinding mobile phone
WBLoginSDKServiceType_QQBind Binding QQ
The service parameter function design is shown in the following table 2:
TABLE 2
Parameter name Corresponding function
LoginSDKHideLeftButton Hidden off/back button
LoginSDKHideThirdLoginView Hidden tripartite login
LoginSDKHeadImage Setting Logo picture
LoginSDKUserName; Setting login user name
LoginSDKUserPassword Setting a login password
LoginSDKMobileCode Obtaining a verification code
LoginSDKPageCloseDelay Seconds to delay closing of the SDK
The implementation code at the exit of the API is:
/**
login completion callback
*/
_(void)SDKLogin58Finished:(WBLoginSDKModel*)resultModel;
In the scheme, the outlet and the inlet are unified, so that the access cost of a third-party user is reduced, and the user does not need to consider which API needs to be called to obtain the service. And the SDK internal logic is decoupled in a layered mode, so that the development personnel can conveniently upgrade and maintain. The application of the routing rule enables the circulation process of the service in the SDK to be clearer and more controllable. The service side is only responsible for calling the interface and does not need to consider any service coupling problem.
Fig. 3 is a schematic structural diagram of a first embodiment of a routing apparatus for a service function according to an embodiment of the present invention, and as shown in fig. 3, a routing apparatus 10 for a service function according to this embodiment includes:
a receiving module 11, configured to receive service routing information through an API entry; the service routing information comprises a service function and a service parameter;
the first processing module 12 is configured to perform service type matching according to the service routing information, and perform service parameter filtering to obtain a first service function and a service parameter corresponding to the first service function;
the second processing module 13 is configured to perform routing rule matching according to the first service function and a service parameter corresponding to the first service function, so as to obtain a first routing rule corresponding to the first service function;
the second processing module 13 is further configured to divide the service corresponding to the first routing rule into corresponding service logics according to a routing mapping rule for processing.
The routing apparatus of the service function provided in this embodiment is configured to execute the technical solution of the method embodiment provided in any one of the foregoing embodiments, and the implementation principle and the technical effect are similar, which are not described herein again.
Fig. 4 is a schematic structural diagram of a second embodiment of a routing apparatus for a service function according to the embodiment of the present invention, and as shown in fig. 4, a routing apparatus 10 for a service function according to this embodiment further includes:
and the output module 14 is configured to exit through an API exit when the service corresponding to the first routing rule is processed in the service logic.
Optionally, the first processing module 12 is specifically configured to:
and performing traversal query according to the service functions to perform service type matching, so as to obtain a plurality of first service functions.
Optionally, the first processing module 12 is specifically configured to:
and according to the service parameters, performing service parameter filtering through keyword query to obtain service parameters corresponding to the first service function.
The routing apparatus of the service function provided in this embodiment is configured to execute the technical solution of the method embodiment provided in any one of the foregoing embodiments, and the implementation principle and the technical effect are similar, which are not described herein again.
In the foregoing specific implementation of the service function routing apparatus, the sending module may be implemented as a sender, the receiver may be implemented as a receiver, the processing module may be implemented as a processor, and a memory for storing program instructions and parameters should be further included in the apparatus.
In the above device, it should be understood that the Processor may be a Central Processing Unit (CPU), other general purpose processors, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the embodiments of the present invention may be directly implemented by a hardware processor, or may be implemented by a combination of hardware and software modules in the processor.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: read-only memory (ROM), RAM, flash memory, hard disk, solid state disk, magnetic tape, floppy disk, optical disk, and any combination thereof.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (6)

1. A method for routing a service function, comprising:
receiving service routing information through an Application Programming Interface (API) inlet; the service routing information comprises service functions and service parameters, and the API corresponds to different service functions;
performing service type matching according to the service routing information, and performing service parameter filtering to obtain a first service function and a service parameter corresponding to the first service function;
performing routing rule matching according to the first service function and the service parameter corresponding to the first service function to obtain a first routing rule corresponding to the first service function;
dividing the service corresponding to the first routing rule into corresponding business logic according to a routing mapping rule for processing;
wherein, the performing service type matching according to the service routing information includes:
and performing traversal query according to the service function to perform service type matching to obtain the first service function.
2. The method of claim 1, further comprising:
and when the service corresponding to the first routing rule is processed in the service logic, exiting through an API (application programming interface) outlet.
3. The method according to claim 1 or 2, wherein the performing traffic parameter filtering comprises:
and according to the service parameters, performing service parameter filtering through keyword query to obtain service parameters corresponding to the first service function.
4. A service function routing apparatus, comprising:
the receiving module is used for receiving the service routing information through an Application Programming Interface (API) inlet; the service routing information comprises service functions and service parameters, and the API corresponds to different service functions;
the first processing module is used for carrying out service type matching according to the service routing information and carrying out service parameter filtering to obtain a first service function and a service parameter corresponding to the first service function;
the second processing module is used for carrying out routing rule matching according to the first service function and the service parameters corresponding to the first service function to obtain a first routing rule corresponding to the first service function;
the second processing module is further configured to divide a service corresponding to the first routing rule into corresponding service logics according to a routing mapping rule for processing;
the first processing module is specifically configured to:
and performing traversal query according to the service function to perform service type matching to obtain the first service function.
5. The apparatus of claim 4, further comprising:
and the output module is used for exiting through an API (application programming interface) outlet when the service corresponding to the first routing rule is processed and completed in the service logic.
6. The apparatus according to claim 4 or 5, wherein the first processing module is specifically configured to:
and according to the service parameters, performing service parameter filtering through keyword query to obtain service parameters corresponding to the first service function.
CN201611175847.9A 2016-12-19 2016-12-19 Routing method and device of service function Active CN106789659B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611175847.9A CN106789659B (en) 2016-12-19 2016-12-19 Routing method and device of service function

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611175847.9A CN106789659B (en) 2016-12-19 2016-12-19 Routing method and device of service function

Publications (2)

Publication Number Publication Date
CN106789659A CN106789659A (en) 2017-05-31
CN106789659B true CN106789659B (en) 2020-08-11

Family

ID=58891311

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611175847.9A Active CN106789659B (en) 2016-12-19 2016-12-19 Routing method and device of service function

Country Status (1)

Country Link
CN (1) CN106789659B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109379284B (en) * 2018-09-17 2022-09-27 平安科技(深圳)有限公司 Route execution method, storage medium, and terminal device
CN111708523B (en) * 2020-05-20 2023-10-13 广州太平洋电脑信息咨询有限公司 NodeJs-based development method, system and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101232626A (en) * 2008-02-01 2008-07-30 中兴通讯股份有限公司 Business supporting system and method based on business events developing platform
CN103559040A (en) * 2013-11-12 2014-02-05 厦门卓讯信息技术有限公司 System and method based on SDK for rapidly building mobile internet application module

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101616027B (en) * 2006-10-10 2012-07-04 华为技术有限公司 Service creation, execution and mapping system and method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101232626A (en) * 2008-02-01 2008-07-30 中兴通讯股份有限公司 Business supporting system and method based on business events developing platform
CN103559040A (en) * 2013-11-12 2014-02-05 厦门卓讯信息技术有限公司 System and method based on SDK for rapidly building mobile internet application module

Also Published As

Publication number Publication date
CN106789659A (en) 2017-05-31

Similar Documents

Publication Publication Date Title
JP6093040B2 (en) Apparatus, method, computer program, and storage medium for providing service
US8249235B2 (en) Conference call prioritization
CN107590718B (en) Shared skill development platform and method, and shared skill application platform and method
CN110266996B (en) Video conference control method and device and terminal equipment
WO2020125229A1 (en) Feature fusion method and apparatus, and electronic device and storage medium
CN106789659B (en) Routing method and device of service function
CN107705173A (en) Order unsubscription method and device based on more wheel interactive voices
US9467847B2 (en) Method and system for managing contact information in a universal plug and play home network environment
CN109165736A (en) Information processing method and device applied to convolutional neural networks
CN107800894A (en) A kind of phonetic prompt method and terminal device for telephony service system
CN110427243A (en) Improve method, terminal and the storage medium of advertisement interaction effect of spreading its tail
US20200028884A1 (en) Enhanced teleconferencing using noise filtering, amplification, and selective muting
WO2019153533A1 (en) Dynamic routing control method and apparatus, computer device and storage medium
CN110033188A (en) Business scheduling method, device, calculating equipment and medium based on block chain
US20190018868A1 (en) Method of inputting document information, device, server, and storage medium
CN108961071B (en) Method for automatically predicting combined service income and terminal equipment
US8837694B1 (en) Smarter telephony and E-mail protocols
CN109101645A (en) Voice communication forwarding method, device, computer equipment and storage medium
US11836640B2 (en) Artificial intelligence modules for computation tasks
CN110830662B (en) Outbound telephone data generation method and device
US20130040624A1 (en) Systems and Methods for Location Based Call Forwarding
WO2019223180A1 (en) Customer information screening method and system, computer device and storage medium
US20170317956A1 (en) Method and system of electronic memorial expression to the deceased
WO2019221814A1 (en) Transcription generation technique selection
CN112634881B (en) Speech intelligent recognition method and system based on scientific and technological achievement database

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