Payment system third-party channel update method and device
By encapsulating the functions of the payment channel application as an interface package and implementing it based on this interface package, it solves the problems of performance degradation and process abnormality when the payment system updates the third-party payment channel, and realizes the update process without restart and traffic switching.
Patent Information
- Application Number
- CN202111361317.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-17
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2041-11-17
AI Technical Summary
When an existing payment system updates a third-party payment channel, it needs to restart the application and isolate traffic, resulting in the risk of overall performance degradation and abnormal process termination.
By determining the functions of the payment channel application, the packaging process is an interface package, and the function is written based on the interface package to avoid restarting and traffic switching of the entire application.
It realizes the update of the third-party channel of the payment system without restarting the server and not performing traffic switching, avoiding the risks of business performance and abnormal processes.
Smart Images

Figure CN114064078B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to software updating technology, and more specifically, to an updating method and device for a third-party channel of a payment system. Background Art
[0002] When a payment system connects to a new payment channel, or a specific business interface of an existing payment channel changes, it is usually necessary to isolate the traffic of the channel service application of the payment system. After the traffic isolation is implemented, the application is shut down, and then redeployed, and restarted after the deployment is completed to remove the business isolation state. During this period, the payment channel will reduce the number of available nodes, which will lead to a decline in overall channel performance.
[0003] To overcome the above problems, the current approach is to deploy a temporary service node on the new server, register the new service with the service center, which will distribute the incoming traffic to this node. The node that needs to be upgraded will then be shut down. After the new version is deployed, the service will be started and registered with the service center, and then the temporary service node will be shut down.
[0004] The above method uses temporary nodes to maintain the overall performance of online services, but it requires the use of new server resources, and there is a possibility of abnormal process termination during switching between different service nodes or starting and stopping service applications, thereby affecting the business. Summary of the invention
[0005] In view of this, the present invention provides the following technical solutions:
[0006] A method for updating a third-party channel of a payment system, comprising:
[0007] Determining a first function of a first payment channel, where the first function includes all functions of the first payment application or a newly added or upgraded function in the first payment channel;
[0008] Encapsulating the first function into a first interface package;
[0009] The implementation of the first function is written based on the first interface package.
[0010] Optionally, encapsulating the first function into a first interface package includes:
[0011] Abstracting the channel service corresponding to the first function into a first interface;
[0012] The first interface is packaged into an executable program package to obtain a first interface package.
[0013] Optionally, the implementation writing of the first function based on the first interface package includes:
[0014] Loading the first interface package into the memory;
[0015] Based on the first interface package loaded into the memory, loading the implementation class of the first interface therein into the virtual machine;
[0016] Obtaining a specific implementation class of the first interface based on the implementation class;
[0017] The implementation of the first function is written based on the specific implementation class.
[0018] Optionally, the implementation writing of the first function based on the specific implementation class includes:
[0019] Based on the specific implementation class, a corresponding instantiation object is generated through class reflection;
[0020] The first function is implemented by calling the content in the first interface through the instantiated object.
[0021] Optionally, loading the first interface package into a memory includes:
[0022] The first interface package is loaded into the memory through file operation.
[0023] Optionally, the step of loading the implementation class of the first interface in the first interface package in the loaded memory into the virtual machine includes:
[0024] Loading the implementation class of the first interface in the first interface package into the virtual machine through a class loader;
[0025] Then obtaining a specific implementation class of the first interface based on the implementation class includes:
[0026] Based on the implementation class, the specific implementation class of the first interface package is obtained through the class loader.
[0027] Optionally, after implementing the first function based on the first interface, the method further includes:
[0028] Verify the business traffic entry into the updated third-party channel through payment routing.
[0029] A device for updating a third-party channel of a payment system, comprising:
[0030] A function determination module, used to determine a first function of a first payment channel application, wherein the first function includes all functions of the first payment application or a newly added or upgraded function in the first payment channel application;
[0031] An encapsulation processing module, used for encapsulating the first function into a first interface packet;
[0032] A function implementation module is used to implement the first function based on the first interface.
[0033] Optionally, the function implementation module includes:
[0034] A first loading module, used for loading the first interface package into a memory;
[0035] A second loading module, configured to load the implementation class of the first interface in the first interface package loaded into the virtual machine based on the first interface package in the loaded memory;
[0036] An implementation class obtaining module, used for obtaining a specific implementation class of the first interface based on the implementation class;
[0037] A function writing module is used to implement the first function based on the specific implementation class.
[0038] Optionally, the function writing module is specifically used to: generate a corresponding instantiated object through class reflection based on the specific implementation class; and implement the first function by calling the content in the first interface through the instantiated object.
[0039] It can be known from the above technical solution that, compared with the prior art, the embodiment of the present invention discloses a method and device for updating a third-party channel of a payment system, the method comprising: determining a first function of a first payment channel application, the first function including all functions of the first payment application or newly added or upgraded functions in the first payment channel application; encapsulating the first function into a first interface package; and implementing the first function based on the first interface. In the process of updating the third-party channel of the payment system, the above implementation solution does not require restarting the entire application because only the first interface package is loaded, and therefore does not require restarting the server; and there is no need to switch traffic during the implementation process, thereby eliminating the impact that the traffic switching process may have on the business. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0041] Figure 1 A flow chart of a method for updating a third-party channel of a payment system disclosed in an embodiment of the present application;
[0042] Figure 2 A flowchart written for implementing the first function disclosed in the embodiment of the present application;
[0043] Figure 3 A flowchart written for implementing the first function disclosed in the embodiment of the present application;
[0044] Figure 4 A flowchart of another method for updating a third-party channel of a payment system disclosed in an embodiment of the present application;
[0045] Figure 5 A schematic diagram of the deployment process of a method for updating a third-party channel of a payment system disclosed in an embodiment of the present application;
[0046] Figure 6 A schematic diagram of the structure of a device for updating a third-party channel of a payment system disclosed in an embodiment of the present application. DETAILED DESCRIPTION
[0047] For the purpose of reference and clarity, the descriptions, abbreviations or acronyms of the technical terms used below are summarized as follows:
[0048] Payment channel: refers to a third-party payment application that provides payment capabilities.
[0049] Channel service: application service responsible for directly interacting with external third-party systems.
[0050] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. 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.
[0051] Figure 1 This is a flow chart of a method for updating a third-party channel of a payment system disclosed in an embodiment of the present application, see Figure 1 As shown, the update method of the third-party channel of the payment system may include:
[0052] Step 101: Determine a first function of a first payment channel application, where the first function includes all functions of the first payment application or a newly added or upgraded function in the first payment channel application.
[0053] The present application is intended to solve the problem that each time a payment system connects to a new payment channel, the corresponding channel service needs to be restarted, which affects the overall performance of online business processing. Therefore, it is necessary to ensure that the access to a new payment channel or the change of the function of an already connected channel is completed without affecting the overall performance of the payment channel. When the third-party channel of the payment system is a new payment channel, the first function includes all functions of the first payment application; when the third-party channel of the payment system is an existing payment channel, the first function includes new or upgraded functions in the first payment channel.
[0054] In this implementation, it is necessary to first identify the first function that the payment channel application needs to connect to, and then to process the determined first function step by step, and finally to complete the update of the third-party channel of the payment system without restarting the service. The first function may include a single type of function, or may include multiple functions of different types.
[0055] Step 102: Encapsulate the first function into a first interface package.
[0056] After determining the first function that the payment channel application needs to connect to, it can be packaged into a standard interface package, that is, the first interface package. Then, only the first interface package can be loaded and processed accordingly, so that the third-party channel of the payment system is updated.
[0057] Step 103: Implement and write the first function based on the first interface package.
[0058] After obtaining the first interface package, different payment channels can implement the business functions corresponding to the first function for the first interface package. Since the interface only describes which functions are available, the specific function implementation depends on the implementation method of the interface. The specific business function implementation is in the specific method. The first interface package file includes the implementation method of the first function.
[0059] Therefore, because the third-party channel service of the payment system only depends on the first interface package but not on the specific implementation, the access work of the new payment channel can be completed without restarting the server.
[0060] In the method for updating the third-party channel of the payment system described in this embodiment, during the updating process of the third-party channel of the payment system, since only the first interface package is loaded, there is no need to restart the entire application, and therefore there is no need to restart the server; and there is no need to switch traffic during the implementation process, thereby eliminating the impact that the traffic switching process may have on the business.
[0061] In the above embodiment, encapsulating the first function into a first interface package may include: abstracting a channel service corresponding to the first function into a first interface; and packaging the first interface into an executable program package to obtain a first interface package.
[0062] Figure 2 A flowchart prepared for implementing the first function disclosed in the embodiment of the present application, combined with Figure 2 As shown, the implementation writing of the first function based on the first interface package may include:
[0063] Step 201: Load the first interface package into the memory.
[0064] Specifically, the first interface package can be loaded into the memory through a file operation, wherein the file operation refers to reading the location information of the first interface package file, parsing the first interface package file, and using variables to save the file information of the first interface package file.
[0065] The location information of the first interface package file may be a relative path, an absolute path, a remote server path, or the like.
[0066] Step 202: Based on the first interface package loaded into the memory, load the implementation class of the first interface therein into the virtual machine.
[0067] The virtual machine can be, but is not limited to, a Java virtual machine JVM. A class can only be called after it is loaded into memory; after loading, when it is called, the internal logic of the class can be used to call the third-party payment channel.
[0068] Step 203: Obtain a specific implementation class of the first interface based on the implementation class.
[0069] The specific implementation class can accurately reflect the first function. Therefore, in this implementation, it is necessary to obtain the specific implementation class of the first interface based on the implementation class, so that the first function written based on the specific implementation class can be more accurate.
[0070] Step 204: Implement the first function based on the specific implementation class.
[0071] Figure 3 See the flowchart written for the first function implementation disclosed in the embodiment of this application. Figure 3 As shown, in one implementation, the implementation writing of the first function based on the specific implementation class may include:
[0072] Step 301: Based on the specific implementation class, generate a corresponding instantiation object through class reflection.
[0073] Step 302: Calling the content in the first interface through the instantiated object to implement the first function.
[0074] Java's reflection mechanism means that in the running state, for any class, you can know the properties and methods of this class; for any object, you can call any of its methods and properties. Therefore, in this application, the corresponding instantiation object can be generated through class reflection.
[0075] In one implementation, the step of loading the implementation class of the first interface in the first interface package loaded into the virtual machine based on the first interface package in the memory may include: loading the implementation class of the first interface in the first interface package into the virtual machine through a class loader. The step of obtaining the specific implementation class of the first interface based on the implementation class may include: obtaining the specific implementation class of the first interface package through the class loader based on the implementation class.
[0076] Figure 4 This is a flow chart of another method for updating a third-party channel of a payment system disclosed in an embodiment of the present application, such as Figure 4 As shown, the method may include:
[0077] Step 401: Determine a first function of a first payment channel, where the first function includes all functions of the first payment application or newly added or upgraded functions in the first payment channel.
[0078] Step 402: Encapsulate the first function into a first interface package.
[0079] Step 403: Implement and write the first function based on the first interface package.
[0080] Step 404: Verify the business flow cut-in of the updated third-party channel through the payment routing.
[0081] In this embodiment, after the implementation of the first function is completed, the business traffic cut-in verification is performed on the updated third-party channel. If the verification passes, the updated third-party channel can be officially put into use and provide the corresponding first function.
[0082] Figure 5 A schematic diagram of the deployment process of a payment system third-party channel update method disclosed in an embodiment of the present application can be combined with Figure 5 Understand the following implementation.
[0083] In a specific implementation, the update method of the third-party channel of the payment system may include:
[0084] 1. Encapsulate the channel business abstract interface jar package. According to the business functions, it is abstracted into: single collection, agreement payment, single payment, batch collection, batch payment, refund, etc.
[0085] 2. Load the jar file into memory through file operations.
[0086] 3. Load the implementation class of the interface in the jar file into the JVM through a custom class loader.
[0087] 4. Get the specific implementation class of the jar file through the class loader.
[0088] 5. Generate the corresponding instantiation object through class reflection.
[0089] 6. Then, through the instance object of this specific implementation class, you can call the methods in this jar to implement the methods implemented in the interface.
[0090] 7. Channel service upgrade completed.
[0091] For the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the order of the actions described, because according to 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 and modules involved are not necessarily required by the present invention.
[0092] The above embodiments disclosed in the present invention describe the method in detail. The method of the present invention can be implemented by various devices. Therefore, the present invention also discloses a device, and a specific embodiment is given below for detailed description.
[0093] Figure 6 This is a schematic diagram of the structure of a third-party channel update device for a payment system disclosed in an embodiment of the present application, see Figure 6 As shown, the updating device 60 of the third-party channel of the payment system may include:
[0094] The function determination module 601 is used to determine the first function of the first payment channel application, where the first function includes all functions of the first payment application or newly added or upgraded functions in the first payment channel application.
[0095] The encapsulation processing module 602 is used to encapsulate the first function into a first interface package.
[0096] The function realization module 603 is used to realize the first function based on the first interface.
[0097] In the updating device for the third-party channel of the payment system described in this embodiment, during the updating process of the third-party channel of the payment system, since only the first interface package is loaded, there is no need to restart the entire application, and therefore there is no need to restart the server; and there is no need to switch traffic during the implementation process, thereby eliminating the impact that the traffic switching process may have on the business.
[0098] In one implementation, the function implementation module includes:
[0099] A first loading module, used for loading the first interface package into a memory;
[0100] A second loading module, configured to load the implementation class of the first interface in the first interface package loaded into the virtual machine based on the first interface package in the loaded memory;
[0101] An implementation class obtaining module, used for obtaining a specific implementation class of the first interface based on the implementation class;
[0102] A function writing module is used to implement the first function based on the specific implementation class.
[0103] In one implementation, the function writing module can be specifically used to: generate a corresponding instantiated object through class reflection based on the specific implementation class; and implement the first function by calling the content in the first interface through the instantiated object.
[0104] The specific implementation of each module in the updating device of the third-party channel of the above-mentioned payment system and other possible implementations can be found in the content introduction of the corresponding part of the method embodiment, which will not be repeated here.
[0105] Any one of the updating devices for the third-party channel of the payment system in the above embodiments comprises a processor and a memory. The function determination module, encapsulation processing module, function realization module, first loading module, second loading module, implementation class acquisition module, function writing module, etc. in the above embodiments are all stored in the memory as program modules, and the processor executes the above program modules stored in the memory to realize corresponding functions.
[0106] The processor includes a kernel, which retrieves the corresponding program module from the memory. One or more kernels can be set, and the processing of the access data can be realized by adjusting the kernel parameters.
[0107] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0108] An embodiment of the present invention provides a storage medium on which a program is stored. When the program is executed by a processor, the method for updating the third-party channel of the payment system described in the above embodiment is implemented.
[0109] An embodiment of the present invention provides a processor, which is used to run a program, wherein the program executes the method for updating the third-party channel of the payment system described in the above embodiment when running.
[0110] Furthermore, this embodiment provides an electronic device, including a processor and a memory, wherein the memory is used to store executable instructions of the processor, and the processor is configured to execute the payment system third-party channel update method described in the above embodiment by executing the executable instructions.
[0111] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0112] It should also 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 "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0113] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0114] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for updating a third-party channel of a payment system, characterized in that: include: Determine a first function of a first payment channel application, where the first function includes all functions of the first payment channel application or a newly added or upgraded function in the first payment channel application; Encapsulating the first function into a first interface package; Implementing and writing the first function based on the first interface package; The step of encapsulating the first function into a first interface package includes: Abstracting the channel service corresponding to the first function into a first interface; Packing the first interface into an executable program package to obtain a first interface package; The implementation of the first function based on the first interface package includes: Loading the first interface package into the memory; Based on the first interface package loaded into the memory, loading the implementation class of the first interface therein into the virtual machine; Obtaining a specific implementation class of the first interface based on the implementation class; Implementing the first function based on the specific implementation class; The implementation writing of the first function based on the specific implementation class includes: Based on the specific implementation class, a corresponding instantiation object is generated through class reflection; Calling the content in the first interface through the instantiated object to implement the first function; The step of loading the implementation class of the first interface in the first interface package based on the loaded memory into the virtual machine includes: Loading the implementation class of the first interface in the first interface package into the virtual machine through a class loader; Then obtaining a specific implementation class of the first interface based on the implementation class includes: Based on the implementation class, the specific implementation class of the first interface package is obtained through the class loader.
2. The method for updating the third-party channel of the payment system according to claim 1, characterized in that: The step of loading the first interface package into the memory comprises: The first interface package is loaded into the memory through file operation.
3. The method for updating the third-party channel of the payment system according to claim 1, characterized in that: After the implementation of the first function based on the first interface is written, the method further includes: Verify the business traffic entry into the updated third-party channel through payment routing.
4. A device for updating a third-party channel of a payment system, characterized in that: include: A function determination module, used to determine a first function of a first payment channel application, wherein the first function includes all functions of the first payment channel application or a newly added or upgraded function of the first payment channel application; The encapsulation processing module is used to encapsulate the first function into a first interface package; wherein the encapsulation processing of the first function into the first interface package includes: abstracting the channel service corresponding to the first function into a first interface; packaging the first interface into an executable program package to obtain the first interface package; A function realization module, used for implementing the first function based on the first interface; characterized in that the function realization module includes: a first loading module, used for loading the first interface package into the memory; a second loading module, used for loading the implementation class of the first interface therein into the virtual machine based on the first interface package loaded into the memory; an implementation class obtaining module, used for obtaining the specific implementation class of the first interface based on the implementation class; a function writing module, used for implementing the first function based on the specific implementation class; wherein the function writing module is specifically used for: generating a corresponding instantiation object through class reflection based on the specific implementation class; and implementing the first function by calling the content in the first interface through the instantiation object; wherein, based on the first interface package loaded into the memory, loading the implementation class of the first interface therein into the virtual machine includes: loading the implementation class of the first interface in the first interface package into the virtual machine through the class loader; then obtaining the specific implementation class of the first interface based on the implementation class includes: obtaining the specific implementation class of the first interface package through the class loader based on the implementation class.
Citation Information
Patent Citations
Payment method and device, server and computer readable storage medium
CN107230058A
Method for loading application and upgrading application and terminal device
CN111095199A