Polymorphic configurable interface encryption method, system, device and medium

Through the polymorphic configurable interface encryption method, the problems of interface data robustness and security in front-end separation architecture are solved, and interface testing of multiple development languages ​​and projects is realized, which improves testing efficiency and user experience.

CN117313131BActive Publication Date: 2025-01-10E-SURFING DIGITAL LIFE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311332035.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-13
Publication Date
2025-01-10
Estimated Expiration
2043-10-13

AI Technical Summary

Technical Problem

The prior art is difficult to ensure the robustness and security of interface data in front-end and back-end separation architecture, especially in a multilingual development environment, resulting in inefficient interface testing and poor user experience.

Method used

Provide a polymorphic configurable interface encryption method, which encrypts interface request information by obtaining the configuration parameters of the interface encryption method and the target interface encryption method, and processes it according to the response data, supporting a variety of development languages ​​and projects. Interface testing.

Benefits of technology

It improves interface testing efficiency, reduces workload, is compatible with interface testing of different projects, and enhances the robustness and security of the interface.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117313131B_ABST
    Figure CN117313131B_ABST
Patent Text Reader

Abstract

The present invention discloses a polymorphic configurable interface encryption method, system, device and medium, including: obtaining configuration parameters of several interface encryption methods; several interface encryption methods at least include a first type of interface encryption method and a second type of interface encryption method; obtaining interface request information and a target interface encryption method; the interface request information includes an interface name, an interface path and request parameters; encrypting the interface request information according to the configuration parameters corresponding to the target interface encryption method to obtain assembly data; calling the interface of the business system according to the assembly data, and processing the response data of the interface according to the configuration parameters corresponding to the target interface encryption method. The embodiment of the present invention can encrypt multiple development languages, improve the efficiency of interface testing, and can be widely used in the field of computer testing technology.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer testing, and in particular to a polymorphic configurable interface encryption method, system, device and medium. Background Art

[0002] With the development of Web technology, the separation of front-end and back-end has become more and more popular. The separation of front-end and back-end enables the back-end to focus on data processing and defining the interfaces required by the front-end, while the front-end is responsible for data display and interaction, which greatly refines the responsibilities of developers and improves development efficiency. But at the same time, it also brings some problems: the correctness of interface data cannot be guaranteed. The front-end calls the interface data of the back-end to render it to the view. Once the data is wrong, it will cause problems with the view and interaction. For example, when you open a shopping APP application, you can see a variety of pages, and you can view the price, discount, details, etc. of the product. These data come from various information returned by the interface provided by the server. If these interfaces are not robust and unstable, the user experience will be poor, such as the page not responding for a long time. In order to improve the robustness of the interface, it is necessary to verify the validity of these interfaces through the interface testing center to minimize the impact. Based on data security considerations, when the interface testing center calls the interface of the business system, it generally encrypts the parameters before transmission.

[0003] Since there are many encryption methods, such as XXTea, MD5, AES, HmacSHA1, etc., each department or even each system may use different encryption algorithms. To call the interface of the business system, the interface provider of the business system and the caller of the interface testing center need to discuss encryption and decryption solutions for each interface, collaborate to complete the encryption work of the interface, and conduct joint testing to achieve the goal. The interface testing center needs to test the interfaces of all the company's projects. Some of these projects are developed in Java and some are developed in other languages. Therefore, the encryption method cannot use one language and needs to support polymorphism. Summary of the invention

[0004] In view of this, the purpose of the embodiments of the present invention is to provide a polymorphic configurable interface encryption method, system, device and medium, which can encrypt multiple front-end and back-end development languages ​​and improve interface testing efficiency.

[0005] On the one hand, an embodiment of the present invention provides a polymorphic configurable interface encryption method, comprising:

[0006] Acquire configuration parameters of several interface encryption methods; the several interface encryption methods at least include a first type of interface encryption method and a second type of interface encryption method;

[0007] Obtaining interface request information and a target interface encryption method; the interface request information includes an interface name, an interface path, and request parameters; the target interface encryption method is one of several interface encryption methods;

[0008] Encrypt the interface request information according to the configuration parameters corresponding to the target interface encryption method to obtain assembly data;

[0009] The interface of the business system is called according to the assembly data, and the response data of the interface is processed according to the configuration parameters corresponding to the target interface encryption method.

[0010] Optionally, if the interface encryption method is a first type interface encryption method, the obtaining of configuration parameters of several interface encryption methods specifically includes:

[0011] Get the type of request parameter processing script through the interactive interface;

[0012] Get the type of response data processing script through the interactive interface.

[0013] Optionally, if the interface encryption method is a second type of interface encryption method, the obtaining of configuration parameters of several interface encryption methods specifically includes:

[0014] Obtain the name information of the interface encryption method through the interactive interface;

