Parameter storage methods, devices, electronic devices, and computer-readable storage media

By filtering and storing the request parameters of the gateway interface, the problem of low scanning coverage in existing technologies is solved, and more comprehensive security attack detection is achieved.

CN117271845BActive Publication Date: 2026-03-13TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-13
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

In existing technologies, filtering the request parameters sent by the client to the general gateway interface results in low scan coverage, leading to incomplete detection of security attacks.

Method used

By obtaining multiple request parameters from the gateway interface, request parameters with the same keywords and matching preset keywords are filtered out and divided into a first set of request parameters with different values ​​and a second set of request parameters with the same values. These are then stored separately to ensure that request parameters for different business scenarios are not missed.

Benefits of technology

It improves the coverage of security scans, ensuring the detection of more potential security threats and enhancing the comprehensiveness of security attack detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117271845B_ABST
    Figure CN117271845B_ABST
Patent Text Reader

Abstract

This application discloses a parameter storage method, apparatus, electronic device, and computer-readable storage medium. In this embodiment, a parameter set including multiple request parameters from a gateway interface is obtained. Each request parameter includes a keyword and its corresponding numerical value. A preset keyword for the gateway interface is obtained, where different numerical values ​​corresponding to the preset keyword represent different business scenarios of the target service of the gateway interface. Request parameters with the same keyword and matching the preset keyword are selected from the parameter set to obtain multiple first request parameters. The numerical values ​​corresponding to the keywords matching the preset keyword in the first request parameters are compared to obtain a first request parameter set with different numerical values ​​and a second request parameter set with the same numerical values. Each request parameter in the first request parameter set is stored, and one request parameter in the second request parameter set is also stored. This embodiment can improve the scanning coverage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of network security technology, specifically to a parameter storage method, apparatus, electronic device, and computer-readable storage medium. Background Technology

[0002] With the development of science and technology, more and more business operations are being implemented through clients and servers. When a client calls the server's Common Gateway Interface (CGI) to perform a business operation, attackers can exploit vulnerabilities to tamper with the request parameters sent by the client to the CGI, and then send the tampered request parameters back to the CGI, thereby launching a security attack on the server. Such attacks could include Cross-Site Scripting (XXS) or SQL Injection (Structured Query Language). Therefore, to ensure security, the server's CGI is scanned for vulnerabilities to identify them, and then defensive measures are implemented.

[0003] During security scanning, because clients send numerous request parameters to the general gateway interface, these parameters are filtered before being tampered with. Currently, the method for filtering request parameters is to store only one of multiple request parameters containing the same keyword; however, this method results in low scan coverage. Summary of the Invention

[0004] This application provides a parameter storage method, apparatus, electronic device, and computer-readable storage medium, which can solve the technical problem of low scan coverage caused by parameter filtering methods.

[0005] A parameter storage method, comprising:

[0006] Retrieve a parameter set including multiple request parameters from the gateway interface. The request parameters include keywords and the corresponding values ​​of the keywords.

[0007] Obtain the preset keywords of the above gateway interface. Different values ​​corresponding to the preset keywords represent different business scenarios of the target business of the above gateway interface.

[0008] Filter the request parameters that have the same keywords and match the preset keywords from the above parameter set to obtain multiple first request parameters;

[0009] The values ​​corresponding to the keywords that match the preset keywords in the first request parameters are compared to obtain a first request parameter set with different values ​​and a second request parameter set with the same values.

[0010] Each request parameter in the first set of request parameters is stored, and one of the request parameters in the second set of request parameters is stored.

[0011] Accordingly, embodiments of this application provide a parameter storage device, including:

[0012] The first acquisition module is used to acquire a parameter set including multiple request parameters from the gateway interface. The request parameters include keywords and the corresponding values ​​of the keywords.

[0013] The second acquisition module is used to acquire the preset keywords of the above-mentioned gateway interface. The different values ​​corresponding to the preset keywords represent different business scenarios of the target business of the above-mentioned gateway interface.

[0014] The parameter filtering module is used to filter out request parameters that have the same keywords and match the preset keywords from the above parameter set, and obtain multiple first request parameters;

[0015] The numerical comparison module is used to compare the numerical values ​​of the keywords that match the preset keywords in the first request parameters to obtain a first request parameter set with different values ​​and a second request parameter set with the same values.

[0016] The parameter storage module is used to store each request parameter in the first request parameter set and to store one of the request parameters in the second request parameter set.

[0017] Optionally, the numerical comparison module is specifically used to perform:

[0018] Based on the keywords that match the preset keywords and the corresponding values ​​of the keywords that match the preset keywords in the first request parameters, the first hash value corresponding to the first request parameters is determined.

[0019] Based on the first request parameters with different first hash values, a set of first request parameters with different values ​​is determined, and based on the first request parameters with the same first hash value, a set of second request parameters with the same value is determined.

[0020] Optionally, the parameter filtering module is specifically used to perform:

[0021] Perform a hash operation on the keywords in the above request parameters to obtain the second hash value corresponding to the above request parameters;

[0022] From the request parameters with the same second hash value, filter out the request parameters corresponding to the keywords that match the preset keywords to obtain multiple first request parameters.

[0023] Optionally, the parameter storage module further includes:

[0024] The module to determine execution is:

[0025] Determine the inclusion relationship of keywords in the request parameters that have different second hash values;

[0026] Based on the aforementioned inclusion relationship, the scanning priority of request parameters that have the aforementioned inclusion relationship is adjusted so that after storing the request parameters with different second hash values, the request parameters that have the aforementioned inclusion relationship are scanned according to the adjusted scanning priority.

[0027] Optionally, the parameter filtering module is specifically used to perform:

[0028] Obtain the business-irrelevant keywords corresponding to the above gateway interfaces;

[0029] Based on the aforementioned business-irrelevant keywords, the keywords in the above request parameters are filtered to obtain the target keywords;

[0030] Perform a hash operation on the target keyword to obtain the second hash value corresponding to the request parameter.

[0031] Optionally, the parameter filtering module is also used to perform:

[0032] From the request parameters with the same second hash value, filter out the request parameters that do not include keywords that match the preset keywords to obtain multiple third request parameters;

[0033] Obtain the target value from the aforementioned third request parameter, whereby the target value is used to characterize the parameter status of the aforementioned third request parameter;

[0034] Based on the above target value, the target third request parameter is selected from multiple third request parameters mentioned above;

[0035] Store the aforementioned target third request parameters.

[0036] Optionally, the first acquisition module is specifically used to execute:

[0037] When a test command is received from the aforementioned gateway interface, a data collection command is generated.

[0038] According to the above collection instructions, collect multiple request parameters, including those from the gateway interface;

[0039] The parameter set is determined based on multiple of the above request parameters.

[0040] Furthermore, this application also provides an electronic device, including a processor and a memory, wherein the memory stores a computer program, and the processor is used to run the computer program in the memory to implement the parameter storage method provided in this application.

