A third-party platform HTTP callback distribution method, system, electronic device and storage medium

Through Java Agent technology, the HTTP request is intercepted in Java Web applications, and the unique identifier of the business object is read and distributed, which solves the problem that the test environment cannot receive callback requests after the system is released, and realizes efficient callback distribution of shared keys, reducing costs and Improve development and testing efficiency.

CN115276968BActive Publication Date: 2025-02-21CHINA FAW CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210805441.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-08
Publication Date
2025-02-21
Estimated Expiration
2042-07-08

AI Technical Summary

Technical Problem

When the system is released from the development test stage to the production environment, the test environment cannot receive callback requests from third-party platforms, cannot conduct full-link testing, and replacing App Key and App Secret is expensive.

Method used

Using the HTTP request interception method based on Java Agent technology, the unique identity of the business object is read by matching the URL rules of the platform interface and sent it to the callback distribution service to realize the distribution of callback requests to the test or production environment.

Benefits of technology

This allows the test environment and production environment to share the same set of API interface to verify the serial number and API key, saving the cost of replacing the key, and properly distributing the callbacks of the pre-production environment to the integrated test environment, improving the development and testing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115276968B_ABST
    Figure CN115276968B_ABST
Patent Text Reader

Abstract

The present invention discloses a third-party platform HTTP callback distribution method, system, electronic device and storage medium. The method steps include determining a unique identifier of a business object, intercepting an HTTP request, matching the current request according to the URL matching rule of the platform interface, and performing a callback distribution service; reading the unique identifier of the business object, and distributing the callback request to the platform test environment. The present invention is based on JavaAgent technology and has certain versatility. In Java Web applications, the test environment and the production environment can share the same set of API interface verification serial numbers App Key and API keys App Secret. In the research and development, the development and testing of mall-related functions are moved forward to SIT, and are no longer restricted by a large number of commodity configurations, saving a lot of time and economic costs. The Java Agent-based technical injection filter method does not invade the business system, and the callback distribution mechanism can be applied to various Java Web-based systems.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to an HTTP callback distribution method, system, electronic device and storage medium, and in particular to a third-party platform HTTP callback distribution method, system, electronic device and storage medium. Background Art

[0002] HTTP callback plays an important role in scenarios such as Oauth2 authorization, order payment confirmation, and user binding relationship establishment. The callbacks mentioned in this article are all based on the HTTP(s) protocol. When the system connects to a third-party platform for business interface connection, the third-party platform generally grants a set of API interface verification serial number App Key and API key App Secret, where the API interface verification serial number App Key is used as the unique identifier of the system on the third-party platform, and the API key App Secret is used for interface data transmission encryption.

[0003] When the system is in the development and testing phase, the developer will use the App Key and App Secret granted by the third-party platform for the test environment system, and the third-party platform will configure the system's callback address as the test environment callback URL; when the system is released to the production environment after development and testing, the App Key and App Secret granted by the third-party platform are used in the production environment, and the third-party platform will configure the system's callback address as the production environment callback URL. At this time, because the system callback address configured by the third-party platform is the production environment, when the system is released to the production environment, the test environment cannot receive the callback request from the third-party platform without changing the App Key and App Secret, and cannot perform full-link testing. Replacing the App Key and App Secret has a high cost in some scenarios. For example, the third-party platform will charge more fees for applying for more App Keys and App Secrets, and the third-party platform has a large number of configuration settings for the current App Key, and it is costly to copy the configuration settings to the new App Key. Summary of the invention

[0004] The purpose of the present invention is to provide a third-party platform HTTP callback distribution method, system, electronic device and storage medium, a callback distribution method with certain versatility based on Java Agent technology, which is used in Java Web applications, so that the test environment and the production environment can share the same set of API interface verification serial number App Key and API key App Secret, thereby solving the shortcomings of the prior art.

[0005] The present invention provides the following scheme:

[0006] A third-party platform HTTP callback distribution method, comprising:

[0007] Determine the unique identifier of the business object based on the request and response between the platform interface and the third-party interface, or based on the request and response between the application and the platform interface;

[0008] Based on the Java Agent principle, HTTP request interception is performed, and the current request is matched according to the URL matching rules of the platform interface. The unique identifier of the business object is read from the request or response of the platform interface, and the unique identifier of the business object is sent to the callback distribution service.

[0009] The callback distribution service receives all callback requests from the third-party platform, matches the current request according to the URL matching rules of the third-party interface, reads the unique identifier of the business object, and if the unique identifier of the business object comes from the HTTP request interception, distributes the callback request to the platform test environment, otherwise distributes it to the platform production environment.

[0010] Furthermore, in the requests and responses of the platform interface and the third-party interface, if there is a field that matches the two calls, that is, it identifies that the two calls process the same business object, then the field is called the business object unique identifier.

[0011] Furthermore, in the request and response between the application and the platform interface, if there is a field that matches the two calls, that is, it identifies that the two calls process the same business object, then the field is called the business object unique identifier.

[0012] Furthermore, the URL matching rule of the platform interface is specifically: using the Ant-Style Path pattern matching rule;

[0013] The URL matching rule of the third-party interface is specifically: using the Ant-Style Path pattern matching rule.

[0014] Furthermore, the Ant-Style Path pattern adopts the path matching pattern defined by Apache Ant and uses wildcards for matching.

[0015] Furthermore, based on the Java Agent principle, HTTP request interception is performed and matched with the current request according to the URL matching rules of the platform interface. If the match is successful, the Groovy script that reads the unique identifier of the business object is executed on the request, and the unique identifier of the business object is sent to the callback distribution service. The function of the Groovy script is to obtain the unique identifier of the business object from the HTTP request or response object without recompiling the code or restarting the service.

[0016] Furthermore, the callback distribution service receives all callback requests from the third-party platform, matches them with the current request according to the URL matching rules of the third-party interface, and if the match is successful, executes the Groovy script that reads the unique identifier of the business object for the request. If the unique identifier of the business object comes from the HTTP request interception, the callback request is distributed to the platform test environment, otherwise it is distributed to the platform production environment. The function of the Groovy script is to obtain the unique identifier of the business object from the HTTP request or response object without recompiling the code or restarting the service.

[0017] A third-party platform HTTP callback distribution system, specifically comprising:

[0018] A business object unique identifier determination module, used to determine the business object unique identifier based on the request and response between the platform interface and the third-party interface, or based on the request and response between the application and the platform interface;

[0019] HTTP request interception module, based on the Java Agent principle, performs HTTP request interception, matches the current request according to the URL matching rule of the platform interface, reads the business object unique identifier from the request or response of the platform interface, and sends the business object unique identifier to the callback distribution service;

[0020] Callback request distribution module, the callback distribution service receives all callback requests from the third-party platform, matches the current request according to the URL matching rules of the third-party interface, reads the unique identifier of the business object, and if the unique identifier of the business object comes from the HTTP request interception, distributes the callback request to the platform test environment, otherwise distributes it to the platform production environment.

[0021] An electronic device comprises: a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the steps of the method.

[0022] A computer-readable storage medium stores a computer program executable by an electronic device. When the computer program runs on the electronic device, the electronic device executes the steps of the method.

[0023] Compared with the prior art, the present invention has the following advantages:

[0024] The present invention is based on Java Agent technology and has certain versatility. In Java Web applications, the test environment and the production environment can share the same set of API interface verification serial number App Key and API key App Secret.

[0025] The present invention can properly distribute the callback of the pre-production (UAT) environment to the integrated test (SIT) environment, so that the development and testing of mall-related functions in R&D can be moved to SIT for further testing, and is no longer restricted by the configuration of a large number of commodities, thus saving a lot of time and economic costs.

