A License Control Method and System Based on Service Gateway

By configuring License verification rules on the service gateway, parsing the HTTP request path and calling the License management and control logic interface, the problem of binding License control logic to business scenarios in the microservice architecture is solved, and the flexibility and loose coupling of License management are achieved. Reduced code intrusiveness.

CN114254271BActive Publication Date: 2024-10-01XCMG HANYUN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111553962.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-17
Publication Date
2024-10-01
Estimated Expiration
2041-12-17

AI Technical Summary

Technical Problem

In the microservice architecture, software license control logic is closely bound to business scenarios, resulting in code that is highly intrusive and cannot be flexibly configured, and cannot trigger license expiration verification in non-login scenarios.

Method used

The service gateway with pre-configured license verification rules parses the HTTP request path to determine whether license control is required, and calls the license management and control logic interface to process the request and return success or failure. If successful, it will be forwarded to the back-end business service. If it fails, an error message will be returned. , to achieve the isolation of license verification and business scenarios.

Benefits of technology

It reduces code intrusion and achieves flexibility and loose coupling of license management, so that license verification is not strongly bound to business scenarios, making it easier for products to manage licenses.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114254271B_ABST
    Figure CN114254271B_ABST
Patent Text Reader

Abstract

The present invention discloses a license control method and system based on a service gateway, including: using a service gateway pre-configured with license verification rules to obtain an HTTP request sent by a front end and parse the request path of the HTTP request; judging whether license control is required according to the license verification rules and the request path, if required, calling the license management and control logic interface to process the HTTP request, returning success or failure, if successful, forwarding the request to the back-end business service, if failed, returning an error message; if not required, directly forwarding the request to the back-end business service. Advantages: The license management and control logic is triggered by the service gateway, reducing the code intrusiveness; the license verification and business scenario are isolated, loosely coupled, and do not require strong binding, which is convenient for the product to manage the license.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a service gateway-based license control method and system, belonging to the technical field of license management and control. Background Art

[0002] At present, the technical framework based on microservice architecture has become the mainstream in software development. In the microservice architecture, the microservice gateway is an important component, and all external requests are forwarded to various business services through the service gateway.

[0003] Software license sales are a common business model for commercial software. Customers can only use the software system legally if they purchase software licenses from merchants. As software developers, in order to protect their own rights and interests, it is inevitable to design a license crown holding mechanism during the software development process.

[0004] As software development architecture gradually shifts to microservice architecture, software license control will be made into an independent service, providing interfaces for other services to call or integrate with other service codes, and software license management and control will be triggered by business scenarios.

[0005] The license control triggering scenario is bound to the license control logic and cannot be flexibly configured. For example, to manage the license expiration time, it is required to trigger the verification of whether it has expired when the user logs in. It is necessary to call the license expiration time verification logic when the user logs in, and respond to the customer based on the return value to determine whether the customer can use the system. This implementation method has two defects:

[0006] 1. Code implementation is invasive. To add license functions to completed projects or products, the code must be modified and calls to license management must be added.

[0007] Second, it is bound to the business scenario and cannot be flexibly configured. Each customer must be verified in the same way. For example, the license expiration judgment logic must be triggered at login, and the triggering scenario cannot be flexibly set. Summary of the invention

[0008] The technical problem to be solved by the present invention is to overcome the defects of the prior art and provide a service gateway-based License control method and system.

[0009] In order to solve the above technical problems, the present invention provides a license control method based on a service gateway, comprising:

[0010] Use the service gateway pre-configured with license verification rules to obtain the HTTP request sent by the front end and parse the request path of the HTTP request;

[0011] Determine whether license control is required based on the license verification rules and request path.

[0012] If necessary, call the License management logic interface to process the HTTP request and return success or failure. If it returns success, forward the request to the backend business service. If it returns failure, return error information.

[0013] If not required, the request is directly forwarded to the backend business service.

[0014] Further, the configuration process of the service gateway pre-configured with the license verification rule includes:

[0015] Pre-configure the routes that require license verification through the gateway management end, and send the license verification rules to the memory of the service gateway through the websocket long connection. The service gateway refreshes the license verification rules in the memory in real time to make them take effect in real time.

[0016] Furthermore, it also includes:

[0017] The HTTP request sent by the front end is load balanced by the load balancing device and then sent to the service gateway.

[0018] Furthermore, the license management logic interface is called to process the HTTP request and return success or failure. If it returns success, the request is forwarded to the backend business service. If it returns failure, error information is returned, including:

[0019] Call the license management logic interface to decrypt the HTTP request, obtain the license expiration time, and compare the license expiration time with the server current time. If the server current time is before the license expiration time, the license is considered valid and a success message is returned. Otherwise, the license is considered expired and a failure message is returned. If a success message is returned, request the backend business service. If a failure message is returned, an error message is returned.

[0020] A license control system based on a service gateway, comprising:

[0021] The parsing module is used to obtain the HTTP request sent by the front end and parse the request path of the HTTP request by using the service gateway pre-configured with the license verification rules;

[0022] The judgment module is used to determine whether license control is required based on the license verification rules and request path.

[0023] If necessary, call the License management logic interface to process the HTTP request and return success or failure. If it returns success, forward the request to the backend business service. If it returns failure, return error information.

[0024] If not required, the request is directly forwarded to the backend business service.

[0025] A computer-readable storage medium storing one or more programs, characterized in that the one or more programs include instructions, which, when executed by a computing device, cause the computing device to perform any of the methods described.

[0026] A computing device comprising:

[0027] One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include instructions for executing any of the methods described.

[0028] The beneficial effects achieved by the present invention are:

[0029] The license management and control logic of the present invention is optimized from the previous business trigger to the service gateway trigger, which reduces the code intrusion in implementation and facilitates the integration of the license management module and the existing software products. Since on the service gateway, whether to call the license verification service before forwarding the business request can be configured, the license verification and business scenarios are isolated and loosely coupled, and no strong binding is required, which facilitates the product to manage the license. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 It is the overall flow chart of License management and service gateway of the present invention. DETAILED DESCRIPTION

[0031] The present invention will be further described below in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and cannot be used to limit the protection scope of the present invention.

[0032] like Figure 1 As shown, a service gateway-based license control method includes:

[0033] Use the service gateway pre-configured with license verification rules to obtain HTTP requests from PCs, mobile devices, or third-party applications and parse the request path of HTTP requests;

[0034] Determine whether license control is required based on the license verification rules and request path.

[0035] If necessary, call the License management logic interface to process the HTTP request and return success or failure. If it returns success, forward the request to the backend business service. If it returns failure, return error information.

[0036] If not required, the request is directly forwarded to the backend business service.

[0037] The configuration process of the service gateway pre-configured with the license verification rules includes:

[0038] Pre-configure the routes that require license verification through the gateway management end, and send the license verification rules to the memory of the service gateway through the websocket long connection. The service gateway refreshes the license verification rules in the memory in real time to make them take effect in real time.

[0039] Furthermore, it also includes:

[0040] The HTTP request sent by the front end is load balanced by the load balancing device and then sent to the service gateway.

[0041] Furthermore, the license management logic interface is called to process the HTTP request and return success or failure. If it returns success, the request is forwarded to the backend business service. If it returns failure, error information is returned, including:

[0042] Call the license management logic interface to decrypt the HTTP request, obtain the license expiration time, and compare the license expiration time with the server current time. If the server current time is before the license expiration time, the license is considered valid and a success message is returned. Otherwise, the license is considered expired and a failure message is returned. If a success message is returned, request the backend business service. If a failure message is returned, an error message is returned.

[0043] The PC, mobile terminal or third-party application initiates an HTTP request to the load balancing device; the load balancing device routes the request to the service gateway node according to the load balancing strategy;

[0044] According to the license verification rules, the intercepted request is parsed and matched. If license verification is required, the license management logic is called and success or failure is returned. If failure, an error message is returned. If license management returns success, the request is forwarded to the backend business service.

[0045] Correspondingly, the present invention also provides a service gateway-based License control system, comprising:

[0046] The parsing module is used to obtain the HTTP request sent by the front end and parse the request path of the HTTP request by using the service gateway pre-configured with the license verification rules;

[0047] The judgment module is used to determine whether license control is required based on the license verification rules and request path.

[0048] If necessary, call the License management logic interface to process the HTTP request and return success or failure. If it returns success, forward the request to the backend business service. If it returns failure, return error information.

[0049] If not required, the request is directly forwarded to the backend business service.

[0050] A computer-readable storage medium storing one or more programs, the one or more programs comprising instructions, which when executed by a computing device, cause the computing device to perform any of the methods described.

[0051] A computing device comprising:

[0052] One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include instructions for executing any of the methods described.

[0053] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0054] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0055] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0056] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0057] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A license control method based on a service gateway, characterized in that: include: Use the service gateway pre-configured with license verification rules to obtain the HTTP request sent by the front end and parse the request path of the HTTP request; Determine whether license control is required based on the license verification rules and request path. If necessary, call the License management logic interface to process the HTTP request and return success or failure. If it returns success, forward the request to the backend business service. If it returns failure, return error information. If not necessary, the request is directly forwarded to the backend business service; The configuration process of the service gateway pre-configured with the license verification rules includes: Pre-configure the routes that require license verification through the gateway management end, and send the license verification rules to the memory of the service gateway through the websocket long connection. The service gateway refreshes the license verification rules in the memory in real time to make them take effect in real time.

2. The service gateway-based license control method according to claim 1, characterized in that: Also includes: The HTTP request sent by the front end is load balanced by the load balancing device and then sent to the service gateway.

3. The service gateway-based license control method according to claim 1, characterized in that: The calling of the License management and control logic interface processes the HTTP request and returns success or failure. If it returns success, the request is forwarded to the backend business service. If it returns failure, error information is returned, including: Call the license management logic interface to decrypt the HTTP request, obtain the license expiration time, and compare the license expiration time with the server current time. If the server current time is before the license expiration time, the license is considered valid and a success message is returned. Otherwise, the license is considered expired and a failure message is returned. If a success message is returned, request the backend business service. If a failure message is returned, an error message is returned.

4. A license control system based on a service gateway, characterized in that: include: The parsing module is used to obtain the HTTP request sent by the front end and parse the request path of the HTTP request by using the service gateway pre-configured with the license verification rules; The judgment module is used to determine whether license control is required based on the license verification rules and request path. If necessary, call the License management logic interface to process the HTTP request and return success or failure. If it returns success, forward the request to the backend business service. If it returns failure, return error information. If not necessary, the request is directly forwarded to the backend business service; The configuration process of the service gateway pre-configured with the license verification rules includes: Pre-configure the routes that require license verification through the gateway management end, and send the license verification rules to the memory of the service gateway through the websocket long connection. The service gateway refreshes the license verification rules in the memory in real time to make them take effect in real time.

5. A computer-readable storage medium storing one or more programs, characterized in that: The one or more programs include instructions which, when executed by a computing device, cause the computing device to perform any one of the methods according to claims 1 to 3.

6. A computing device, characterized in that include, One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include instructions for executing any one of the methods according to claims 1 to 3.