[0015] If the encrypted file corresponding to the name information does not exist, obtaining the encrypted file corresponding to the interface encryption method through the interactive interface;

[0016] A security check is performed on the encrypted file. If the encrypted file is safe, the encrypted file is saved to an external resource pool to form an encryption engine.

[0017] Optionally, encrypting the interface request information according to the configuration parameters corresponding to the target interface encryption method specifically includes:

[0018] Determine a target encryption engine according to configuration parameters corresponding to the target interface encryption method;

[0019] The interface request information is distributed to the target encryption engine for encryption.

[0020] Optionally, the target encryption engine includes a first encryption engine, and allocating the interface request information to the target encryption engine for encryption specifically includes:

[0021] Sending a first request to the first encryption engine to determine first attribute information of a first target encrypted file corresponding to the target interface encryption method;

[0022] loading the first target encrypted file according to the first attribute information, and determining a first target encryption method according to the first target encrypted file;

[0023] The interface request information is encrypted according to the first target encryption method.

[0024] Optionally, the target encryption engine includes a second encryption engine, and allocating the interface request information to the target encryption engine for encryption specifically includes:

[0025] Sending a second request to the second encryption engine to determine second attribute information of a second target encrypted file corresponding to the target interface encryption method;

[0026] Load the second target encrypted file according to the second attribute information, and determine the corresponding class and class object according to the second attribute information;

[0027] Traverse all methods of the class and match the corresponding second target encryption method according to the target interface encryption method;

[0028] Traverse all configuration parameters of the second target encryption method, match all the configuration parameters with the parameter objects passed by the page one by one, and store them in a collection after matching;

[0029] Encrypt the parameters passed by all pages in the collection by calling the encryption method of the class.

[0030] Optionally, the interface encryption method further includes:

[0031] Get the script language execution code;

[0032] The encrypted interface request information is dynamically assembled into the script language execution code, and the assembled script language execution code is dynamically executed.

[0033] On the other hand, an embodiment of the present invention provides a polymorphic configurable interface encryption device, comprising:

[0034] at least one processor;

[0035] at least one memory for storing at least one program;

[0036] When the at least one program is executed by the at least one processor, the at least one processor implements the above-mentioned interface encryption method.

[0037] On the other hand, an embodiment of the present invention provides a computer-readable storage medium, in which a program executable by a processor is stored. When the program executable by the processor is executed by the processor, it is used to execute the above-mentioned interface encryption method.

[0038] On the other hand, an embodiment of the present invention provides a polymorphic configurable interface encryption system, including an interface test center and a business system connected to the interface test center; wherein,

[0039] The interface testing center is used to execute the above-mentioned interface encryption method;

[0040] The business system is used to provide an interface and feedback response data to the interface request.

[0041] The implementation of the embodiment of the present invention includes the following beneficial effects: the embodiment first obtains the configuration parameters of multiple interface encryption methods, then obtains the target interface encryption method and interface request information, the target interface encryption method is one of several interface encryption methods, then encrypts the interface request information according to the configuration parameters corresponding to the target interface encryption method, obtains assembly data, and finally calls the interface of the business system according to the assembly data, and processes the response data of the interface according to the configuration parameters corresponding to the target interface encryption method; that is, during the interface testing process, a target interface encryption method that meets the requirements can be selected from multiple interface encryption methods according to the needs, and the interface request information can be automatically encrypted according to the configuration parameters of the target interface encryption method, thereby reducing the workload, being able to encrypt multiple front-end and back-end development languages, being compatible with interface testing work of different projects, and improving interface testing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 It is a structural diagram of a polymorphic configurable interface encryption system provided by an embodiment of the present invention;

[0043] Figure 2 It is a schematic diagram of the steps of a polymorphic configurable interface encryption method provided by an embodiment of the present invention;

[0044] Figure 3 It is an interface diagram of a method for obtaining interface request information and target interface encryption provided by an embodiment of the present invention;

[0045] Figure 4 This is an interface diagram for obtaining configuration parameters of a first type of interface encryption method provided by an embodiment of the present invention;

[0046] Figure 5 It is a schematic diagram of a step flow of obtaining configuration parameters of a second type interface encryption method provided by an embodiment of the present invention;

[0047] Figure 6 This is an interface diagram for obtaining configuration parameters of the second type interface encryption method provided by an embodiment of the present invention;

[0048] Figure 7It is a structural diagram of an interface test center provided by an embodiment of the present invention;

[0049] Figure 8 It is a schematic diagram of the steps of a second type of interface encryption method provided by an embodiment of the present invention;

[0050] Fig. 9 It is a schematic diagram of the steps of another second type interface encryption method provided by an embodiment of the present invention;

[0051] Fig.10 It is a schematic diagram of the steps of another second type interface encryption method provided by an embodiment of the present invention;

