CN115276968A - Third-party platform HTTP callback distribution method, system, electronic equipment and storage medium - Google Patents

Third-party platform HTTP callback distribution method, system, electronic equipment and storage medium Download PDF

Info

Publication number
CN115276968A
CN115276968A CN202210805441.3A CN202210805441A CN115276968A CN 115276968 A CN115276968 A CN 115276968A CN 202210805441 A CN202210805441 A CN 202210805441A CN 115276968 A CN115276968 A CN 115276968A
Authority
CN
China
Prior art keywords
callback
platform
request
interface
party
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
CN202210805441.3A
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.)
FAW Group Corp
Original Assignee
FAW Group Corp
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 FAW Group Corp filed Critical FAW Group Corp
Priority to CN202210805441.3A priority Critical patent/CN115276968A/en
Publication of CN115276968A publication Critical patent/CN115276968A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • H04L9/085Secret sharing or secret splitting, e.g. threshold schemes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a third-party platform HTTP callback distribution method, a system, electronic equipment and a storage medium, wherein the method comprises the steps of determining a unique identification of a service object, intercepting an HTTP request, matching with a current request according to a URL (Uniform resource locator) matching rule of a platform interface, and calling back distribution service; and reading the unique identifier of the service object, and distributing the callback request to a platform test environment. The invention is based on the JavaAgent technology, has certain universality, and in Java Web application, 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. In research and development, development and test of related functions of the mall are carried out in a forward mode to SIT, the limitation of a large number of commodity configurations is avoided, a large amount of time cost and economic cost are saved, a Java Agent-based technology injection filter mode does not invade a business system, and a callback distribution mechanism can be suitable for various Java Web-based systems.

Description