[0026] The present invention solves the problem of using the same App Key and App Secret in different environments to connect to a third-party platform for callback distribution. The present invention injects a filter based on Java Agent technology without intruding into the business system, so that the callback distribution mechanism can be applied to various Java Web-based systems. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0028] Figure 1 It is a flow chart of the third-party platform HTTP callback distribution method of the present invention.

[0029] Figure 2 It is a framework diagram of the third-party platform HTTP callback distribution system of the present invention.

[0030] Figure 3 This is one of the timing diagram scenarios of application calling platform and third-party interface in the prior art.

[0031] Figure 4 This is the second timing diagram scenario of the application calling the platform and the third-party interface in the prior art.

[0032] Figure 5 The following is a flowchart of a callback distribution method in a possible embodiment.

[0033] Figure 6 It is a system architecture diagram of an electronic device. DETAILED DESCRIPTION

[0034] The technical solution of the present invention will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0035] Glossary:

[0036] App Key: API interface verification serial number;

[0037] App Secret: API key;

[0038] like Figure 1 The third-party platform HTTP callback distribution method of the present invention shown includes:

[0039] Determine the unique identifier of the business object based on the request and response between the platform interface and the third-party interface, or based on the request and response between the application and the platform interface;

[0040] Based on the Java Agent principle, HTTP request interception is performed, and the current request is matched according to the URL matching rules of the platform interface. The unique identifier of the business object is read from the request or response of the platform interface, and the unique identifier of the business object is sent to the callback distribution service.

[0041] The callback distribution service receives all callback requests from third-party platforms, matches them with the current request according to the URL matching rules of the third-party interface, reads the unique identifier of the business object, and distributes the callback request to the platform test environment if the unique identifier of the business object comes from HTTP request interception, otherwise distributes it to the platform production environment.

[0042] Preferably, in the request and response of the platform interface and the third-party interface, if there is a field that matches the two calls, that is, it identifies that the two calls process the same business object, then the field is called the business object unique identifier. Exemplary: call one request, call one response, and the same business object is processed in the above two calls, then the field is called the business object unique identifier.

[0043] Preferably, in the request and response between the application and the platform interface, if there is a field that matches the two calls, that is, it identifies that the two calls process the same business object, then the field is called the business object unique identifier.

[0044] Preferably, the URL matching rule of the platform interface is specifically: using the Ant-Style Path pattern matching rule;

[0045] The URL matching rules of the third-party interface are as follows: using the Ant-Style Path pattern matching rules.

[0046] Preferably, the Ant-Style Path pattern adopts the path matching pattern defined by Apache Ant and uses wildcards for matching.

[0047] Preferably, based on the Java Agent principle, HTTP request interception is performed and matched with the current request according to the URL matching rules of the platform interface. If the match is successful, a Groovy script that reads the unique identifier of the business object is executed on the request, and the unique identifier of the business object is sent to the callback distribution service. The function of the Groovy script is to obtain the unique identifier of the business object from the HTTP request or response object without recompiling the code or restarting the service.

[0048] Preferably, the callback distribution service receives all callback requests from the third-party platform, matches them with the current request according to the URL matching rules of the third-party interface, and if the match is successful, executes the Groovy script that reads the unique identifier of the business object for the request. If the unique identifier of the business object comes from the HTTP request interception, the callback request is distributed to the platform test environment, otherwise it is distributed to the platform production environment. The role of the Groovy script is to obtain the unique identifier of the business object from the HTTP request or response object without recompiling the code or restarting the service.

[0049] For the method steps disclosed in this embodiment, the method steps are described as a series of action combinations for the purpose of simple description, but those skilled in the art should know that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0050] like Figure 2 The architecture diagram of the third-party platform HTTP callback distribution system of the present invention shown in the figure specifically includes:

[0051] A business object unique identifier determination module, used to determine the business object unique identifier based on the request and response between the platform interface and the third-party interface, or based on the request and response between the application and the platform interface;

[0052] HTTP request interception module, based on the Java Agent principle, performs HTTP request interception, matches the current request according to the URL matching rule of the platform interface, reads the business object unique identifier from the request or response of the platform interface, and sends the business object unique identifier to the callback distribution service;