[0052] Fig.11 It is a schematic diagram of the steps of another second type interface encryption method provided by an embodiment of the present invention;

[0053] Fig.12 It is a schematic diagram of a step flow of interface integration provided by an embodiment of the present invention;

[0054] Fig.13 is a structural diagram of a synchronization system provided by an embodiment of the present invention;

[0055] Fig.14 is a timing diagram of a specific embodiment provided by an embodiment of the present invention;

[0056] Fig.15 It is a structural block diagram of a polymorphic configurable interface encryption system provided by an embodiment of the present invention;

[0057] Fig.16 It is a structural schematic diagram of a computer device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0058] The present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. The step numbers in the following embodiments are only provided for the convenience of explanation and description, and the order between the steps is not limited in any way. The execution order of each step in the embodiment can be adaptively adjusted according to the understanding of those skilled in the art.

[0059] It should be noted that, although the functional module division is performed in the device schematic diagram and the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in a different order from the module division in the device or the order in the flow chart. The terms "first", "second", etc. in the specification and claims and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described here can be implemented in an order other than those illustrated or described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0060] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0061] Some technical terms in this embodiment are explained below.

[0062] Interface refers to software interface, such as methods and functions developed in programming languages ​​such as Python and Java.

[0063] The client is a program that provides local services to customers, such as web browsers, mobile phones, tablets, computers, etc. The server is responsible for storing resources and providing services to the outside world.

[0064] The dispatch center is used to load files, analyze files, match different encryption engines, etc.

[0065] The monitoring system is used to monitor the system's operating status, interface execution, validity of uploaded files, etc.

[0066] The synchronization system server is deployed in each computer room and is used for data reception, log analysis, cleaning, etc., referred to as the server system.

[0067] The synchronization system client is deployed together with the dispatch center and is used to push data to the server systems of each computer room to complete data interaction. It is referred to as the client system.

[0068] JS (JavaScript) is a scripting language that is used to dynamically update page content, create animation effects, interact with users, etc. It is often used in front-end development.

[0069] Python is a computer programming language that can be used as an extension language in customizable software, providing source code or machine code for all major system platforms. Python syntax and dynamic typing, as well as the nature of an interpreted language, make it a programming language for writing scripts and rapidly developing applications on most platforms.

[0070] Java is an object-oriented programming language that is powerful and easy to use. Java is simple, object-oriented, distributed, robust, secure, platform independent and portable, multi-threaded, dynamic, etc. Java can be used to write desktop applications, Web applications, distributed systems, and embedded system applications.

[0071] The following is a brief description of the application scenario in this embodiment. Figure 1 ,The interface testing center first encrypts the interface request information, and then calls the interface of the business system according to the encrypted interface request information to obtain the response data of the interface request information, and performs subsequent processing on the response data.

[0072] like Figure 2 As shown, an embodiment of the present invention provides a polymorphic configurable interface encryption method, comprising:

[0073] S100, obtaining configuration parameters of several interface encryption methods; the several interface encryption methods include at least a first type of interface encryption method and a second type of interface encryption method.

[0074] It should be noted that the interface encryption method includes but is not limited to JS encryption, Java encryption or Python encryption. The first type of interface encryption method and the second type of interface encryption method represent different types of encryption methods. For example, JS encryption belongs to the first type of interface encryption method, and Java encryption or Python encryption belongs to the second type of interface encryption method.

[0075] Configuration parameters include but are not limited to the script of the encryption method, the class of the encryption method, the method name, the encryption file, etc. The method of obtaining the interface encryption method is determined according to the actual application, for example, it is obtained by inputting through the interactive interface.

[0076] S200, obtaining interface request information and a target interface encryption method; the interface request information includes an interface name, an interface path, and request parameters; the target interface encryption method is one of several interface encryption methods.

[0077] like Figure 3 As shown, the management platform injects several encryption methods obtained from the outside into the request parameter encryption method page to generate data in the drop-down list box, which is convenient for users to enter the interface encryption method and select the corresponding interface encryption method on the page.

[0078] It should be noted that the interface request information includes but is not limited to the interface name, interface path, request parameters, header, etc., which is determined according to the actual application and is not specifically limited in this embodiment.

[0079] S300: Encrypt the interface request information according to the configuration parameters corresponding to the target interface encryption method to obtain assembly data.

[0080] Specifically, first, the configuration parameters corresponding to the target interface encryption method are determined from the configuration parameters corresponding to several configured interface encryption methods according to the target interface encryption method, and then each information in the interface request information is encrypted separately according to the configuration parameters corresponding to the target interface encryption method to obtain assembled data.

[0081] S400: Call the interface of the business system according to the assembled data, and process the response data of the interface according to the configuration parameters corresponding to the target interface encryption method.