Third-party platform HTTP callback distribution method, system, electronic equipment and storage medium
Technical Field
The invention relates to a method and a system for HTTP callback distribution, electronic equipment and a storage medium, in particular to a method and a system for HTTP callback distribution of a third-party platform, electronic equipment and a storage medium.
Background
HTTP callbacks play an important role in the scenarios of Oauth2 authorization, order payment confirmation, user binding establishment, etc., and are all based on the HTTP(s) protocol. When the system is in service interface butt joint with a third party platform, the third party platform generally grants a set of API interface verification serial number App Key and an API Key App Secret, wherein the API interface verification serial number App Key is used as a unique identifier of the system on the third party platform, and the API Key App Secret is used for interface data transmission encryption.
When the system is in a development and test stage, a developer uses an App Key and an App Secret granted by a third-party platform for testing an environment system, and the third-party platform configures a callback address of the system as a callback URL of the testing environment; and when the system completes development test and releases to the production environment, the App Key and App Secret granted by the third-party platform are used for the production environment, and the third-party platform configures the callback address of the system into a callback URL of the production environment. At this time, since the system callback address configured by the third-party platform is the production environment, after the system is released to the production environment, the test environment cannot receive the callback request of the third-party platform and cannot perform full link test without replacing the App Key and the App Secret. Replacing the App Key and the App Secret has high cost in some scenes, for example, a third party platform applying for more App keys and App Secret can charge more cost, and if the third party platform performs a large amount of configuration setting on the current App Key, it is high in cost to copy the configuration setting to the new App Key.
Disclosure of Invention
The invention aims to provide a third-party platform HTTP callback distribution method, a system, electronic equipment and a storage medium, the callback distribution method with certain universality based on Java Agent technology is used in Java Web application, so that a test environment and a production environment can share the same set of API interface verification serial number App Key and API Key App Secret, and the defects in the prior art are overcome.
The invention provides the following scheme:
a third-party platform HTTP callback distribution method comprises the following steps:
determining a unique identification of a business object according to a request and a response between a platform interface and a third-party interface or according to a request and a response between an application and the platform interface;
based on Java Agent principle, HTTP request interception is carried out, matching is carried out with the current request according to the URL matching rule of the platform interface, the unique identification of the business object is read from the request or response of the platform interface, and the unique identification of the business object is sent to callback distribution service;
the callback distribution service receives all callback requests from the third-party platform, matches the callback requests with the current requests according to the URL matching rule of the third-party interface, reads the unique identification of the business object, distributes the callback requests to the platform test environment if the unique identification of the business object is intercepted from the HTTP request, and otherwise, distributes the callback requests to the platform production environment.
Further, in the request and response of the platform interface and the third party interface, if there is a field matching the two calls, i.e. identifying that the two calls are processed by the same service object, the field is called as a unique service object identifier.
Further, in the request and response between the application and the platform interface, if there is a field matching the two calls, that is, identifying that the two calls process the same service object, the field is called as a unique service object identifier.
Further, the URL matching rule of the platform interface specifically includes: adopting an Ant-Style Path mode matching rule;
the URL matching rule of the third party interface specifically includes: and matching rules by adopting an Ant-Style Path mode.
Further, the Ant-Style Path mode adopts a Path matching mode defined by Apache Ant and carries out matching by using wildcards.
Furthermore, based on the Java Agent principle, the HTTP request is intercepted, the matching is carried out according to the URL matching rule of the platform interface and the current request, if the matching is successful, a Groovy script which reads the unique identification of the business object is executed on the request, the unique identification of the business object is sent to the callback distribution service, and the Groovy script is used for acquiring the unique identification of the business object from the HTTP request or the response object under the conditions that codes are not compiled again and the service is not restarted.
Further, the callback distribution service receives all callback requests from a third-party platform, matches the callback requests with the current requests according to the URL matching rules of a third-party interface, if the matching is successful, executes a Groovy script for reading the unique identification of the business object on the requests, if the unique identification of the business object is intercepted by an HTTP request, the callback requests are distributed to a platform test environment, otherwise, the callback requests are distributed to a platform production environment, and the Groovy script is used for acquiring the unique identification of the business object from the HTTP request or the response object under the condition of not recompiling codes and restarting the services.
A third-party platform HTTP callback distribution system specifically comprises:
the service object unique identifier determining module is used for determining the service object unique identifier according to the request and the response between the platform interface and the third-party interface or the request and the response between the application and the platform interface;
the HTTP request intercepting module is used for intercepting an HTTP request based on a Java Agent principle, matching the HTTP request with a current request according to a URL matching rule of a platform interface, reading a unique identification of a business object from a request or a response of the platform interface, and sending the unique identification of the business object to callback distribution service;
and the callback request distribution module receives all callback requests from the third-party platform by the callback distribution service, matches the callback requests with the current requests according to the URL matching rule of the third-party interface, reads the unique identifier of the service object, distributes the callback requests to the platform test environment if the unique identifier of the service object is intercepted by the HTTP request, and otherwise, distributes the callback requests to the platform production environment.
An electronic device, comprising: the system comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus; the memory has stored therein a computer program which, when executed by the processor, causes the processor to perform the steps of the method.
A computer-readable storage medium storing a computer program executable by an electronic device, the computer program, when run on the electronic device, causing the electronic device to perform the steps of the method.
Compared with the prior art, the invention has the following advantages:
the invention is based on Java Agent technology, has certain universality, and enables the test environment and the production environment to share the same set of API interface verification serial number App Key and API Key App Secret in Java Web application.
The invention can properly distribute the callback of the pre-production (UAT) environment to the integrated test (SIT) environment. The development and test of the related functions of the mall in research and development are moved to the SIT, and the method is not limited by a large number of commodity configurations, so that a large amount of time cost and economic cost are saved.
The invention solves the problem that the same App Key and App Secret are used in different environments to carry out callback distribution on a third-party platform, and the technique injection filter mode based on Java Agent does not invade a service system, so that the callback distribution mechanism can be applicable to various systems based on Java Web.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a flowchart of the third party platform HTTP callback distribution method of the present invention.
Fig. 2 is a framework diagram of the third party platform HTTP callback distribution system of the present invention.
Fig. 3 is one of the timing diagram scenarios of the application call platform and the third party interface in the prior art.
Fig. 4 is a second scenario of a timing diagram of an application call platform and a third party interface in the prior art.
FIG. 5 is a flow diagram of a callback distribution method in one possible embodiment.
Fig. 6 is a system architecture diagram of an electronic device.
Detailed Description
The technical solutions of the present invention will be described clearly and completely with reference to the accompanying drawings, and it is to be understood that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. 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.
The noun explains:
app Key: verifying the serial number by the API interface;
app Secret: an API key;
as shown in fig. 1, the method for distributing HTTP callback of third party platform of the present invention includes:
determining a unique identification of the business object according to a request and a response between the platform interface and the third-party interface or according to a request and a response between the application and the platform interface;
based on Java Agent principle, HTTP request interception is carried out, matching is carried out with the current request according to the URL matching rule of the platform interface, the unique identification of the business object is read from the request or response of the platform interface, and the unique identification of the business object is sent to callback distribution service;
and the callback distribution service receives all callback requests from the third-party platform, matches the callback requests with the current requests according to the URL matching rule of the third-party interface, reads the unique identification of the business object, distributes the callback requests to the platform test environment if the unique identification of the business object is intercepted from the HTTP request, and otherwise, distributes the callback requests to the platform production environment.
Preferably, in the request and response of the platform interface and the third party interface, if there is a field matching the two calls, i.e. identifying that the two calls are processed by the same business object, the field is called as the unique business object identifier. The following are exemplary: and calling a request once and calling a response once, wherein the same service object is processed in the two calls, and the field is called as the unique identification of the service object.
Preferably, in the request and response between the application and the platform interface, if there is a field matching the two calls, i.e. identifying that the two calls are processed by the same business object, the field is called the unique identification of the business object.
Preferably, the URL matching rule of the platform interface specifically includes: adopting an Ant-Style Path mode matching rule;
the URL matching rule of the third-party interface specifically includes: and adopting an Ant-Style Path pattern matching rule.
Preferably, the Ant-Style Path pattern uses a Path matching pattern defined by Apache Ant, and carries out matching by using wildcards.
Preferably, based on the Java Agent principle, the HTTP request is intercepted, the URL matching rule of the platform interface is matched with the current request, if the matching is successful, a Groovy script that reads the unique identifier of the service object is executed for the request, and the unique identifier of the service object is sent to the callback distribution service, where the Groovy script is used to obtain the unique identifier of the service object from the HTTP request or the response object without recompiling a code or restarting the service.
Preferably, the callback distribution service receives all callback requests from the third-party platform, matches the callback requests with the current requests according to the URL matching rule of the third-party interface, if the matching is successful, executes a Groovy script for reading the unique identifier of the business object on the requests, if the unique identifier of the business object is intercepted from the HTTP request, distributes the callback requests to the platform test environment, otherwise, distributes the callback requests to the platform production environment, and the Groovy script is used for acquiring the unique identifier of the business object from the HTTP request or the response object under the condition of not recompiling codes and not restarting the services.
For the purposes of simplicity of description, the method steps disclosed in the present embodiment are described as a series of acts, but those skilled in the art will appreciate that the present embodiment is not limited by the order of acts described, as some steps may occur in other orders or concurrently with other steps in accordance with the present embodiment. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
As shown in fig. 2, the architecture diagram of the HTTP callback distribution system of the third party platform of the present invention specifically includes:
the service object unique identification determining module is used for determining the unique identification of the service object according to the request and the response between the platform interface and the third-party interface or the request and the response between the application and the platform interface;
the HTTP request intercepting module is used for intercepting an HTTP request based on a Java Agent principle, matching the HTTP request with a current request according to a URL matching rule of a platform interface, reading a unique identification of a business object from a request or a response of the platform interface, and sending the unique identification of the business object to callback distribution service;
and the callback request distribution module is used for receiving all callback requests from the third-party platform by the callback distribution service, matching the callback requests with the current request according to the URL matching rule of the third-party interface, reading the unique identifier of the business object, and distributing the callback requests to a platform test environment if the unique identifier of the business object is intercepted by the HTTP request, or distributing the callback requests to a platform production environment.
It should be noted that, although only the service object unique identifier determining module, the HTTP request intercepting module and the callback request distributing module are disclosed in the present system, the composition of the present system is not limited to the above basic function modules, but rather, the present invention is to be expressed as: on the basis of the basic function modules, a person skilled in the art may add one or more function modules arbitrarily in combination with the prior art to form an infinite number of embodiments or technical solutions, that is, the present system is open rather than closed, and the protection scope of the claims of the present invention should not be considered to be limited to the disclosed basic function modules because the present embodiment discloses only individual basic function modules. Meanwhile, for convenience of description, the above devices are described as being divided into various units and modules by functions, respectively. Of course, the functions of the units and modules may be implemented in one or more software and/or hardware when implementing the invention.
The above-described system embodiments are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
As shown in fig. 3 and 4, the application calling platform and the third-party interface in the prior art have specific application scenarios: in fig. 3, the application calls the platform interface a, and the platform interface a calls the third-party platform interface a ', and the third-party platform interface a' responds to the platform request after starting the asynchronous processing flow of the service. And after the asynchronous processing flow of the third-party platform is finished, the platform interface A is called, and the processing result is returned to the platform. A field must be arranged in the request message of the application request interface A and the request message of the third-party platform callback platform interface A ' to pair the secondary call, namely, to identify the same service object which is called twice, and the field is called as ' unique service object identification ' in the invention.
In FIG. 4, an application calls platform interface A, followed by a third party platform interface A', which calls platform interface A ". The request or response of the platform interface A and the request of the third party platform for calling the platform interface A ' must have a field for matching the secondary call, namely, the same service object is used for identifying the two times of call processing, and the field is called as ' unique service object identification ' in the invention.
The two callback scenes cover various callback scenes of daily butt joint of a third-party platform, such as order payment callback, user binding and unbinding callback, non-sensitive login callback and the like.
One possible embodiment is shown in fig. 5: when the same set of App Key and App Secret is used for butting a third-party platform in the production environment and the test environment of the platform, a callback distribution rule configuration system, an HTTP request interception Agent and callback distribution services are added on the basis of the prior art.
And the callback distribution rule configuration system is used for configuring the callback distribution rule. One callback distribution rule consists of 4 parts, which are respectively:
(1) The URL matching rule of the interface A adopts an Ant-Style Path mode matching rule;
(2) Configuring a Groovy script which reads the unique identification of the service object from the request or the response of the interface A;
(3) Configuring a URL matching rule of an interface A' and adopting an Ant-Style Path mode matching rule;
(4) And configuring a Groovy script which reads the unique identification of the service object from the interface A' request.
After the rule configuration is completed, distributing the rule to an HTTP request interception Agent and a callback distribution service; the system also provides an interface for querying callback distribution rules for use by the "HTTP request interception Agent" and the "callback distribution service".
The Ant-Style Path schema is a Path matching schema defined by Apache Ant, which is defined as follows:
is it a question of Matching any single character
* Matching 0 or any number of characters
* Match 0 or more directory
The following are exemplary:
the/app/pttern can match/app/pattern and/app/pxtern, but cannot match/app/pwattern and/app/pttern.
Doc matches/cp/radio all doc files under path.
Jsp files under/cp/radio/. Jsp match/cp/radio/and all its subdirectories.
By utilizing an Ant-Style Path mode, a matching rule for the HTTP request Path can be flexibly defined, and an HTTP request Path which needs to be intercepted by an HTTP request interception Agent and a callback distribution service is identified.
Groovy is an agile dynamic language for Java virtual machines, which is used in substantially the same manner as Java and is easily interoperable with Java code. Because the data structures of the request and the response of each interface are different, the Groovy is used in the invention, the above characteristics are mainly considered, a small section of Groovy script can be written for each interface, and the unique identification of the business object is obtained from the HTTP request or response object under the condition of not recompiling codes and restarting services.
HTTP request interception Agent: the HTTP request interception Agent is based on Java Agent technology, is responsible for matching an interface A of a test environment, and reads a unique service object identifier from a request or a response of the interface A. And synchronously starting the HTTP request interception Agent when the test environment is started. And the HTTP request interception Agent reads all callback distribution rules from the callback distribution rule configuration system and injects a filter to the platform to intercept all requests to the platform. Matching the 'URL matching rule of the interface A' of the distribution rule with the current request, if the matching is successful, executing a Groovy script for reading the unique identifier of the service object on the request, and sending the unique identifier of the service object to the callback distribution service.
Callback distribution service: the callback distribution service receives all callback requests from the third-party platform, matches the URL matching rule of the interface A of the distribution rule with the current request, if the matching is successful, executes a Groovy script for reading the unique identification of the business object to the request, if the read unique identification of the business object is sent by the HTTP request interception Agent, distributes the callback requests to the platform test environment, and otherwise, distributes the callback requests to the platform production environment.
The invention also provides an embodiment based on the Internet of vehicles and the E-commerce platform, which comprises the following steps: the car networking cloud platform (our platform) is connected with the e-commerce platform (third platform), the e-commerce platform provides interfaces for the car networking cloud platform, such as commodity information, order purchase and payment, and the car machine (our application) finishes a commodity purchase process by accessing the car networking cloud platform interface. As the commodities relate to multiple suppliers, for example, the flow commodities relate to a telecom operator to open a flow package, the movie and television member commodities relate to a movie and television platform to open a VIP for a user, and each commodity needs to be configured in a large amount or even realized by a code to be available. At present, the environment with a complete commodity system is a Production (PROD) environment and a pre-production (UAT) environment of a vehicle networking cloud platform, and the environment with the integrated test (SIT) does not have a complete commodity system due to the huge workload of commodity configuration.
As shown in fig. 6, the present invention also discloses an electronic device and a storage medium corresponding to the third-party platform HTTP callback distribution method and system:
an electronic device, comprising: the system comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus; the memory has stored therein a computer program that, when executed by the processor, causes the processor to perform the steps of a third party platform HTTP callback distribution method.
A computer readable storage medium storing a computer program executable by an electronic device, which when run on the electronic device causes the electronic device to perform the steps of a third party platform HTTP callback distribution method.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The electronic device includes a hardware layer, an operating system layer running on top of the hardware layer, and an application layer running on top of 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 may be any one or more computer operating systems that implement control of the electronic device through a Process (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 the embodiment of the present invention, the electronic device may be a handheld device such as a smart phone and a tablet computer, or an electronic device such as a desktop computer and a portable computer, which is not particularly limited in the embodiment of the present invention.
The execution main body of the electronic device control in the embodiment of the present invention may be the electronic device, or a functional module capable of calling a program and executing the program in the electronic device. The electronic device may obtain the firmware corresponding to the storage medium, the firmware corresponding to the storage medium is provided by a vendor, and the firmware corresponding to different storage media may be the same or different, which is not limited herein. After the electronic device acquires 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 is burned into the storage medium. The process of burning the firmware into the storage medium can be realized by adopting the prior art, and details are not described in the embodiment of the present invention.
The electronic device may further acquire a reset command corresponding to the storage medium, where the reset command corresponding to the storage medium is provided by a vendor, and the reset commands corresponding to different storage media may be the same or different, and are not limited herein.
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 may respond to the reset command corresponding to 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 prior art, and is not described in detail in the embodiment of the present invention.
It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
It should be noted that certain terms are used throughout the description and following claims to refer to particular components. As one skilled in the art will appreciate, vehicle manufacturers may refer to a component by different names. The present specification and claims do not intend to distinguish between components that differ in name but not function. In the following description and in the claims, the terms "include" and "comprise" are used in an open-ended fashion, and thus should be interpreted to mean "include, but not limited to. The following description is of the preferred embodiment for carrying out the invention, but the description is made for the purpose of general principles of the specification and is not intended to limit the scope of the invention. The scope of the present invention is defined by the appended claims.
From the above description of the embodiments, it is clear to those skilled in the art that the present invention can be implemented by software plus necessary general hardware platform. Based on such understanding, the technical solutions of the present invention may be embodied in the form of software products, which may be stored in a storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and include instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments or some parts of the embodiments.
The invention is operational with numerous general purpose or special purpose computing system environments or configurations, such as: personal computers, server computers, hand-held or portable devices, tablet-type devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like.
The invention may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The invention may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
In the description herein, references to the description of "one embodiment," "an example," "a specific example," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
In addition, the technical solutions in the embodiments of the present invention may be combined with each other, but it must be based on the realization of those skilled in the art, and when the technical solutions are contradictory or cannot be realized, such a combination of technical solutions should not be considered to exist, and is not within the protection scope of the present invention.
In the several embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, 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 and/or flowchart illustration, and combinations of blocks in the block diagrams and/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.
In addition, the functional modules in the embodiments of the present invention may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk, and various media capable of storing program codes. It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising one of 8230; \8230;" 8230; "does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.
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 these modifications or substitutions do not depart from the spirit of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A third-party platform HTTP callback distribution method is characterized by comprising the following steps:
determining a unique identification of a business object according to a request and a response between a platform interface and a third-party interface or according to a request and a response between an application and the platform interface;
based on Java Agent principle, HTTP request interception is carried out, matching is carried out with the current request according to the URL matching rule of the platform interface, the unique identification of the business object is read from the request or response of the platform interface, and the unique identification of the business object is sent to callback distribution service;
the callback distribution service receives all callback requests from the third-party platform, matches the callback requests with the current requests according to the URL matching rule of the third-party interface, reads the unique identification of the business object, distributes the callback requests to the platform test environment if the unique identification of the business object is intercepted from the HTTP request, and otherwise, distributes the callback requests to the platform production environment.
2. The third party platform HTTP callback distribution method of claim 1, wherein in the request and response of the platform interface and the third party interface, if there is a field matching the two calls, i.e. identifying that the same service object is processed by the two calls, the field is called as the unique service object identifier.
3. The third party platform HTTP callback distribution method of claim 1, wherein in the request and response between the application and the platform interface, if there is a field matching the two calls, i.e. it identifies that the same service object is processed by the two calls, then the field is called as the unique service object identifier.
4. The third-party platform HTTP callback distribution method according to claim 1, wherein the URL matching rule of the platform interface specifically is: adopting an Ant-Style Path mode matching rule;
the URL matching rule of the third-party interface specifically includes: and matching rules by adopting an Ant-Style Path mode.
5. The third-party platform HTTP callback distribution method according to claim 4, wherein the Ant-Style Path schema adopts a Path matching schema defined by Apache Ant, and matching is performed by using wildcards.
6. The third-party platform HTTP callback distribution method according to claim 1, wherein based on Java Agent principle, HTTP request interception is performed, matching is performed with the current request according to URL matching rules of a platform interface, if matching is successful, a Groovy script that reads a unique business object identifier is executed for the request, and the unique business object identifier is sent to callback distribution service, and the Groovy script is used for acquiring the unique business object identifier from the HTTP request or the response object without recompiling codes and restarting the service.
7. The third-party platform HTTP callback distribution method according to claim 1, wherein the callback distribution service receives all callback requests from the third-party platform, matches the current request according to a URL matching rule of a third-party interface, if the matching is successful, executes a Groovy script reading a unique identifier of a business object for the request, if the unique identifier of the business object comes from HTTP request interception, distributes the callback request to a platform test environment, otherwise, distributes the callback request to a platform production environment, and the Groovy script is used for acquiring the unique identifier of the business object from the HTTP request or a response object under the condition of not recompiling codes and restarting the service.
8. A third party platform HTTP callback distribution system is characterized by specifically comprising:
the service object unique identifier determining module is used for determining the service object unique identifier according to the request and the response between the platform interface and the third-party interface or the request and the response between the application and the platform interface;
the HTTP request intercepting module is used for intercepting an HTTP request based on a Java Agent principle, matching the HTTP request with a current request according to a URL matching rule of a platform interface, reading a unique identification of a business object from a request or a response of the platform interface, and sending the unique identification of the business object to callback distribution service;
and the callback request distribution module receives all callback requests from the third-party platform by the callback distribution service, matches the callback requests with the current requests according to the URL matching rule of the third-party interface, reads the unique identifier of the service object, distributes the callback requests to the platform test environment if the unique identifier of the service object is intercepted by the HTTP request, and otherwise, distributes the callback requests to the platform production environment.
9. An electronic device, comprising: the system comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus; the memory has stored therein a computer program which, when executed by the processor, causes the processor to perform the steps of the method of 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, which, when run on the electronic device, causes the electronic device to perform the steps of the method of any one of claims 1 to 7.
CN202210805441.3A 2022-07-08 2022-07-08 Third-party platform HTTP callback distribution method, system, electronic equipment and storage medium Pending CN115276968A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210805441.3A CN115276968A (en) 2022-07-08 2022-07-08 Third-party platform HTTP callback distribution method, system, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210805441.3A CN115276968A (en) 2022-07-08 2022-07-08 Third-party platform HTTP callback distribution method, system, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115276968A true CN115276968A (en) 2022-11-01

Family

ID=83766347

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210805441.3A Pending CN115276968A (en) 2022-07-08 2022-07-08 Third-party platform HTTP callback distribution method, system, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115276968A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115842749A (en) * 2022-11-24 2023-03-24 中电信数智科技有限公司 Test environment switching method, device and system

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102902580A (en) * 2011-07-26 2013-01-30 腾讯科技(深圳)有限公司 Program callback method and device
CN103942093A (en) * 2013-01-23 2014-07-23 阿里巴巴集团控股有限公司 Service processing method and system
CN106130868A (en) * 2016-06-02 2016-11-16 腾讯科技(深圳)有限公司 A kind of processing method adjusting back message and queue management system
CN109522286A (en) * 2018-11-22 2019-03-26 北京小米智能科技有限公司 The treating method and apparatus of file system
CN111124431A (en) * 2019-12-31 2020-05-08 贵阳货车帮科技有限公司 Service callback method, service processing method, device, equipment and storage medium
CN111585956A (en) * 2020-03-31 2020-08-25 完美世界(北京)软件科技发展有限公司 Website anti-brushing verification method and device
CN112948272A (en) * 2021-04-16 2021-06-11 西安京迅递供应链科技有限公司 Production environment-based data test system function method and device and related equipment
CN113553260A (en) * 2021-07-22 2021-10-26 工银科技有限公司 Test method, test apparatus, device, medium, and program product
CN114691473A (en) * 2020-12-30 2022-07-01 网联清算有限公司 Test method, test device and electronic equipment

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102902580A (en) * 2011-07-26 2013-01-30 腾讯科技(深圳)有限公司 Program callback method and device
CN103942093A (en) * 2013-01-23 2014-07-23 阿里巴巴集团控股有限公司 Service processing method and system
CN106130868A (en) * 2016-06-02 2016-11-16 腾讯科技(深圳)有限公司 A kind of processing method adjusting back message and queue management system
CN109522286A (en) * 2018-11-22 2019-03-26 北京小米智能科技有限公司 The treating method and apparatus of file system
CN111124431A (en) * 2019-12-31 2020-05-08 贵阳货车帮科技有限公司 Service callback method, service processing method, device, equipment and storage medium
CN111585956A (en) * 2020-03-31 2020-08-25 完美世界(北京)软件科技发展有限公司 Website anti-brushing verification method and device
CN114691473A (en) * 2020-12-30 2022-07-01 网联清算有限公司 Test method, test device and electronic equipment
CN112948272A (en) * 2021-04-16 2021-06-11 西安京迅递供应链科技有限公司 Production environment-based data test system function method and device and related equipment
CN113553260A (en) * 2021-07-22 2021-10-26 工银科技有限公司 Test method, test apparatus, device, medium, and program product

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115842749A (en) * 2022-11-24 2023-03-24 中电信数智科技有限公司 Test environment switching method, device and system

Similar Documents

Publication Publication Date Title
KR100898849B1 (en) Method and apparatus for gifting over a data network
CN113312653A (en) Open platform authentication and authorization method, device and storage medium
KR102024694B1 (en) Decentralized service platform using multiple service nodes based on block chain
CN108718337B (en) Website account login, verification and verification information processing method, device and system
US9173050B2 (en) Application store system and development method using the application store system
CN113449022A (en) Method and device for processing service request
CN111200601B (en) Method and system for butting user and application based on universal transfer service
CN115276968A (en) Third-party platform HTTP callback distribution method, system, electronic equipment and storage medium
CN112448956A (en) Authority processing method and device of short message verification code and computer equipment
CN112699034B (en) Virtual login user construction method, device, equipment and storage medium
CN115694699A (en) Time delay parameter acquisition method and device, electronic equipment and storage medium
CN112818016A (en) API-based real-time and off-line data query method and system
CN110737852A (en) Information processing method, information processing apparatus, electronic device, and medium
CN112734349A (en) Interface generation method, data calling method, device and electronic equipment
CN115408298A (en) Test method, device and system
CN116795673A (en) System testing method and device, electronic equipment and storage medium
CN111581283B (en) Application program processing system based on block chain
CN110968632B (en) Method and system for unified data exchange
CN113935052A (en) API access method and related device
CN113904774A (en) Block chain address authentication method and device and computer equipment
CN112636954A (en) Server upgrading method and device
CN113285915A (en) Registration management method and device and private cloud control server
CN113765876A (en) Report processing software access method and device
CN112311716A (en) Data access control method and device based on openstack and server
CN115396277B (en) Login state management method, device, equipment and storage medium

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