[0041] Furthermore, embodiments of this application also provide a computer-readable storage medium storing a computer program adapted for loading by a processor to execute any of the parameter storage methods provided in embodiments of this application.

[0042] Furthermore, this application also provides a computer program product, including a computer program, which, when executed by a processor, implements any of the parameter storage methods provided in this application.

[0043] In this embodiment, a parameter set including multiple request parameters from a gateway interface is first obtained. Each request parameter includes a keyword and its corresponding numerical value. Then, a preset keyword for the gateway interface is obtained; different values ​​corresponding to the preset keyword represent different business scenarios of the target service of the gateway interface. Next, request parameters with the same keyword and matching the preset keyword are selected from the parameter set to obtain multiple first request parameters. Then, the numerical values ​​corresponding to the keywords matching the preset keyword in the first request parameters are compared to obtain a first set of request parameters with different values ​​and a second set of request parameters with the same values. Finally, each request parameter in the first set and one request parameter in the second set are stored.

[0044] In this embodiment, the different values ​​corresponding to the preset keywords represent different business scenarios of the target business of the gateway interface. After obtaining the parameter set, if the keywords in the request parameters are the same and match the preset keywords, it means that the keywords may have different values, which means that the keywords are applied to different business scenarios of the target business of the gateway interface. At this time, the values ​​corresponding to the keywords that match the preset keywords in the first request parameters are compared to obtain a first request parameter set with different values ​​but the same keywords and a second request parameter set with the same values ​​and keywords. Finally, each request parameter in the first request parameter set is stored, and one request parameter in the second request parameter set is stored to avoid filtering out request parameters with different values ​​but the same keywords of the gateway interface, so that some business scenarios of the gateway interface will not be missed during subsequent scanning, thereby improving the scanning coverage. Attached Figure Description

[0045] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0046] Figure 1 This is a schematic diagram of a scenario for the parameter storage procedure provided in an embodiment of this application;

[0047] Figure 2 This is a flowchart illustrating the parameter storage and processing method provided in an embodiment of this application;

[0048] Figure 3 This is a schematic diagram of the query interface provided in an embodiment of this application;

[0049] Figure 4 This is a schematic diagram of the call chain for different business scenarios provided in the embodiments of this application;

[0050] Figure 5 This is a schematic diagram of the parameter configuration interface provided in an embodiment of this application;

[0051] Figure 6 This is a schematic diagram of the interface documentation provided in an embodiment of this application;

[0052] Figure 7 This is a schematic diagram of the scanning interface provided in an embodiment of this application;

[0053] Figure 8 This is a schematic diagram of the test interface provided in an embodiment of this application;

[0054] Figure 9 This is a flowchart illustrating another parameter storage method provided in an embodiment of this application;

[0055] Figure 10 This is a schematic diagram illustrating the changes in the number of request parameters provided in the embodiments of this application;

[0056] Figure 11 This is a schematic diagram of the parameter storage device provided in the embodiments of this application;

[0057] Figure 12 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0058] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0059] This application provides a parameter storage method, apparatus, electronic device, and computer-readable storage medium. The parameter storage apparatus can be integrated into an electronic device, which may be a server or a terminal, etc.

[0060] The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, network acceleration services (Content Delivery Network, CDN), as well as big data and artificial intelligence platforms.

[0061] Furthermore, multiple servers can form a blockchain, with the servers being nodes on the blockchain.

[0062] The terminal can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, or in-vehicle terminal, but is not limited to these. The terminal and server can be connected directly or indirectly via wired or wireless communication, and this application does not impose any restrictions on this.

[0063] This embodiment can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, and assisted driving.

[0064] For example, such as Figure 1As shown, the server can send a parameter set containing multiple request parameters from the gateway interface to the terminal. The terminal then obtains the parameter set containing multiple request parameters from the gateway interface. The request parameters include keywords and their corresponding values. The server obtains the preset keywords of the gateway interface, where different values ​​corresponding to the preset keywords represent different business scenarios of the target business of the gateway interface. The server filters out request parameters from the parameter set that have the same keywords and match the preset keywords, obtaining multiple first request parameters. The server compares the values ​​corresponding to the keywords that match the preset keywords in the first request parameters, obtaining a first request parameter set with different values ​​and a second request parameter set with the same values. The server sends each request parameter in the first request parameter set to the security scanning tool in the terminal, and also sends one request parameter from the second request parameter set to the security scanning tool in the terminal, so that the terminal can scan the received request parameters using the security scanning tool.

[0065] Furthermore, in the embodiments of this application, "multiple" refers to two or more. The terms "first" and "second," etc., in the embodiments of this application are used for distinguishing descriptions and should not be construed as implying relative importance.

[0066] The following sections provide detailed descriptions of each example. It should be noted that the order in which the embodiments are described is not intended to limit the preferred order of the embodiments.

[0067] In this embodiment, the description will be from the perspective of a parameter storage device, which can be integrated into a server or terminal. To facilitate the explanation of the parameter storage method of this application, the following will describe the parameter storage device integrated into a server in detail, that is, the server will be used as the execution subject for detailed explanation.

[0068] Please see Figure 2 , Figure 2 This is a flowchart illustrating a parameter storage method provided in an embodiment of this application. The parameter storage method may include:

[0069] S201. Obtain a parameter set including multiple request parameters from the gateway interface. The request parameters include keywords and the corresponding numerical values ​​of the keywords.

[0070] The multiple request parameters of the gateway interface can refer to the input parameters of the gateway interface. These request parameters can be sent from the client to the gateway interface or from the server to the gateway interface. This embodiment does not limit this.

[0071] A gateway interface is a program running on a server that serves as the interface between a client and the server. It can also refer to the interface between the server and an external application, where the server responds to client requests via external applications.

[0072] The specific type of gateway interface can be set according to the actual situation. For example, the general gateway interface or the Fast Common Gateway Interface (FastCGI) can be used as the gateway interface in this embodiment. This embodiment does not limit this.

[0073] Keywords and their corresponding values ​​can exist as key-value pairs. In this case, the keyword can be the key in the key-value pair, and the corresponding value can be the value in the key-value pair. One keyword corresponds to one value.

[0074] For example, in a request parameter key1 = value1 and key2 = value2, key1 and key2 are keywords, value1 is the value corresponding to the keyword key1, and value2 is the value corresponding to the keyword key2.

[0075] The parameter set can exist in the form of a request form, that is, a request form includes multiple request parameters.

[0076] The server can periodically retrieve a set of parameters, including multiple request parameters for the gateway interface, from the log database. Alternatively, the server can retrieve a set of parameters, including multiple request parameters for the gateway interface, from the log database upon receiving a retrieval command. In this case, the server can display a query interface, which includes input controls. In response to input operations on the input controls, the server generates a retrieval command, which includes an identifier for at least one gateway interface. The server then retrieves multiple request parameters for the gateway interface corresponding to the identifier from the log database.