[0082] Specifically, the business system includes multiple interfaces with different functions, and the assembly data includes encrypted interface request data. According to the assembly data, the interface corresponding to the business system can be called to obtain the response data of the interface corresponding to the business system, and the response data of the interface can be processed according to the configuration parameters corresponding to the target interface encryption method.

[0083] It should be noted that different target interface encryption methods process interface request information and response data differently.

[0084] If the interface encryption method is the first type of interface encryption method, obtain several configuration parameters of the interface encryption method, including:

[0085] S111, obtaining the type of the request parameter processing script through the interactive interface;

[0086] S112. Obtain the type of the response data processing script through the interactive interface.

[0087] It should be noted that the first type of interface encryption method includes but is not limited to JS encryption, the type of request parameter processing script indicates the type of method for encrypting interface request information, and the type of response data processing script indicates the type of method for encrypting response data. Figure 4 , taking JS encryption as an example for the first type of interface encryption method, open the "Script Configuration" panel, and write JS code in the "Request Parameter Processing Script" input box according to the interface characteristics to encrypt the parameters; write JS code in the "Response Data Processing Script" input box to process the response data after requesting the interface.

[0088] like Figure 5As shown, optionally, if the interface encryption method is the second type of interface encryption method, several configuration parameters of the interface encryption method are obtained, specifically including:

[0089] S121. Obtaining name information of the interface encryption method through the interactive interface;

[0090] S122. If the encrypted file corresponding to the name information does not exist, obtain the encrypted file corresponding to the interface encryption method through the interactive interface;

[0091] S123: Perform security check on the encrypted file. If the encrypted file is safe, save the encrypted file to an external resource pool to form an encryption engine.

[0092] It should be noted that the second type of interface encryption method includes but is not limited to Python encryption or Java encryption. Name information includes but is not limited to the full name of the class, method name, etc.

[0093] See also Figure 6 and Figure 7 , each business system writes the encryption method, packages it into py, jar and other files, logs in to the management platform of the interface test center, fills in the basic information such as the full name of the encryption method class, method name (en), method name (cn), page integration JS, and then uploads the encrypted file. Since an encrypted file may contain multiple encryption methods, if the encryption method has been uploaded, just fill in the file name. The method name (en) is used to find the encryption method, and the method name (cn) is used to select the encryption method on the page. After receiving the upload instruction, the monitoring system checks whether the file has the same name, whether there are any security risks, whether it conflicts with the existing method, whether it will cause system downtime, abnormalities, etc.; if it is correct, it notifies the dispatch center. The encryption method verifies the file to reduce users from uploading malicious files and reduce the risks that may cause unpredictable risks. The dispatch center saves the file in a resource pool mounted outside the system so that when users select different encryption methods, they can be dispatched to different encryption engines. In this way, even if there is a problem with the file, it will not cause abnormal conditions in the system or even downtime.

[0094] In a specific embodiment, taking the first type of interface encryption method as JS encryption as an example, the interface request information is encrypted by the following method. First, refer to Figure 3 , through the interface of the management platform, obtain the interface name, path, various request parameters, header information, etc. entered by the user, select "script encryption" as the encryption method, and click the "Send" button; after the encryption module receives the request, it assembles the request parameters, calls the sandbox, vm.Script and other execution mechanisms, and encrypts the parameters.

[0095] like Figure 8As shown, optionally, the target interface encryption method is the second type of interface encryption method, and the interface request information is encrypted according to the configuration parameters corresponding to the target interface encryption method, specifically including:

[0096] S310, determining a target encryption engine according to configuration parameters corresponding to the target interface encryption method;

[0097] S320: distribute the interface request information to the target encryption engine for encryption.

[0098] The second type of interface encryption method takes Python encryption or Java encryption as an example. First, refer to Figure 3 , through the management platform interface, obtain the interface name, path, various request parameters, header information, etc. entered by the user, select the encryption method, click the "Send" button, and start the interface test; the dispatch center intercepts the request, queries the database configuration table according to the encryption method selected by the user, and finds out the corresponding file name, file path, class full name, and method name (en). Fig. 9 , assign the interface request information to different encryption engines according to the file name suffix. For example: if the file name suffix is ​​jar, it is assigned to the Java engine for processing; if the suffix is ​​py, it is directed to the Python engine for processing. If the file name is special, query the file name and file path from the database configuration table, find the uploaded file, and then analyze the file features. Each language has its own features, and the packaging directory is also different. For example, files with a .class suffix are generally Java engines, and files with a .py suffix are Python engines, and so on.

[0099] like Fig.10 As shown, optionally, the target encryption engine includes a first encryption engine, and the interface request information is distributed to the target encryption engine for encryption, specifically including:

[0100] S321A, sending a first request to the first encryption engine to determine first attribute information of a first target encrypted file corresponding to the target interface encryption method;

[0101] S322A, loading a first target encryption file according to the first attribute information, and determining a first target encryption method according to the first target encryption file;