[0053] Callback request distribution module, the callback distribution service receives all callback requests from the third-party platform, matches the current request according to the URL matching rules of the third-party interface, reads the unique identifier of the business object, and if the unique identifier of the business object comes from the HTTP request interception, distributes the callback request to the platform test environment, otherwise distributes it to the platform production environment.

[0054] It is worth noting that although only the business object unique identification determination module, HTTP request interception module and callback request distribution module are disclosed in this system, it does not mean that the composition of this system is limited to the above basic functional modules. On the contrary, what the present invention wants to express is: on the basis of the above basic functional modules, those skilled in the art can arbitrarily add one or more functional modules in combination with the prior art to form an infinite number of embodiments or technical solutions. In other words, this system is open rather than closed. Just because this embodiment only discloses individual basic functional modules, it cannot be considered that the scope of protection of the claims of the present invention is limited to the disclosed basic functional modules. At the same time, for the convenience of description, the above devices are described in terms of functions and are described separately in various units and modules. Of course, when implementing the present invention, the functions of each unit and module can be implemented in the same or one or more software and / or hardware.

[0055] The system implementation described above is merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present implementation scheme. Those of ordinary skill in the art may understand and implement it without creative work.

[0056] like Figure 3 and Figure 4 The specific application scenarios of the application calling platform and the third-party interface in the prior art shown are: Figure 3 In the example, the application calls platform interface A, which in turn calls third-party platform interface A'. After starting the asynchronous processing flow for the business, third-party platform interface A' responds to the platform's request. After the asynchronous processing flow of the third-party platform ends, the platform interface A" will be called, and the processing result will be returned to the platform. There must be a field in the request message of the application request interface A and the request message of the third-party platform callback platform interface A" that can pair the two calls, that is, to identify that the two calls process the same business object. In the present invention, this field is referred to as the "business object unique identifier."

[0057] exist Figure 4In the example, the application calls platform interface A, and then the application calls third-party platform interface A', and third-party platform A' calls platform interface A". There must be a field in the request or response of platform interface A and the request of the third-party platform to call platform interface A" to pair the two calls, that is, to identify that the two calls process the same business object. In the present invention, this field is called "business object unique identifier".

[0058] The above two callback scenarios cover various callback scenarios for daily docking with third-party platforms, such as order payment callback, user binding and unbinding callback, and seamless login callback.

[0059] like Figure 5 A possible implementation example is shown as follows: when the production environment and the test environment of the platform use the same set of AppKey and App Secret to connect to a third-party platform, a callback distribution rule configuration system, an HTTP request interception Agent, and a callback distribution service are added on the basis of the existing technology.

[0060] Callback distribution rule configuration system, configure callback distribution rules. A callback distribution rule consists of 4 parts, namely:

[0061] (1) The URL matching rule of interface A adopts the Ant-Style Path pattern matching rule;

[0062] (2) Configure a Groovy script that reads the unique identifier of the business object from the request or response of interface A;

[0063] (3) Configure the URL matching rule of interface A" and use the Ant-Style Path pattern matching rule;

[0064] (4) Configure a Groovy script to read the unique identifier of the business object from the request of interface A.

[0065] After the rule configuration is completed, it is distributed to the "HTTP request interception agent" and "callback distribution service". The system also provides an interface for querying callback distribution rules for use by the "HTTP request interception agent" and "callback distribution service".

[0066] The Ant-Style Path pattern is the path matching pattern defined by Apache Ant. The pattern is defined as follows:

[0067] ? matches any single character

[0068] * matches 0 or any number of characters

[0069] ** matches 0 or more directories

[0070] Exemplary:

[0071] / app / p?ttern can match / app / pattern and / app / pXttern, but not / app / pwattern and / app / pttern.

[0072] / cp / radio / *.doc matches all .doc files in the / cp / radio path.