[0077] Alternatively, the retrieval command can also include the identifier of the gateway interface's request form; for example, the query interface could be like this: Figure 3 As shown, "req" represents a request form, which includes request parameters. Once the request form is obtained, the request parameters of the gateway interface can be retrieved.

[0078] However, when there are multiple versions of the gateway interface, if the server retrieves the parameter set from the log database periodically or when it receives a retrieval command, it cannot guarantee that the retrieved parameter set is the parameter set of the test version (that is, the latest version of the gateway interface that is about to be released). Therefore, it cannot guarantee that the request parameters affected by the modification of the gateway interface can be retrieved, and it cannot be determined whether the filtering of the parameter set has been completed after the test version is released.

[0079] Therefore, in order to more accurately obtain the parameter set of the gateway interface for the test version and follow up on the release process of the test version, in some embodiments, a parameter set including multiple request parameters of the gateway interface is obtained, including:

[0080] When a test command is received from the gateway interface, a data collection command is generated;

[0081] According to the collection instructions, collect multiple request parameters, including those from the gateway interface;

[0082] The parameter set is determined based on multiple request parameters.

[0083] In this embodiment, when testing the gateway interface, a collection command can be generated to collect a parameter set including multiple request parameters of the gateway interface. That is, in this embodiment, the gateway interface is tested while the request parameters of the gateway interface are collected, so that not only can the parameter set of the gateway interface of the test version be accurately obtained, but also the release process of the test version can be followed more accurately.

[0084] S202. Obtain the preset keywords of the gateway interface. Different values ​​corresponding to the preset keywords represent different business scenarios of the target business of the gateway interface.

[0085] The target business of a gateway interface can refer to the business implemented through the gateway interface. Since a business typically has multiple business scenarios, the call chain of the server in the gateway interface will be different for different business scenarios of the target business; that is, the logic executed by the server in the gateway interface will be different.

[0086] For example, such as Figure 4 As shown, the target business is securities business, which includes account opening and stock buying scenarios. The call chain for the account opening scenario is call chain 1, and the call chain for the stock buying scenario is call chain 2. When key1 equals value1, the server executes call chain 1 in the gateway interface, and when key1 equals value2, the server executes call chain 2 in the gateway interface.

[0087] Therefore, when different business scenarios of the target business use the same keyword but different numerical representations, the same keyword can be set as a preset keyword so that after obtaining the request parameters, it can be determined whether the request parameters include the same keyword as the preset keyword.

[0088] Optionally, the server can display a parameter configuration interface, which includes a keyword input control. In response to input from the keyword input control, the server generates an interface document containing preset keywords for the gateway interface. The server parses the interface document to obtain the preset keywords for the gateway interface. The parameter configuration interface can be configured as follows: Figure 5 As shown, the module name is the identifier of the gateway interface. The interface documentation can be found as follows: Figure 6 As shown.

[0089] Optionally, the parameter configuration interface may also include a parameter query control. The server can respond to triggering operations on the parameter query control by displaying preset keywords, such as... Figure 5 As shown.

[0090] S203. Select request parameters with the same keyword and matching the preset keyword from the parameter set to obtain multiple first request parameters.

[0091] After obtaining the parameter set and preset keywords, the server can compare the keywords in the request parameters in the parameter set. If there are request parameters containing the same keyword, it can then filter out the request parameters that match the preset keywords from the request parameters containing the same keyword.

[0092] For example, request parameter 1 is "key1=value1, key2=value2, key3=value3", request parameter 2 is "key1=value1, key2=value2, key3=value4", and request parameter 3 is "key1=value1, key2=value2, key4=value5". Since request parameter 1 and request parameter 2 contain the same keywords key1, key2, and key3, request parameter 1 and request parameter 2 are filtered out first. Then, it is checked whether the keywords key1, key2, and key3 are preset keywords. Assuming that key3 is a preset keyword, that is, key3 is a keyword that matches the preset keyword, then request parameter 1 and request parameter 2 are used as the first request parameter.

[0093] It should be understood that request parameters with the same keyword and matching the preset keyword can be request parameters that have at least one keyword that matches the preset keyword among the same keywords.

[0094] For example, request parameter 1 is "key1=value1, key2=value2, key3=value3", and request parameter 2 is "key1=value1, key2=value2, key3=value4". When key3 is a preset keyword, request parameter 1 and request parameter 2 include three identical keywords, namely key1, key2, and key3. One of the three identical keywords is key3, which matches the preset keyword. If request parameter 1 and request parameter 2 contain identical keywords key1 and key2 that do not match the preset keyword, then request parameter 1 and request parameter 2 are the first request parameters.

[0095] When key1, key2, and key3 are all preset keywords, all three identical keywords are keywords that match the preset keywords. In this case, there are no identical keywords in request parameter 1 and request parameter 2 that do not match the preset keywords, and request parameter 1 and request parameter 2 are the first request parameters.

[0096] The process of selecting request parameters from the parameter set that have the same keyword and match the preset keyword to obtain multiple first request parameters can be as follows:

[0097] The process begins by retrieving a request parameter from the parameter set as the target request parameter. Then, the keywords in the target request parameter are compared sequentially with the keywords of other request parameters in the parameter set to obtain request parameters that contain the same keywords as the target request parameter. These request parameters that contain the same keywords as the target request parameter are also retrieved from the parameter set. Finally, the process returns to retrieving a request parameter from the parameter set as the target request parameter, and continues until all request parameters in the parameter set have been retrieved.

[0098] After finding request parameters containing the same keyword, the first request parameter that matches the preset keyword is then selected from the request parameters with the same keyword.

[0099] However, when the parameter set includes a large number of request parameters and / or a single request parameter has many keywords, obtaining the first request parameter using this method is slow and takes a long time.

[0100] Therefore, in order to obtain the first request parameters more quickly, in some embodiments, request parameters with the same keywords and matching preset keywords are filtered from the parameter set to obtain multiple first request parameters, including:

[0101] Perform a hash operation on the keywords in the request parameters to obtain the second hash value corresponding to the request parameters;

[0102] From the request parameters with the same second hash value, filter out the request parameters corresponding to the keywords that match the preset keywords to obtain multiple first request parameters.

[0103] If the keywords in the request parameters are the same, the corresponding second hash values ​​of the request parameters will also be the same. Therefore, by comparing the second hash values ​​of the request parameters, it can be determined whether the keywords in multiple request parameters are the same. This eliminates the need to compare the keywords in the request parameters one by one, speeding up the process of obtaining request parameters containing the same keywords. As a result, the first request parameter can be obtained more quickly, reducing the time spent.

[0104] It should be noted that the server can calculate the second hash value of the request parameter using the Message-Digest Algorithm (MD5), or the server can calculate the second hash value of the request parameter using the Secure Hash Algorithm (SHA1). This embodiment does not limit the specific method used.

[0105] For request parameters with the same second hash value but not including keywords that match the preset keyword, i.e., for multiple third request parameters, one can be randomly selected for storage.