[0102] S323A. Encrypt the interface request information according to the first target encryption method.

[0103] Specifically, the first encryption engine is a Python engine, and the following steps are specifically included: First, since the dispatch center is developed in Java, the Python engine is requested through Runtime.getRuntime().exec() and other methods; after the request reaches the Python engine, the engine queries the database according to the encryption method selected by the user, and obtains the file name, storage path, and class full name of the uploaded file from the configuration table; then, the file is loaded using features such as __import__ and importlib; then, the encryption method is searched based on reflection mechanisms such as operator.methodcaller or getattr() method; then, the request parameters of the page are passed to the encryption method, and encryption processing is performed on these parameters to complete the encryption work.

[0104] like Fig.11 As shown, optionally, the target encryption engine includes a second encryption engine, and the interface request information is distributed to the target encryption engine for encryption, specifically including:

[0105] S321B, sending a second request to the second encryption engine to determine second attribute information of the second target encrypted file corresponding to the target interface encryption method;

[0106] S322B, loading the second target encrypted file according to the second attribute information, and determining the corresponding class and class object according to the second attribute information;

[0107] S323B, traverse all methods of the class, and match the corresponding second target encryption method according to the target interface encryption method;

[0108] S324B, traverse all configuration parameters of the second target encryption method, match all configuration parameters with the parameter objects passed by the page one by one, and store them in a collection after matching;

[0109] S325B, encrypt the parameters passed by all pages in the collection by calling the encryption method of the class.

[0110] Specifically, the first encryption engine is a Java engine, and the following steps are specifically included: first, after the request reaches the Java engine, the file name, storage path, and full class name are found from the database according to the encryption method selected by the user; then, the file is loaded through ClassLoader, and the corresponding class is found according to the full class name; then, the bean is registered through the Spring container, and then the class object is obtained according to the class name; then, all methods of the class are traversed, and the corresponding encryption method is matched according to the method name (cn) selected by the user on the page; then, all parameters of the encryption method are traversed, and then they are matched one by one with the parameter objects passed by the page, and stored in the collection; Note: In addition to the commonly used HttpServletRequest, HttpServletResponse, and JSONObject parameters, the page may also contain custom classes, which do not exist in the scheduling center, so when traversing the encryption method parameters, the corresponding custom class is found, matched with the custom variables transmitted by the page, converted into an object, and then stored in the collection; then, the encryption method is called through the invoke() of the class to encrypt the parameters.

[0111] like Fig.12 As shown, optionally, the interface encryption method also includes:

[0112] S410, obtaining a script language execution code;

[0113] S420: Dynamically assemble the encrypted interface request information into a script language execution code, and dynamically execute the assembled script language execution code.

[0114] After the Python engine, Java engine and other engines complete the encryption work, the dispatch center returns the encrypted parameters to the page (i.e. the management background), and then integrates them into the "page integration JS".

[0115] For "page integrated JS", if it is a GET request, just splice the encrypted parameters returned by the background with &, and then assemble them behind the url, you can request the business interface. However, some interfaces are POST requests, which need to be sent in BODY format, and some interfaces even require JSON format to be sent, so it is not feasible to splice the encrypted parameters behind the url. In addition, some interfaces require dynamic addition of random values ​​during encryption, and at the same time hope to save the random values ​​in the header, so that the encryption string can be verified by the random values ​​when calling the business interface. If there is no flexible processing mechanism, manual processing is required, that is, the R&D personnel of the management platform need to integrate the corresponding code into js according to the interface requirements, which cannot achieve flexibility. The embodiment of the present invention proposes a "page integrated JS" mechanism to flexibly solve this problem. The platform will provide a default js execution code, and the R&D personnel can add the corresponding js code according to business needs. In this way, after the dispatch center returns various information such as encryption parameters, the encryption parameters can be dynamically assembled into the js code according to different business needs, and then the js code can be dynamically executed through a mechanism similar to eval to achieve the purpose.

[0116] The management platform assembles the request address for the HTTP protocol GET or POST request, obtains the encryption parameters and header information from the "page integration JS", and then calls the business system to complete the encryption test of the interface.

[0117] See also Fig.13 ,Since the systems of various departments are scattered in different computer rooms, considering the cost factor, the computer rooms are not interconnected and can only be accessed in one direction. This requires the deployment of an interface test management platform in each computer room to facilitate the call of various systems in the intranet. This involves the need to synchronize the interface request parameter encryption method to the strategy of each computer room. After the client system detects the uploaded file, it pushes it to the server system of each computer room in turn; after the server system receives the file, it notifies the dispatch center of the computer room; the dispatch center enters the working state, loads the file, matches the corresponding encryption engine program, and completes the registration of the encryption method, thus realizing the distributed deployment of the interface request parameter encryption method.