[0073] / cp / radio / ** / *.jsp matches .jsp files in / cp / radio / and all its subdirectories.

[0074] Using the Ant-Style Path mode, you can flexibly define the matching rules for the HTTP request Path and identify the HTTP request path that the HTTP request interception agent and callback distribution service need to intercept.

[0075] Groovy is an agile dynamic language for Java virtual machines. Its usage is basically the same as Java and it is easy to interoperate with Java code. Because the data structures of the request and response of each interface are different, the present invention uses Groovy mainly considering its above-mentioned characteristics. A small Groovy script can be written for each interface to obtain the unique identifier of the business object from the HTTP request or response object without recompiling the code or restarting the service.

[0076] HTTP request interception agent: HTTP request interception agent is based on Java Agent technology, responsible for matching interface A of the test environment and reading the unique identifier of the business object from the request or response of interface A. The HTTP request interception agent is started synchronously when the test environment is started. The HTTP request interception agent reads all callback distribution rules from the callback distribution rule configuration system and injects a filter into the platform to intercept all requests to the platform. The "URL matching rule of interface A" of the distribution rule is matched with the current request. If the match is successful, the Groovy script that reads the unique identifier of the business object is executed on the request, and the unique identifier of the business object is sent to the callback distribution service.

[0077] Callback distribution service: The callback distribution service receives all callback requests from third-party platforms, and matches the "URL matching rule of interface A" of the distribution rule with the current request. If the match is successful, the Groovy script that reads the unique identifier of the business object is executed on the request. If the read unique identifier of the business object is sent by the aforementioned HTTP request interception Agent, the callback request is distributed to the platform test environment, otherwise it is distributed to the platform production environment.

[0078] The present invention also provides an embodiment based on the Internet of Vehicles and an e-commerce platform: the Internet of Vehicles cloud platform (our platform) is connected to the e-commerce platform (third-party platform), and the e-commerce platform provides interfaces such as commodity information, order purchase, and payment for the Internet of Vehicles cloud platform. The vehicle machine (our application) completes the commodity purchase process by accessing the Internet of Vehicles cloud platform interface. Since the commodities involve multiple suppliers, for example, traffic commodities involve telecommunications operators opening traffic packages, and film and television membership commodities involve film and television platforms opening VIP for users, each commodity needs to be configured a lot and even implemented in code before it can become available. At present, the environment with a complete commodity system is the production (PROD) environment and the pre-production (UAT) environment of the Internet of Vehicles cloud platform. Due to the huge workload of configuring commodities in the integrated test (SIT) environment, there is no complete commodity system. Through the specific implementation and application of the present invention, the callback of the pre-production (UAT) environment can be properly distributed to the integrated test (SIT) environment, so that the development and testing of mall-related functions in research and development can be moved forward to SIT, and it is no longer restricted by a large number of commodity configurations, saving time and economic costs in the millions.

[0079] like Figure 6 As shown, the present invention also discloses an electronic device and a storage medium corresponding to the third-party platform HTTP callback distribution method and system:

[0080] An electronic device comprises: a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the steps of a third-party platform HTTP callback distribution method.

[0081] A computer-readable storage medium stores a computer program executable by an electronic device. When the computer program runs on the electronic device, the electronic device executes the steps of a third-party platform HTTP callback distribution method.

[0082] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0083] The electronic device includes a hardware layer, an operating system layer running on the hardware layer, and an application layer running on the operating system. The hardware layer includes hardware such as a central processing unit (CPU), a memory management unit (MMU), and a memory. The operating system can be any one or more computer operating systems that implement electronic device control through a process, such as a Linux operating system, a Unix operating system, an Android operating system, an iOS operating system, or a Windows operating system. In addition, in an embodiment of the present invention, the electronic device can be a handheld device such as a smart phone or a tablet computer, or can be an electronic device such as a desktop computer or a portable computer, which is not particularly limited in the embodiment of the present invention.