[0106] For example, if request parameter 1 is "key1=value1, key2=value2, key3=value3" and request parameter 2 is "key1=value1, key2=value2, key3=value3", and key1, key2, and key3 are not preset keywords, then the second hash value of request parameter 1 and the second hash value of request parameter 2 are the same. However, neither request parameter 1 nor request parameter 2 includes keywords that match the preset keywords. Therefore, both request parameter 1 and request parameter 2 are third request parameters.

[0107] Optionally, in order to scan the underlying logic of the response to the third request parameters during subsequent scanning, multiple third request parameters can be filtered. Therefore, in some other embodiments, after performing a hash operation on the keywords in the request parameters to obtain the second hash value corresponding to the request parameters, the method further includes:

[0108] From the request parameters with the same second hash value, filter out the request parameters that do not contain keywords that match the preset keyword to obtain multiple third request parameters;

[0109] Obtain the target value from the third request parameter. The target value is used to characterize the parameter status of the third request parameter.

[0110] Based on the target value, filter out the target third request parameter from multiple third request parameters;

[0111] Store the target third request parameters.

[0112] For example, if request parameter 1 is "user=1,0" and request parameter 2 is "user=3,-1", where user represents the account and is not a preset keyword, 3 represents a non-existent account, 0 indicates a normal parameter status, and -1 indicates an abnormal parameter status, then when the server receives request parameter 2, since the account does not exist, the server returns "account does not exist". That is, at this time, the server does not execute the underlying logic of the login process through the gateway interface. However, when the server receives request parameter 1, it responds to request parameter 1 through the gateway interface with a login success response. In this case, the server executes the underlying logic of the login process through the gateway interface.

[0113] Specifically, when the target value is the first value, the parameter status of the third request parameter is characterized as a normal state; when the target value is the second value, the parameter status of the third request parameter is characterized as an abnormal state. If the second hash values ​​are the same, the third request parameter with the target value of the first value is stored as the target third request parameter, and the third request parameter with the target value of the second value is discarded, thereby achieving the filtering of the third request parameter.

[0114] Optionally, the third request parameter with the target value as the second value can be stored. After the scanning of the third request parameter with the target value as the first value is completed, all third request parameters (including the third request parameter with the target value as the second value) can be scanned periodically.

[0115] In this embodiment, for the third request parameter, the third request parameter in the normal state is stored first, and the third request parameter in the abnormal state is discarded, so that the underlying logic of responding to the third request parameter can be scanned during the subsequent scanning process.

[0116] If the second hash values ​​are different, it means that the keywords in the request parameters are different, so the request parameters with different second hash values ​​can be stored.

[0117] However, when there are many request parameters with different second hash values ​​and the scanning time is short, in order to improve scanning efficiency, the inclusion relationship of the keywords included in the request parameters with different second hash values ​​can be determined. Then, based on the inclusion relationship, the scanning priority of the request parameters with inclusion relationships can be adjusted, thereby ensuring that all keywords in the request parameters can be scanned even if the scanning time is short.

[0118] Therefore, in some other embodiments, after performing a hash operation on the keywords in the request parameters to obtain the second hash value corresponding to the request parameters, the method further includes:

[0119] Determine the inclusion relationship of keywords in request parameters that have different second hash values;

[0120] Based on the inclusion relationship, the scanning priority of request parameters that have inclusion relationships is adjusted so that after storing request parameters with different second hash values, the request parameters that have inclusion relationships are scanned according to the adjusted scanning priority.

[0121] The process of adjusting the scanning priority of request parameters that have an inclusion relationship based on the inclusion relationship can be as follows:

[0122] If the fourth request parameter contains the fifth request parameter, then the scanning priority of the fifth request parameter is reduced. The fourth and fifth request parameters are request parameters with different second hash values.

[0123] In other words, among request parameters that have an inclusion relationship, the fifth request parameter is the included request parameter, and the fourth request parameter is the included request parameter.

[0124] For example, if the fifth request parameter is "key1=value1, key2=value2, key3=value3" and the fourth request parameter is "key1=value1, key2=value2, key3=value3, key4=value5", then the fourth request parameter contains the fifth request parameter. That is, the fourth request parameter and the fifth request parameter have an inclusion relationship. Therefore, the scanning priority of the fifth request parameter is reduced. In this way, even if the fifth request parameter is not scanned in a short time because of its lower scanning priority, the fourth request parameter contains all the keywords of the fifth request parameter. Therefore, when the fourth request parameter is scanned, it is equivalent to scanning all the keywords in the fifth request parameter.

[0125] In this embodiment, the scanning priority of request parameters with inclusion relationships is adjusted so that after storing request parameters with different second hash values, the request parameters with inclusion relationships are scanned according to the adjusted scanning priority, so that no included request parameters are missed, while also taking into account scanning efficiency.

[0126] It should be understood that if the included request parameters are not scanned, then after the scan is completed, all request parameters with different second hash values ​​can be scanned periodically.

[0127] In other embodiments, a hash operation is performed on the keywords in the request parameters to obtain a second hash value corresponding to the request parameters, including:

[0128] Retrieve business-irrelevant keywords corresponding to the gateway interface;

[0129] Based on business-irrelevant keywords, filter the keywords in the request parameters to obtain the target keywords;

[0130] Perform a hash operation on the target keyword to obtain the second hash value corresponding to the request parameter.

[0131] The request parameters contain some keywords that are irrelevant to the business logic. If the calculation is performed on these irrelevant keywords, then when the other keywords in the two request parameters are the same but the irrelevant keywords are different, it will cause both request parameters to be stored. However, during the scanning process, the two request parameters will not be found to be different.

[0132] Therefore, in this embodiment, the second hash value is not calculated based on keywords in the request parameters that match business-irrelevant keywords. If the second hash values ​​are different, it can be determined that the difference in the second hash value is caused by other keywords in the request parameters, rather than by business-irrelevant keywords. This avoids storing multiple request parameters with the same other keywords but different business-irrelevant keywords, further reducing the number of stored request parameters, i.e., further reducing the number of filtered request parameters, thereby speeding up subsequent scanning.

[0133] Business-irrelevant keywords could be, for example, the version or identifier of the client sending the request parameters. In this case, the parameter configuration interface can also include an input control for business-irrelevant keywords. The server then retrieves the business-irrelevant keywords in response to a triggering operation on this input control. Furthermore, the server can also display business-irrelevant keywords in response to a triggering operation on the keyword search control, such as... Figure 5 As shown.

[0134] It should be noted that although business-irrelevant keywords are filtered out, the complete request parameters can still be stored during the subsequent storage process, meaning that the stored request parameters include the business-irrelevant keywords.

[0135] S204. Compare the values ​​of the keywords that match the preset keywords in the first request parameters to obtain a first request parameter set with different values ​​and a second request parameter set with the same values.