[0118] In a specific embodiment, see Fig.14, the interface test management platform receives the encrypted file uploaded by the user, and then sends the encrypted file to the dispatch center; the dispatch center checks the validity of the file through the monitoring system, for example, whether the file has the same name, whether there is a security vulnerability, etc., and receives the test results fed back by the monitoring system. If the test result is safe and effective, the encrypted file is saved in the system, and the test result is fed back to the interface test management platform; the interface test management platform receives the encryption method selected by the user and performs automated testing through the dispatch center; the dispatch center analyzes the encryption method and interface request, matches the encryption method selected by the user to the corresponding encryption engine, searches for the encryption method through the reflection mechanism, encrypts the request parameters according to the encryption method found, and feeds back the encrypted results to the management platform; the management platform calls the interface of the business system according to the encrypted results to complete the automated test. In addition, the dispatch center encrypts the configuration parameters such as the file, notifies the client system to synchronize to each computer room, the client system synchronizes the executable file to the client system, and receives the synchronization results fed back by the client system. The synchronization operation of the client system is monitored through the monitoring system.

[0119] The implementation of the embodiment of the present invention includes the following beneficial effects: the embodiment first obtains the configuration parameters of multiple interface encryption methods, then obtains the target interface encryption method and interface request information, the target interface encryption method is one of several interface encryption methods, then encrypts the interface request information according to the configuration parameters corresponding to the target interface encryption method, obtains assembly data, and finally calls the interface of the business system according to the assembly data, and processes the response data of the interface according to the configuration parameters corresponding to the target interface encryption method; that is, during the interface testing process, a target interface encryption method that meets the requirements can be selected from multiple interface encryption methods according to the needs, and the interface request information can be automatically encrypted according to the configuration parameters of the target interface encryption method, thereby reducing the workload, being able to encrypt multiple front-end and back-end development languages, being compatible with interface testing work of different projects, and improving interface testing efficiency.

[0120] like Fig.15 As shown, the embodiment of the present invention also provides a polymorphic configurable interface encryption system, including:

[0121] The first module is used to obtain configuration parameters of several interface encryption methods; the several interface encryption methods at least include a first type of interface encryption method and a second type of interface encryption method;

[0122] The second module is used to obtain interface request information and target interface encryption method; the interface request information includes interface name, interface path and request parameters;

[0123] The third module is used to encrypt the interface request information according to the configuration parameters corresponding to the target interface encryption method to obtain assembly data;

[0124] The fourth module is used to call the interface of the business system according to the assembled data, and process the response data of the interface according to the configuration parameters corresponding to the encryption method of the target interface.

[0125] It can be seen that the contents of the above method embodiments are all applicable to the present system embodiments, the functions specifically implemented by the present system embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0126] In addition, the embodiment of the present application also discloses a computer program product or a computer program, which is stored in a computer-readable storage medium. The processor of the computer device can read the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device performs the above method.

[0127] Similarly, the contents of the above method embodiments are all applicable to the present storage medium embodiments. The functions specifically implemented by the present storage medium embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0128] An embodiment of the present invention further provides a computer-readable storage medium, which stores a program executable by a processor. The program executable by the processor is used to implement the above method when executed by the processor.

[0129] It is understood that all or some steps and systems in the disclosed method above can be implemented as software, firmware, hardware and appropriate combinations thereof. Some physical components or all physical components can be implemented as software executed by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, and the computer-readable medium can include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium). As known to those of ordinary skill in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassette, magnetic tape, disk storage or other magnetic storage device, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0130] Specifically, see Fig.16 The computer device 1600 may include an RF (Radio Frequency) circuit 1610, a memory 1620 including one or more computer-readable storage media, an input unit 1630, a display unit 1640, a sensor 1650, an audio circuit 1660, a short-range wireless transmission module 1670, a processor 1680 including one or more processing cores, and a power supply 1690. Those skilled in the art will appreciate that Fig.16 The device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0131] The RF circuit 1610 can be used for receiving and sending signals during information transmission or calls. In particular, after receiving the downlink information of the base station, it is handed over to one or more processors 1680 for processing; in addition, the data related to the uplink is sent to the base station. Generally, the RF circuit 1610 includes but is not limited to an antenna, at least one amplifier, a tuner, one or more oscillators, a user identity module (SIM) card, a transceiver, a coupler, an LNA (Low Noise Amplifier), a duplexer, etc. In addition, the RF circuit 1610 can also communicate with the network and other devices through wireless communication. Wireless communication can use any communication standard or protocol, including but not limited to GSM (Global System of Mobile communication), GPRS (General Packet Radio Service), CDMA (Code Division Multiple Access), WCDMA (Wideband Code Division Multiple Access), LTE (Long Term Evolution), email, SMS (Short Messaging Service), etc.