[0084] The execution subject of the electronic device control in the embodiment of the present invention may be an electronic device, or a functional module in the electronic device that can call and execute a program. The electronic device may obtain the firmware corresponding to the storage medium. The firmware corresponding to the storage medium is provided by the supplier. The firmware corresponding to different storage media may be the same or different, which is not limited here. After the electronic device obtains the firmware corresponding to the storage medium, the firmware corresponding to the storage medium may be written into the storage medium, specifically, the firmware corresponding to the storage medium may be burned into the storage medium. The process of burning the firmware into the storage medium may be implemented using existing technology, which will not be described in detail in the embodiment of the present invention.

[0085] The electronic device may also obtain a reset command corresponding to the storage medium. The reset command corresponding to the storage medium is provided by the supplier. The reset commands corresponding to different storage media may be the same or different, and are not limited here.

[0086] At this time, the storage medium of the electronic device is a storage medium in which the corresponding firmware is written, and the electronic device can respond to the reset command corresponding to the storage medium in the storage medium in which the corresponding firmware is written, so that the electronic device resets the storage medium in which the corresponding firmware is written according to the reset command corresponding to the storage medium. The process of resetting the storage medium according to the reset command can be implemented by the existing technology and will not be described in detail in the embodiments of the present invention.

[0087] Those skilled in the art will appreciate that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as those generally understood by those skilled in the art in the art to which the present invention belongs. It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with the meanings in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless specifically defined.

[0088] It should be noted that certain words are used in this specification and claims to refer to specific components. Those skilled in the art should understand that vehicle manufacturers may use different nouns to refer to the same component. This specification and claims do not use the difference in nouns as a way to distinguish components, but use the difference in the functions of the components as the criterion for distinction. As mentioned throughout the specification and claims, "including" or "comprising" is an open term, so it should be understood as "including but not limited to". The preferred embodiment of the present invention will be described later, but the description is based on the general principles of the specification and is not used to limit the scope of the present invention. The scope of protection of the present invention shall be based on the definition of the claims attached thereto.

[0089] It can be known from the description of the above embodiments that those skilled in the art can clearly understand that the present invention can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present invention can be essentially or partly contributed to the prior art in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in various embodiments of the present invention or certain parts of the embodiments.

[0090] The present invention can be used in many general or special purpose computing system environments or configurations, such as: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics devices, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like.

[0091] The present invention may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present invention may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0092] In the description of this specification, the description with reference to the terms "one embodiment", "example", "specific example", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.

[0093] In addition, the technical solutions between the various embodiments of the present invention can be combined with each other, but it must be based on the fact that ordinary technicians in the field can implement it. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by the present invention.

[0094] In several embodiments provided by the present invention, it should be understood that the disclosed apparatus and method can also be implemented in other ways. The apparatus embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the apparatus, method and computer program product according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, program segment or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0095] In addition, the functional modules in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.

[0096] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk. It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variation thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus that includes a list of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element.

[0097] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A third-party platform HTTP callback distribution method, characterized in that: include: Determine the unique identifier of the business object based on the request and response between the platform interface and the third-party interface, or based on the request and response between the application and the platform interface; Based on the Java Agent principle, HTTP request interception is performed, and the current request is matched according to the URL matching rules of the platform interface. The unique identifier of the business object is read from the request or response of the platform interface, and the unique identifier of the business object is sent to the callback distribution service. The callback distribution service receives all callback requests from the third-party platform, matches the current request according to the URL matching rule of the third-party interface, reads the unique identifier of the business object, and distributes the callback request to the platform test environment if the unique identifier of the business object comes from the HTTP request interception, otherwise distributes it to the platform production environment; When the platform's production environment and test environment use the same set of App Key and App Secret to connect to a third-party platform, add a callback distribution rule configuration system, HTTP request interception Agent, and callback distribution service based on existing technologies; Callback distribution rule configuration system, configure callback distribution rules; a callback distribution rule consists of 4 parts, namely: (1) The URL matching rule of interface A adopts the Ant-Style Path pattern matching rule; (2) Configure a Groovy script that reads the unique identifier of the business object from the request or response of interface A; (3) Configure the URL matching rule of interface A" and use the Ant-Style Path pattern matching rule; (4) Configure a Groovy script to read the unique identifier of the business object from the request of interface A.