[0136] If the keywords in the request parameters are the same and match the preset keywords, it means that the keywords may have different values, which means that the keywords are applied to different business scenarios of the target business of the gateway interface. At this time, the values ​​corresponding to the keywords that match the preset keywords in the first request parameters are compared to obtain the first set of request parameters with different values ​​and the second set of request parameters with the same values. This avoids filtering out request parameters with different values ​​but the same keywords from the gateway interface, so that some business scenarios of the gateway interface will not be missed during subsequent scanning, thus improving the scanning coverage.

[0137] For example, if request parameter 1 is "key1=value1, key2=value2, key3=value3", request parameter 2 is "key1=value1, key2=value2, key3=value4", and request parameter 3 is "key1=value1, key2=value2, key3=value3", where key3 is a preset keyword, then request parameter 1, request parameter 2, and request parameter 3 are all first request parameters. Since key3 is a preset keyword, the values ​​corresponding to key3 in request parameter 1 (value3), in request parameter 2 (value4), and in request parameter 3 (value3) are compared to obtain a first request parameter set and a second request parameter set. The first request parameter set includes request parameter 2, and the second request parameter set includes request parameter 1 and request parameter 3.

[0138] When there are many keywords in the first request parameter that match the preset keyword, the values ​​corresponding to the keywords in each first request parameter that match the preset keyword are compared in turn, which is slow.

[0139] To improve comparison speed, in some embodiments, the values ​​corresponding to keywords matching preset keywords in the first request parameters are compared to obtain a first set of request parameters with different values ​​and a second set of request parameters with the same values, including:

[0140] The first hash value corresponding to the first request parameter is determined based on the keyword that matches the preset keyword and the value corresponding to the keyword that matches the preset keyword in the first request parameter.

[0141] Based on the first request parameters with different first hash values, determine the first request parameter set with different values, and based on the first request parameters with the same first hash value, determine the second request parameter set with the same value.

[0142] For example, if request parameter 1 is "key1=value1, key2=value2, key3=value3", request parameter 2 is "key1=value1, key2=value2, key3=value4", and request parameter 3 is "key1=value1, key2=value2, key3=value3", where key3 is a preset keyword, then the first hash value of request parameter 1 and the first hash value of request parameter 3 are calculated based on key3 and value3, and the first hash value of request parameter 2 is calculated based on key3 and value4.

[0143] Then, the first request parameters with different first hash values ​​are grouped into a first request parameter set with different values, and the first request parameters with the same first hash value are grouped into a second request parameter set.

[0144] It should be understood that the first hash value of the first request parameter can also be calculated based on the keywords in the first request parameter and the numerical values ​​corresponding to the keywords that match the preset keywords.

[0145] For example, if request parameter 1 is "key1=value1, key2=value2, key3=value3", request parameter 2 is "key1=value1, key2=value2, key3=value4", and request parameter 3 is "key1=value1, key2=value2, key3=value3", where key3 is a preset keyword, then the first hash value of request parameter 1 and the first hash value of request parameter 3 are calculated based on key1, key2, key3, and value3, and the first hash value of request parameter 2 is calculated based on key1, key2, key3, and value4.

[0146] In this embodiment, a first hash value corresponding to the first request parameter is determined based on the keyword that matches the preset keyword and the corresponding value of the keyword that matches the preset keyword in the first request parameter. Then, by comparing the first hash value, it is determined whether the corresponding value of the keyword that matches the preset keyword in the first request parameter is the same. It is not necessary to compare the corresponding values ​​of the keyword that matches the preset keyword in the first request parameter sequentially, so that the first request parameter set and the second request parameter set can be quickly obtained, thereby speeding up the subsequent scanning speed.

[0147] S205. Store each request parameter in the first request parameter set and store one of the request parameters in the second request parameter set.

[0148] In this embodiment, each request parameter in the first request parameter set is stored, and one of the request parameters in the second request parameter set is stored, thereby achieving the filtering of request parameters.

[0149] If the keywords in the request parameters are the same and match the preset keywords, it means that the keywords may have different values, which means that the keywords are applied to different business scenarios of the target business of the gateway interface. At this time, the values ​​corresponding to the keywords that match the preset keywords in the first request parameters are compared to obtain a first set of request parameters with different values ​​and a second set of request parameters with the same values. Finally, each request parameter in the first set of request parameters and one request parameter in the second set of request parameters are stored to avoid filtering out request parameters with different values ​​but the same keywords from the gateway interface. This ensures that some business scenarios of the gateway interface are not missed during subsequent scanning, thereby improving the scanning coverage.

[0150] For example, if request parameter 1 is "key1=value1, key2=value2, key3=value3", request parameter 2 is "key1=value1, key2=value2, key3=value4", and request parameter 3 is "key1=value1, key2=value2, key3=value3", according to relevant technologies, only one of request parameter 1, request parameter 2, and request parameter 3 is stored, thus omitting the business scenario of key3=value4 or key3=value3.

[0151] In this embodiment, the first request parameter set includes request parameter 2, and the second request parameter set includes request parameter 1 and request parameter 3. Each request parameter in the first request parameter set is stored, and either request parameter 1 or request parameter 3 in the second request parameter set is stored, so that while filtering is implemented, business scenarios where key3=value4 or key3=value3 are not missed.

[0152] In this embodiment, storing the request parameters can refer to storing each request parameter in the first request parameter set and one request parameter in the second request parameter set in a preset spatial location, so that the security scanning tool can obtain the filtered request parameters from the preset spatial location for scanning. Alternatively, in this embodiment, storing the request parameters can refer to directly sending each request parameter in the first request parameter set and one request parameter in the second request parameter set to the security scanning tool.

[0153] After obtaining the filtered request parameters, the security scanning tool can scan the filtered request parameters. In this embodiment, the scanning process of the security scanning tool can be as follows:

[0154] The filtered request parameters are tampered with to obtain the tampered request parameters. The tampered request parameters are then sent to the server's gateway interface. The server returns the data packet corresponding to the tampered request parameters through the gateway interface. The server then uses a security scanning tool to determine whether there are any vulnerabilities based on the data packet and the tampered request parameters.

[0155] The filtered request parameters may include each request parameter in the first request parameter set, one of the request parameters in the second request parameter set, request parameters with different second hash values, and at least one of the target third request parameters.

[0156] Optionally, during the security scanning process, the server can also display a scanning interface, which includes the scanning progress and results. For example, the scanning interface can be as follows: Figure 7 As shown, Figure 7 The URL in the URL can refer to the address of the gateway interface.

[0157] After filtering the request parameters, the number of filtered request parameters is usually small. If the number of filtered request parameters is still large, for example, greater than the preset threshold, it indicates that there may be an error in the filtering process. In this case, the server can perform an alarm operation so that staff can obtain the information.

[0158] When collecting request parameters while testing the gateway interface, it means that the request parameters are filtered at the same time as the gateway interface test. Therefore, when a test command for the gateway interface is received, a scan notification can be generated and then sent to the security scanning tool.

[0159] For example, the test interface can be like this Figure 8 As shown, after the gateway interface is submitted for testing, it can generate a scan notification in response to the trigger operation of the security scanning control, and send the scan notification to the security scanning tool.