[0132] The memory 1620 can be used to store software programs and modules. The processor 1680 executes various functional applications and data processing by running the software programs and modules stored in the memory 1620. The memory 1620 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the device 1600 (such as audio data, a phone book, etc.), etc. In addition, the memory 1620 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 1620 may also include a memory controller to provide the processor 1680 and the input unit 1630 with access to the memory 1620. Although Fig.16 The RF circuit 1610 is shown, but it is understandable that it is not a necessary component of the device 1600 and can be omitted as needed without changing the essence of the invention.

[0133] The input unit 1630 can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control. Specifically, the input unit 1630 may include a touch-sensitive surface 1631 and other input devices 1632. The touch-sensitive surface 1631, also known as a touch display screen or touch pad, can collect user touch operations on or near it (such as operations performed by the user using any suitable object or accessory such as a finger, stylus, etc. on or near the touch-sensitive surface 1631), and drive the corresponding connection device according to a pre-set program. Optionally, the touch-sensitive surface 1631 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch direction, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into touch point coordinates, and then sends it to the processor 1680, and can receive and execute commands sent by the processor 1680. In addition, the touch-sensitive surface 1631 may be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch-sensitive surface 1631, the input unit 1630 may further include other input devices 1632. Specifically, the other input devices 1632 may include, but are not limited to, one or more of a physical keyboard, a function key (such as a volume control key, a switch key, etc.), a trackball, a mouse, a joystick, and the like.

[0134] The display unit 1640 can be used to display information input by the user or information provided to the user and to control various graphical user interfaces of 1600, which can be composed of graphics, text, icons, videos and any combination thereof. The display unit 1640 may include a display panel 1641. Optionally, the display panel 1641 may be configured in the form of an LCD (Liquid Crystal Display), an OLED (Organic Light-Emitting Diode), or the like. Further, the touch-sensitive surface 1631 may be covered on the display panel 1641. When the touch-sensitive surface 1631 detects a touch operation on or near it, it is transmitted to the processor 1680 to determine the type of touch event. Subsequently, the processor 1680 provides a corresponding visual output on the display panel 1641 according to the type of touch event. Although in Fig.16 In the embodiment, the touch-sensitive surface 1631 and the display panel 1641 are implemented as two independent components to implement input and output functions, but in some embodiments, the touch-sensitive surface 1631 and the display panel 1641 can be integrated to implement input and output functions.

[0135] The computer device 1600 may also include at least one sensor 1650, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 1641 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 1641 and / or the backlight when the device 1600 is moved to the ear. As a type of motion sensor, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally three axes), and can detect the magnitude and direction of gravity when stationary, which can be used for applications that recognize the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc. that can also be configured in the device 1600, they will not be repeated here.

[0136] The audio circuit 1660, the speaker 1661, and the microphone 1662 can provide an audio interface between the user and the device 1600. The audio circuit 1660 can transmit the electrical signal converted from the received audio data to the speaker 1661, which is converted into a sound signal for output; on the other hand, the microphone 1662 converts the collected sound signal into an electrical signal, which is received by the audio circuit 1660 and converted into audio data, and then the audio data is processed by the output processor 1680 and sent to another control device through the RF circuit 1610, or the audio data is output to the memory 1620 for further processing. The audio circuit 1660 may also include an earphone jack to provide communication between an external headset and the device 1600.

[0137] The short-distance wireless transmission module 1670 may be a WIFI (wireless fidelity) module, a Bluetooth module, an infrared module, etc. The device 1600 may transmit information with a wireless transmission module provided on a competing device through the short-distance wireless transmission module 1670 .

[0138] The processor 1680 is the control center of the device 1600. It uses various interfaces and lines to connect various parts of the entire control device. By running or executing software programs and / or modules stored in the memory 1620 and calling data stored in the memory 1620, it executes various functions of the device 1600 and processes data, thereby monitoring the control device as a whole. Optionally, the processor 1680 may include one or more processing cores; optionally, the processor 1680 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 1650.

[0139] The device 1600 also includes a power supply 1690 (such as a battery) for supplying power to each component. Preferably, the power supply can be logically connected to the processor 1680 through a power management system, so that the power management system can manage charging, discharging, and power consumption management. The power supply 1690 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.

[0140] Although not shown, the device 1600 may also include a camera, a Bluetooth module, etc., which will not be described in detail here.

[0141] It is understood that all or some steps and systems in the disclosed method above can be implemented as software, firmware, hardware and appropriate combinations thereof. Some physical components or all physical components can be implemented as software executed by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, and the computer-readable medium can include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium). As known to those of ordinary skill in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassette, magnetic tape, disk storage or other magnetic storage device, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0142] like Figure 1 As shown, an embodiment of the present invention provides a polymorphic configurable interface encryption system, including an interface test center and a business system connected to the interface test center; wherein,

[0143] An interface testing center, used to execute the above interface encryption method;