2. The third-party platform HTTP callback distribution method according to claim 1, characterized in that: In the requests and responses of the platform interface and the third-party interface, if there is a field that matches the two calls, that is, it indicates that the two calls process the same business object, then the field is called the business object unique identifier.

3. The third-party platform HTTP callback distribution method according to claim 1, characterized in that: In the request and response between the application and the platform interface, if there is a field that matches the two calls, that is, it identifies that the two calls process the same business object, then the field is called the business object unique identifier.

4. The third-party platform HTTP callback distribution method according to claim 1, characterized in that: The URL matching rules of the platform interface are specifically: using Ant-Style Path pattern matching rules; The URL matching rule of the third-party interface is specifically: using the Ant-Style Path pattern matching rule.

5. The third-party platform HTTP callback distribution method according to claim 4, characterized in that: The Ant-Style Path mode uses the path matching mode defined by Apache Ant and uses wildcards for matching.

6. The third-party platform HTTP callback distribution method according to claim 1, characterized in that: Based on the Java Agent principle, HTTP request interception is performed and the current request is matched according to the URL matching rules of the platform interface. If the match is successful, the Groovy script that reads the unique identifier of the business object is executed on the request, and the unique identifier of the business object is sent to the callback distribution service. The function of the Groovy script is to obtain the unique identifier of the business object from the HTTP request or response object without recompiling the code or restarting the service.

7. The third-party platform HTTP callback distribution method according to claim 1, characterized in that: The callback distribution service receives all callback requests from the third-party platform, matches them with the current request according to the URL matching rules of the third-party interface, and if the match is successful, executes the Groovy script that reads the unique identifier of the business object for the request. If the unique identifier of the business object comes from the HTTP request interception, the callback request is distributed to the platform test environment, otherwise it is distributed to the platform production environment. The function of the Groovy script is to obtain the unique identifier of the business object from the HTTP request or response object without recompiling the code or restarting the service.

8. A third-party platform HTTP callback distribution system, characterized in that: Specifically include: A business object unique identifier determination module, used to determine the business object unique identifier based on the request and response between the platform interface and the third-party interface, or based on the request and response between the application and the platform interface; HTTP request interception module, based on the Java Agent principle, performs HTTP request interception, matches the current request according to the URL matching rule of the platform interface, reads the business object unique identifier from the request or response of the platform interface, and sends the business object unique identifier to the callback distribution service; Callback request distribution module: The callback distribution service receives all callback requests from the third-party platform, matches the current request according to the URL matching rules of the third-party interface, reads the unique identifier of the business object, and distributes the callback request to the platform test environment if the unique identifier of the business object comes from the HTTP request interception, otherwise distributes it to the platform production environment; When the platform's production environment and test environment use the same set of App Key and App Secret to connect to a third-party platform, add a callback distribution rule configuration system, HTTP request interception Agent, and callback distribution service based on existing technologies; Callback distribution rule configuration system, configure callback distribution rules; a callback distribution rule consists of 4 parts, namely: (1) The URL matching rule of interface A adopts the Ant-Style Path pattern matching rule; (2) Configure a Groovy script that reads the unique identifier of the business object from the request or response of interface A; (3) Configure the URL matching rule of interface A" and use the Ant-Style Path pattern matching rule; (4) Configure a Groovy script to read the unique identifier of the business object from the request of interface A.

9. An electronic device, characterized in that: include: A processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the steps of the method described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: It stores a computer program executable by an electronic device, and when the computer program runs on the electronic device, the electronic device executes the steps of the method described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Service processing method and system

    CN103942093A

  • Service callback method and device, service processing method and device, equipment and storage medium

    CN111124431A