[0160] Additionally, when the gateway interface testing is completed and the release phase is reached, the server can check whether the filtering of request parameters has been completed.

[0161] Furthermore, since gateway interface testing and request parameter filtering are performed simultaneously, there will be no situation where many unfiltered request parameters exist. Therefore, the number of request parameters in the parameter set can be obtained in real time. If the number of request parameters is large, an error is confirmed. At this time, the server can perform a prompting operation so that staff can be informed of the error.

[0162] In this embodiment, the filtering and scanning of request parameters are combined with the testing of the gateway interface (integrated with the development pipeline of the gateway interface) to realize the one-stop process of releasing the gateway interface based on DevOps, thereby accelerating the release of the gateway interface.

[0163] As described above, in this embodiment, a parameter set including multiple request parameters from the gateway interface is first obtained. Each request parameter includes a keyword and its corresponding numerical value. Then, a preset keyword for the gateway interface is obtained; different values ​​corresponding to the preset keyword represent different business scenarios of the target service of the gateway interface. Next, request parameters with the same keyword and matching the preset keyword are selected from the parameter set to obtain multiple first request parameters. Then, the numerical values ​​corresponding to the keywords matching the preset keyword in the first request parameters are compared to obtain a first set of request parameters with different values ​​and a second set of request parameters with the same values. Finally, each request parameter in the first set and one request parameter in the second set are stored.

[0164] In this embodiment, the different values ​​corresponding to the preset keywords represent different business scenarios of the target business of the gateway interface. After obtaining the parameter set, if the keywords in the request parameters are the same and match the preset keywords, it means that the keywords may have different values, which means that the keywords are applied to different business scenarios of the target business of the gateway interface. At this time, the values ​​corresponding to the keywords that match the preset keywords in the first request parameters are compared to obtain a first request parameter set with different values ​​but the same keywords and a second request parameter set with the same values ​​and keywords. Finally, each request parameter in the first request parameter set is stored, and one request parameter in the second request parameter set is stored to avoid filtering out request parameters with different values ​​but the same keywords of the gateway interface, so that some business scenarios of the gateway interface will not be missed during subsequent scanning, thereby improving the scanning coverage.

[0165] Based on the methods described in the above embodiments, the following examples will provide further detailed explanations.

[0166] Please see Figure 9 , Figure 9 This is a flowchart illustrating a parameter storage method provided in an embodiment of this application. The parameter storage method may include:

[0167] S901. When a test command is received from the general gateway interface, the server generates a collection command and, based on the collection command, collects multiple request parameters, including those from the general gateway interface, to obtain a parameter set. The request parameters include keywords and the corresponding numerical values.

[0168] The server can retrieve the logs of the general gateway interface from the log database, and then parse the logs to obtain the request parameters of the general gateway interface.

[0169] Optionally, the server can also retrieve time data and IP data corresponding to the general gateway interface from the log database based on the information from the development pipeline of the general gateway interface.

[0170] After parsing the logs, the server can first filter out dirty data initiated by security scanning tools. Since some of the scanning logs of security scanning tools are stored in a log database, filtering can be performed based on special characters of the security scanning tools. That is, request parameters whose IP is the security scanning tool's IP will be filtered out. For example, if the security scanning tool's IP is 127.0.0.1, then request parameters containing 127.0.0.1 will be filtered out, thereby reducing the number of request parameters.

[0171] S902. The server obtains the preset keywords of the general gateway interface. Different values ​​corresponding to the preset keywords represent different business scenarios of the target business of the general gateway interface.

[0172] S903. The server obtains the business-independent keywords corresponding to the general gateway interface, and filters the keywords in the request parameters based on the business-independent keywords to obtain the target keywords.

[0173] S904. The server performs a hash operation on the target keyword to obtain the second hash value corresponding to the request parameter.

[0174] S905. The server selects request parameters from the request parameters with the same second hash value that match the preset keyword, and obtains multiple first request parameters.

[0175] S906. The server determines the first hash value corresponding to the first request parameter based on the keyword that matches the preset keyword and the value corresponding to the keyword that matches the preset keyword in the first request parameter.

[0176] S907. The server determines a set of first request parameters with different values ​​based on the first request parameters with different first hash values, and determines a set of second request parameters with the same value based on the first request parameters with the same first hash value.

[0177] S908. The server stores each request parameter in the first request parameter set and one of the request parameters in the second request parameter set to obtain the filtered request parameters.

[0178] S909. The server determines the inclusion relationship of keywords included in request parameters with different second hash values, and adjusts the scanning priority of the included request parameters according to the inclusion relationship to obtain the adjusted scanning priority.

[0179] S9010. The server stores the request parameters with different second hash values ​​and the adjusted scan priority to obtain the filtered request parameters.

[0180] S9011. The server filters out request parameters that do not contain keywords that match the preset keyword from the request parameters with the same second hash value, and obtains multiple third request parameters.

[0181] S9012. The server obtains the target value from the third request parameter. The target value is used to characterize the parameter status of the third request parameter.

[0182] S9013. The server stores the third request parameter with the target value as the first value as the target third request parameter, and obtains the filtered request parameter. The first value indicates that the parameter status of the third request parameter is normal.

[0183] After obtaining the filtered request parameters, if new filtered request parameters are obtained, and the hash value of the new filtered request parameters is the same as the hash value of the previously filtered request parameters, the new filtered request parameters can be used to overwrite the previously filtered request parameters. That is, the new filtered request parameters are stored and the previously filtered request parameters are deleted, thereby further reducing the number of filtered request parameters.

[0184] Optionally, when the hash value of the new filtered request parameter is the same as the hash value of the previously filtered request parameter, the difference between the time corresponding to the previously filtered request parameter and the time corresponding to the hash value of the new filtered request parameter can be checked. If the difference is greater than a preset difference, the new filtered request parameter will be used to overwrite the previously filtered request parameter.

[0185] In related technologies, filtering request parameters only considers keywords, resulting in a relatively singular dimension. However, in this embodiment, filtering request parameters considers not only keywords but also numerical values, business-irrelevant keywords, and parameter states, enabling more accurate filtering.

[0186] In this embodiment, after obtaining the request parameters, dirty data initiated by the security scanning tool is first filtered out, thereby reducing the number of request parameters. Next, business-irrelevant keywords are filtered, further reducing the number of request parameters. Then, one request parameter from the second request parameter set is stored, and every request parameter from the first request parameter set is stored, further reducing the number of request parameters. Next, the third request parameter in its normal state is stored as the target third request parameter, further reducing the number of request parameters. Finally, the previously filtered request parameters are overwritten with new filtered request parameters, reducing the number of filtered request parameters, thus achieving a multi-dimensional funnel-like filtering process, for example, as... Figure 10 As shown, the number of request parameters has been effectively reduced from tens of thousands to ten.

[0187] S9014. The server uses a security scanning tool to scan the filtered request parameters according to the adjusted scan priority.