[0144] The business system is used to provide interfaces and feedback response data to interface requests.

[0145] Specifically, for the interface test center, it can be different types of electronic devices, including but not limited to desktop computers, laptops and other terminals. The business system can be different types of electronic devices, including but not limited to desktop computers, laptops, servers, cloud servers and the like.

[0146] It can be seen that the contents of the above method embodiments are all applicable to the present system embodiments, the functions specifically implemented by the present system embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0147] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0148] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0149] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0150] The above is a specific description of the preferred implementation of the present invention, but the invention is not limited to the embodiments. Those skilled in the art may make various equivalent modifications or substitutions without violating the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of this application.

Claims

1. A polymorphic configurable interface encryption method, characterized in that: include: Obtain configuration parameters of several interface encryption methods; the several interface encryption methods include at least a first type of interface encryption method and a second type of interface encryption method; the first type of interface encryption method includes a JS encryption method, and the second type of interface encryption method includes a Python encryption method or a Java encryption method; the configuration parameters of the first type of interface encryption method include a type of a request parameter processing script or a type of a response data processing script, and the configuration parameters of the second type of interface encryption method include an encrypted file; Obtaining interface request information and a target interface encryption method; the interface request information includes an interface name, an interface path, and request parameters; the target interface encryption method is one of several interface encryption methods; Encrypt the interface request information according to the configuration parameters corresponding to the target interface encryption method to obtain assembly data; The interface of the business system is called according to the assembly data, and the response data of the interface is processed according to the configuration parameters corresponding to the target interface encryption method.

2. The interface encryption method according to claim 1, characterized in that: If the interface encryption method is a first type interface encryption method, the step of obtaining configuration parameters of the interface encryption method specifically includes: Get the type of request parameter processing script through the interactive interface; Get the type of response data processing script through the interactive interface.

3. The interface encryption method according to claim 1, characterized in that: If the interface encryption method is a second type of interface encryption method, the step of obtaining configuration parameters of the interface encryption method specifically includes: Obtain the name information of the interface encryption method through the interactive interface; If the encrypted file corresponding to the name information does not exist, obtaining the encrypted file corresponding to the interface encryption method through the interactive interface; A security check is performed on the encrypted file. If the encrypted file is safe, the encrypted file is saved to an external resource pool to form an encryption engine.

4. The interface encryption method according to claim 3, characterized in that: The encrypting the interface request information according to the configuration parameters corresponding to the target interface encryption method specifically includes: Determine a target encryption engine according to configuration parameters corresponding to the target interface encryption method; The interface request information is distributed to the target encryption engine for encryption.

5. The interface encryption method according to claim 4, characterized in that: The target encryption engine includes a first encryption engine, and allocating the interface request information to the target encryption engine for encryption specifically includes: Sending a first request to the first encryption engine to determine first attribute information of a first target encrypted file corresponding to the target interface encryption method; the first attribute information includes a file name, a storage path, and a full class name of the first target encrypted file; loading the first target encrypted file according to the first attribute information, and determining a first target encryption method according to the first target encrypted file; The interface request information is encrypted according to the first target encryption method.

6. The interface encryption method according to claim 4, characterized in that: The target encryption engine includes a second encryption engine, and allocating the interface request information to the target encryption engine for encryption specifically includes: Sending a second request to the second encryption engine to determine second attribute information of a second target encrypted file corresponding to the target interface encryption method; the second attribute information represents the file name, storage path and full class name of the second target encrypted file; Load the second target encrypted file according to the second attribute information, and determine the corresponding class and class object according to the second attribute information; Traverse all methods of the class and match the corresponding second target encryption method according to the target interface encryption method; Traverse all configuration parameters of the second target encryption method, match all the configuration parameters with the parameter objects passed by the page one by one, and store them in a collection after matching; Encrypt the parameters passed by all pages in the collection by calling the encryption method of the class.

7. The interface encryption method according to any one of claims 4 to 6, characterized in that: The interface encryption method also includes: Get the script language execution code; The encrypted interface request information is dynamically assembled into the script language execution code, and the assembled script language execution code is dynamically executed.

8. A polymorphic configurable interface encryption device, characterized in that: include: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method according to any one of claims 1 to 7.

9. A computer-readable storage medium storing a program executable by a processor, characterized in that: The processor-executable program is used to perform the method according to any one of claims 1 to 7 when executed by the processor.

10. A polymorphic configurable interface encryption system, characterized in that: It includes an interface test center and a business system connected to the interface test center; wherein, The interface testing center is used to execute the method described in any one of claims 1 to 7; The business system is used to provide an interface and feedback response data to the interface request.

Citation Information

Patent Citations

  • Interface test method and device, computer equipment and storage medium

    CN107908545A

  • Interface parameter encryption method, device, computer device and storage medium

    CN109255246A