[0188] It should be understood that the scanning priority of request parameters can be preset in security scanning tools. If the scanning priority of request parameters is not adjusted, the scanning priority of the filtered request parameters can be the same as the scanning priority set in the security scanning tool. If the scanning priority of request parameters is adjusted, the security scanning tool can scan the request parameters corresponding to the adjusted scanning priority.

[0189] Alternatively, the filtered request parameters may include scan priorities. Security scanning tools can scan the filtered request parameters based on the scan priorities in the filtered request parameters. If the scan priority of the filtered request parameters is adjusted, the scan priority included in the filtered request parameters will be the adjusted scan priority. If the scan priority of the filtered request parameters is not adjusted, the scan priority included in the filtered request parameters will be the unadjusted scan priority.

[0190] For other possible implementation methods and corresponding beneficial effects in this embodiment, please refer to the above-described parameter storage method embodiment. This embodiment is not limited here.

[0191] To facilitate better implementation of the parameter storage method provided in the embodiments of this application, the embodiments of this application also provide an apparatus based on the above parameter storage method. The meanings of the terms used are the same as in the above parameter storage method, and specific implementation details can be found in the descriptions in the method embodiments.

[0192] For example, such as Figure 11 As shown, the parameter storage device may include:

[0193] The first acquisition module 1101 is used to acquire a parameter set including multiple request parameters from the gateway interface. The request parameters include keywords and the corresponding numerical values ​​of the keywords.

[0194] The second acquisition module 1102 is used to acquire preset keywords of the gateway interface. Different values ​​corresponding to the preset keywords represent different business scenarios of the target business of the gateway interface.

[0195] The parameter filtering module 1103 is used to filter out request parameters with the same keywords and matching preset keywords from the parameter set, so as to obtain multiple first request parameters.

[0196] The numerical comparison module 1104 is used to compare the numerical values ​​corresponding to the keywords that match the preset keywords in the first request parameters to obtain a first request parameter set with different numerical values ​​and a second request parameter set with the same numerical values.

[0197] The parameter storage module 1105 is used to store each request parameter in the first request parameter set and to store one of the request parameters in the second request parameter set.

[0198] Optionally, the numerical comparison module 1104 is specifically used to perform:

[0199] The first hash value corresponding to the first request parameter is determined based on the keyword that matches the preset keyword and the value corresponding to the keyword that matches the preset keyword in the first request parameter.

[0200] Based on the first request parameters with different first hash values, determine the first request parameter set with different values, and based on the first request parameters with the same first hash value, determine the second request parameter set with the same value.

[0201] Optionally, the parameter filtering module 1103 is specifically used to perform:

[0202] Perform a hash operation on the keywords in the request parameters to obtain the second hash value corresponding to the request parameters;

[0203] From the request parameters with the same second hash value, filter out the request parameters corresponding to the keywords that match the preset keywords to obtain multiple first request parameters.

[0204] Optionally, the parameter storage module further includes:

[0205] The module to determine execution is:

[0206] Determine the inclusion relationship of keywords in request parameters that have different second hash values;

[0207] Based on the inclusion relationship, the scanning priority of request parameters that have inclusion relationships is adjusted so that after storing request parameters with different second hash values, the request parameters that have inclusion relationships are scanned according to the adjusted scanning priority.

[0208] Optionally, the parameter filtering module 1103 is specifically used to perform:

[0209] Retrieve business-irrelevant keywords corresponding to the gateway interface;

[0210] Based on business-irrelevant keywords, filter the keywords in the request parameters to obtain the target keywords;

[0211] Perform a hash operation on the target keyword to obtain the second hash value corresponding to the request parameter.

[0212] Optionally, the parameter filtering module 1103 is also used to perform:

[0213] From the request parameters with the same second hash value, filter out the request parameters that do not contain keywords that match the preset keyword to obtain multiple third request parameters;

[0214] Obtain the target value from the third request parameter. The target value is used to characterize the parameter status of the third request parameter.

[0215] Based on the target value, filter out the target third request parameter from multiple third request parameters;

[0216] Store the target third request parameters.

[0217] Optionally, the first acquisition module 1101 is specifically used to perform:

[0218] When a test command is received from the gateway interface, a data collection command is generated;

[0219] According to the collection instructions, collect multiple request parameters, including those from the gateway interface;

[0220] The parameter set is determined based on multiple request parameters.

[0221] In practice, each of the above modules can be implemented as an independent entity or can be combined arbitrarily to be implemented as the same or several entities. For the specific implementation methods and corresponding beneficial effects of each of the above modules, please refer to the previous method embodiments, which will not be repeated here.

[0222] This application also provides an electronic device, which may be a server or a terminal, etc. Figure 12 As shown, it illustrates a structural schematic diagram of the electronic device involved in the embodiments of this application, specifically:

[0223] The electronic device may include components such as a processor 1201 with one or more processing cores, a memory 1202 with one or more computer-readable storage media, a power supply 1203, and an input unit 1204. Those skilled in the art will understand that... Figure 12 The electronic device structure shown does not constitute a limitation on the electronic device and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein:

[0224] The processor 1201 is the control center of the electronic device, connecting various parts of the device via various interfaces and lines. It executes computer programs and / or modules stored in the memory 1202, and calls data stored in the memory 1202 to perform various functions and process data. Optionally, the processor 1201 may include one or more processing cores; preferably, the processor 1201 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 1201.

[0225] The memory 1202 can be used to store computer programs and modules. The processor 1201 executes various functional applications and data processing by running the computer programs and modules stored in the memory 1202. The memory 1202 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, computer programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 1202 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 1202 may also include a memory controller to provide the processor 1201 with access to the memory 1202.

[0226] The electronic device also includes a power supply 1203 that supplies power to various components. Preferably, the power supply 1203 can be logically connected to the processor 1201 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 1203 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0227] The electronic device may also include an input unit 1204, which can be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.

[0228] Although not shown, the electronic device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 1201 in the electronic device loads the executable files corresponding to the processes of one or more computer programs into the memory 1202 according to the following instructions, and the processor 1201 runs the computer programs stored in the memory 1202 to realize various functions, such as:

[0229] Retrieve a set of parameters for multiple request requests, including those from the gateway interface. The request parameters include keywords and their corresponding numerical values.

[0230] Obtain the preset keywords of the gateway interface. Different values ​​corresponding to the preset keywords represent different business scenarios of the target business of the gateway interface.

[0231] Filter the request parameters that have the same keyword and match the preset keyword from the parameter set to obtain multiple first request parameters;

[0232] The values ​​corresponding to the keywords that match the preset keywords in the first request parameters are compared to obtain a first request parameter set with different values ​​and a second request parameter set with the same values.

[0233] Store each request parameter in the first request parameter set, and store one request parameter in the second request parameter set.

[0234] For details on the specific implementation methods and corresponding beneficial effects of the above operations, please refer to the detailed description of the parameter storage method above, which will not be repeated here.

[0235] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by a computer program, or by a computer program controlling related hardware. The computer program can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0236] Therefore, embodiments of this application provide a computer-readable storage medium storing a computer program that can be loaded by a processor to execute the steps in any of the parameter storage methods provided in embodiments of this application. For example, the computer program can execute the following steps:

[0237] Retrieve a set of parameters for multiple request requests, including those from the gateway interface. The request parameters include keywords and their corresponding numerical values.

[0238] Obtain the preset keywords of the gateway interface. Different values ​​corresponding to the preset keywords represent different business scenarios of the target business of the gateway interface.

[0239] Filter the request parameters that have the same keyword and match the preset keyword from the parameter set to obtain multiple first request parameters;

[0240] The values ​​corresponding to the keywords that match the preset keywords in the first request parameters are compared to obtain a first request parameter set with different values ​​and a second request parameter set with the same values.

[0241] Store each request parameter in the first request parameter set, and store one request parameter in the second request parameter set.

[0242] For details on the specific implementation methods and corresponding beneficial effects of the above operations, please refer to the previous embodiments, which will not be repeated here.

[0243] The computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0244] Since the computer program stored in the computer-readable storage medium can execute the steps in any of the parameter storage methods provided in the embodiments of this application, the beneficial effects that any of the parameter storage methods provided in the embodiments of this application can achieve can be realized, as detailed in the preceding embodiments, and will not be repeated here.

[0245] According to one aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the parameter storage method described above.

[0246] The foregoing has provided a detailed description of a parameter storage method, apparatus, electronic device, and computer-readable storage medium provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A parameter storage method characterized by comprising: The method comprises the following steps: obtaining a parameter set comprising a plurality of request parameters of a gateway interface, the request parameters comprising a keyword and a value corresponding to the keyword; obtaining a preset keyword of the gateway interface, different values corresponding to the preset keyword representing different business scenarios of a target business of the gateway interface; filtering, from the parameter set, request parameters with the same keyword and matching the preset keyword to obtain a plurality of first request parameters; comparing values corresponding to the keyword matching the preset keyword in the first request parameters to obtain a first request parameter set with different values and a second request parameter set with the same values; wherein the keyword and the corresponding value form a key-value pair, the keyword is a key value, and the value corresponding to the keyword is a value value; storing each request parameter in the first request parameter set and storing one request parameter in the second request parameter set; determining the inclusion relationship of the keyword included in the request parameter with a different second hash value, wherein the second hash value is obtained by hashing the keyword in the request parameter, the inclusion relationship includes an included request parameter and a contained request parameter, and the included request parameter contains the contained request parameter; lowering the scanning priority of the contained request parameter compared with the included request parameter.

2. The parameter storage method according to claim 1, wherein The comparison of the values corresponding to the keyword matching the preset keyword in the first request parameters to obtain the first request parameter set with different values and the second request parameter set with the same values comprises: determining a first hash value corresponding to the first request parameter according to the keyword matching the preset keyword and the value corresponding to the keyword matching the preset keyword in the first request parameter; determining the first request parameter set with different values according to the first request parameter with different first hash values, and determining the second request parameter set with the same values according to the first request parameter with the same first hash values.

3. The parameter storage method according to claim 1, wherein The filtering of the request parameters with the same keyword and matching the preset keyword from the parameter set to obtain a plurality of first request parameters comprises: hashing the keyword in the request parameter to obtain a second hash value corresponding to the request parameter; filtering, from the request parameters with the same second hash value, the request parameters corresponding to the keyword matching the preset keyword to obtain a plurality of first request parameters.

4. The parameter storage method according to claim 3, wherein After hashing the keyword in the request parameter to obtain the second hash value corresponding to the request parameter, the method further comprises: determining the inclusion relationship of the keyword included in the request parameter with a different second hash value; adjusting the scanning priority of the request parameter with the inclusion relationship according to the inclusion relationship, so as to scan the request parameter with the inclusion relationship according to the adjusted scanning priority after storing the request parameter with the different second hash value.

5. The parameter storage method according to claim 3, wherein The hashing operation on the keyword in the request parameter obtains a second hash value corresponding to the request parameter, and the method comprises the following steps of: Obtaining a service-independent keyword corresponding to the gateway interface; Filtering the keyword in the request parameter according to the service-independent keyword to obtain a target keyword; Hashing operation is performed on the target keyword to obtain a second hash value corresponding to the request parameter.

6. The parameter storage method according to claim 3, wherein After the hashing operation on the keyword in the request parameter obtains the second hash value corresponding to the request parameter, the method further comprises the following steps of: From the request parameters with the same second hash value, the request parameters not including the keyword matched with the preset keyword are screened out to obtain a plurality of third request parameters; Obtaining a target value in the third request parameter, the target value is used to represent the parameter state of the third request parameter; According to the target value, a target third request parameter is selected from a plurality of third request parameters; The target third request parameter is stored.

7. The parameter storage method according to any one of claims 1 to 6, characterized by, The parameter set comprising a plurality of request parameters of the gateway interface comprises the following steps: When the test instruction of the gateway interface is received, a collection instruction is generated; According to the collection instruction, a plurality of request parameters comprising the gateway interface are collected; According to a plurality of the request parameters, a parameter set is determined.

8. A parameter storage device, characterized by, Comprise: The first acquisition module is used for acquiring a parameter set comprising a plurality of request parameters of the gateway interface, and the request parameter comprises a keyword and a numerical value corresponding to the keyword; The second acquisition module is used for acquiring a preset keyword of the gateway interface, and different numerical values corresponding to the preset keyword represent different business scenarios of the target business of the gateway interface; The parameter screening module is used for screening the request parameters with the same keyword and matched with the preset keyword from the parameter set to obtain a plurality of first request parameters; The numerical value comparison module is used for comparing the numerical values corresponding to the keyword matched with the preset keyword in the first request parameter to obtain a first request parameter set with different numerical values and a second request parameter set with the same numerical values; wherein the keyword and the numerical value corresponding thereto are a pair of key-value pairs, the keyword is a key value, and the numerical value corresponding to the keyword is a value value; The parameter storage module is used for storing each request parameter in the first request parameter set and storing one request parameter in the second request parameter set; The device is also used to determine the inclusion relationship of the keywords included in the request parameters with different second hash values, wherein the second hash value is obtained by hashing the keyword in the request parameter, the inclusion relationship comprises an included request parameter and an included request parameter, and the included request parameter contains the included request parameter; the scanning priority of the included request parameter is reduced compared with the included request parameter.

9. An electronic device, comprising: Comprise processor and memory, the memory stores computer program, the processor is used for running the computer program in the memory, to execute the parameter storage method in any one of claims 1 to 7. Comprise processor and memory, the memory stores computer program, the processor is used for running the computer program in the memory, to execute the parameter storage method in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is adapted to be loaded by the processor to execute the parameter storage method in any one of claims 1 to 7.

11. A computer program product, characterised in that, The computer program product stores a computer program, and the computer program is adapted to be loaded by the processor to execute the parameter storage method in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Interface request storage method and device

    CN110209888A