Testing Method and Device
By using user identification information and environment identification fields to distinguish users and data without user perception, specific users can access specific test data, which solves the problem that test data is accessed by ordinary users in the existing regression testing method and improves data security.
Patent Information
- Application Number
- CN202110639307.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-08
- Publication Date
- 2025-06-20
- Estimated Expiration
- 2041-06-08
AI Technical Summary
Existing regression testing methods cannot effectively avoid the test data being accessed by ordinary users when there is a lot of user traffic, resulting in adverse effects.
By using user identification information to distinguish between ordinary users and specific users without perception, and using environment identification fields to distinguish between ordinary data and test data, specific users can access specific data, while ordinary users or users without user status are not affected.
In the absence of user perception, it is ensured that specific users can access specific test data. Ordinary users access ordinary data, avoiding the risk of test data being accessed by ordinary users and improving the security of test data.
Smart Images

Figure CN113297087B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular, to a testing method and apparatus. Background Art
[0002] Regression testing is a type of software testing that is used to verify that code changes in software do not affect the existing functionality of the product. Regression testing ensures that the product functions properly under new features, bug fixes, or any changes to existing functionality. For example, in an e-commerce system, due to the need to perform regression testing on the online environment or the gray-scale environment, test data such as "testing product, do not place an order" may appear. These test data will be displayed on the front end in a userless state and thus be browsed by users. Similar problems often occur on news and blogs. To avoid such problems, regression is usually performed when user traffic is low, and the test data is deleted after regression is completed. However, this processing method cannot fundamentally solve the problem, and the test data may still be accessed by users, thus causing adverse effects. Summary of the Invention
[0003] In view of this, embodiments of the present invention provide a testing method and apparatus, which enable specific users to access specific data without the user's awareness, while normal users or users in a userless state are not affected, that is, even if testers access test data and ordinary users access ordinary data. Embodiments of the present invention distinguish ordinary users and specific users through user identification information, and distinguish ordinary data and test data through environment identification fields, which is simple, convenient, and easy to implement.
[0004] To achieve the above object, according to one aspect of an embodiment of the present invention, a testing method is provided, including:
[0005] Receiving an access request and parsing the access request to determine the user identification information of the initiator of the access request;
[0006] Determining whether the initiator belongs to a specific visitor according to the user identification information;
[0007] If so, performing enhanced processing on the access request to enable the initiator to access specific first data; after performing enhanced processing on the access request, responding to the access request to enable the access request to access the specific first data and obtaining a specific first access result;
[0008] If not, directly responding to the access request to enable the access request to access second data and obtaining a second access result.
[0009] Optionally, before receiving the access request, the method further includes: adding an environment identification field to a data table, and setting the value of the environment identification field for each piece of data in the data table, so as to determine the attribute of the data through the value of the environment identification field.
[0010] Optionally, determining whether the initiator belongs to a specific visitor according to the user identification information includes: determining whether the user identification information exists in a preset identification set; if so, determining that the initiator belongs to a specific visitor.
[0011] Optionally, performing enhancement processing on the access request to enable the initiator to access specific first data includes: parsing the access request to determine an enhancement rule corresponding to the access request; performing enhancement processing on the access request according to the enhancement rule, so that the access request accesses first data whose value of the environment identification field is a first target value;
[0012] Directly responding to the access request to enable the access request to access second data includes: directly responding to the access request to enable the access request to access second data whose value of the environment identification field is a second target value.
[0013] To achieve the above object, according to another aspect of the embodiments of the present invention, there is provided a test device, including:
[0014] A request parsing module, configured to receive an access request and parse the access request to determine the user identification information of the initiator who initiates the access request;
[0015] A judgment module, configured to determine whether the initiator belongs to a specific visitor according to the user identification information;
[0016] A response module, configured to, when the initiator belongs to a specific visitor, perform enhancement processing on the access request to enable the initiator to access specific first data; after performing enhancement processing on the access request, respond to the access request to enable the access request to access the specific first data, and obtain a specific first access result; when the initiator does not belong to a specific visitor, directly respond to the access request to enable the access request to access second data, and obtain a second access result.
[0017] Optionally, the device further includes a setting module, configured to add an environment identification field to a data table, and set the value of the environment identification field for each piece of data in the data table, so as to determine the attribute of the data through the value of the environment identification field.
[0018] Optionally, the judgment module is further used to: determine whether the user identification information exists in a preset identification set; if so, determine that the initiator belongs to a specific visitor.
[0019] Optionally, the response module is further used to: when the initiator is a specific visitor, parse the access request and determine an enhancement rule corresponding to the access request; perform enhancement processing on the access request according to the enhancement rule so that the value of the access environment identification field of the access request is the first data of the first target value;
[0020] In the case that the initiator is not a specific visitor, the access request is directly responded to so that the value of the access environment identification field of the access request is the second data of the second target value.
[0021] To achieve the above-mentioned purpose, according to another aspect of an embodiment of the present invention, there is provided an electronic device, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the testing method of an embodiment of the present invention.
[0022] To achieve the above objective, according to another aspect of an embodiment of the present invention, a computer-readable medium is provided, on which a computer program is stored, and when the program is executed by a processor, the test method of the embodiment of the present invention is implemented.
[0023] An embodiment of the above invention has the following advantages or beneficial effects: by receiving an access request and parsing the access request to determine the user identification information of the initiator of the access request; according to the user identification information, determining whether the initiator belongs to a specific visitor; if so, performing enhanced processing on the access request to enable the initiator to access specific first data; after enhancing the access request, responding to the access request so that the access request accesses the specific first data and obtains a specific first access result; if not, directly responding to the access request so that the access request accesses the second data and obtains a technical means of a second access result, in the case where the user is not aware, a specific user is allowed to access specific data, while a normal user or a user without a user status is not affected, even if a tester accesses test data and an ordinary user accesses ordinary data. The embodiment of the present invention distinguishes ordinary users from specific users by user identification information, and distinguishes ordinary data from test data by an environment identification field, which is simple, convenient and easy to implement.
[0024] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention. Among them:
[0026] Figure 1 is a schematic diagram of the main process of the test method according to an embodiment of the present invention;
[0027] Figure 2 is a schematic diagram of the main process of the test method according to another embodiment of the present invention;
[0028] Figure 3 is a schematic diagram of the main modules of the test device according to an embodiment of the present invention;
[0029] Figure 4 is an exemplary system architecture diagram to which an embodiment of the present invention can be applied;
[0030] Figure 5 is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. Detailed implementation manners
[0031] The following describes exemplary embodiments of the present invention with reference to the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding. It should be considered that they are merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted below.
[0032] Figure 1 is a schematic diagram of the main process of the test method according to an embodiment of the present invention. This method can be used for regression testing in an online environment. As Figure 1 shown, this method includes:
[0033] Step S101: Receive an access request and parse the access request to determine the user identification information of the initiator who initiated the access request.
[0034] Among them, the user identification information may include the login information of the initiator, and more specifically, may include a username or an ID. In this embodiment, the user identification information is used to determine the identity of the initiator, that is, to distinguish whether the initiator is a specific user or an ordinary user, and to distinguish whether the access request is a test request initiated by a specific user or an access request initiated by an ordinary user.
[0035] Step S102: Determine whether the initiator belongs to a specific visitor according to the user identification information.
[0036] In this embodiment, a set of identifiers may be preset to record the user identifier information of a specific user. After receiving an access request, it is determined whether the user identifier information in the access request is in the preset set of identifiers. If so, it can be determined that the initiator of the access request is a specific visitor. Otherwise, it can be determined that the initiator of the access request is not a specific visitor. For a user without a user status, the corresponding user identifier information in the access request initiated by them may be empty or a preset fixed identifier, and this fixed identifier does not exist in the set of identifiers. Herein, a user without a user status refers to a user who has not logged in.
[0037] Step S103: If so, perform enhancement processing on the access request so that the initiator can access specific first data.
[0038] Step S104: After performing enhancement processing on the access request, respond to the access request, enable the access request to access the specific first data, obtain a specific first access result, and return this first access result to the sender.
[0039] Enhancement processing means injecting some programs inside the original program to enhance the function of the original program. In this step, if it is determined that the initiator belongs to a specific visitor, enhancement processing is performed on the access request so that the access request can access specific data. In this embodiment, if the access request is an SQL statement, then by parsing the SQL syntax tree of the access request, the access request is dynamically enhanced so that the access request can access specific data. In this embodiment, the specific data may be test data. SQL (Structured Query Language) is a special-purpose programming language, a database query and programming language used to access data and query, update, and manage relational database systems.
[0040] Step S105: If not, directly respond to the access request, enable the access request to access second data, and obtain a second access result.
[0041] In this step, if it is determined that the initiator does not belong to a specific visitor, the access request is directly processed so that the request accesses ordinary production data, obtains a second access result, and returns it to the initiator.
[0042] In this embodiment, the specific first data may be test data for testing, and this test data can only be accessed by testers or specific personnel. Therefore, after receiving an access request in this embodiment, according to the access request, the user identification information of the initiator of the access request is determined. When it is determined according to the user identification information that the initiator is a specific visitor (such as a tester), the access request is enhanced so that the access request accesses the specific first data in the database. In contrast, the second data is ordinary production data, which is accessed by ordinary users (i.e., non-testers or specific personnel). When it is determined according to the user identification information that the initiator is not a specific visitor, the access request is made to access the second data to obtain a second access result.
[0043] The test method of the embodiment of the present invention includes receiving an access request and parsing the access request to determine the user identification information of the initiator of the access request; according to the user identification information, determining whether the initiator belongs to a specific visitor; if so, enhancing the access request so that the initiator accesses specific first data; after enhancing the access request, responding to the access request so that the access request accesses the specific first data to obtain a specific first access result; if not, directly responding to the access request so that the access request accesses the second data to obtain a second access result. By these technical means, specific users can access specific data without the users' awareness, while normal users or users in a non-user state are not affected, that is, testers can access test data and ordinary users can access ordinary data. The embodiment of the present invention distinguishes ordinary users and specific users through user identification information, and distinguishes ordinary data and test data through an environment identification field, which is simple, convenient, and easy to implement.
[0044] Figure 2 It is a schematic diagram of the main process of the test method of another embodiment of the present invention, as Figure 2 shown, and this method includes:
[0045] Step S201: Set an identification set. The user identification information in this identification set may be the user identification information of specific users such as testers.
[0046] Step 202: Add an environment identification field to the data table, and set the value of the environment identification field for each piece of data in the data table, so as to determine the attribute of the data through the value of the environment identification field. Among them, the attributes of the data include test attributes and ordinary attributes. When the attribute of the data is a test attribute, it means that the data is test data. When the attribute of the data is an ordinary attribute, it means that the data is ordinary production data. As a specific example, the value of the environment identification field can be 0 or 1. When the value of the environment identification field is 1, it means that the attribute of this piece of data is a test attribute, and the data is test data. When the value of the environment identification field is 0, it means that the attribute of this piece of data is an ordinary attribute, and the data is not test data, but normal production data.
[0047] In this embodiment, test data and production data are isolated through the environment identification field, so as to enable specific users to access specific data without the user's perception, and ordinary users or users in a userless state are not affected.
[0048] Step S203: Receive an access request, and parse the access request to determine the user identification information of the initiator who initiated the access request.
[0049] Step S204: Determine whether the user identification information exists in a preset identification set.
[0050] Step S205: If the user identification information exists in the preset identification set, determine that the initiator belongs to a specific visitor.
[0051] Step S206: Parse the access request to determine the enhancement rule corresponding to the access request. In this embodiment, different enhancement rules are set for different syntax types. For example, different enhancement rules are set for syntax types such as query, update, filtering, and table join. As a specific example, different enhancers can be set for different syntax types, such as query enhancer, update enhancer, filtering enhancer, and table join enhancer, etc. In this example, when initializing the test device, the corresponding enhancer can be initialized and loaded through the SPI mechanism. When initializing the enhancer through the SPI (Service Provider Interface) mechanism, all implementations under a specific interface will be obtained through ServiceLoader. That is, use the SPI mechanism to load, and then identify the SQL statement type corresponding to the enhancer through the annotation on the implementation.
[0052] Step S207: According to the enhancement rule, perform enhancement processing on the access request so that the access request accesses the first data with the value of the environment identification field being the first target value, obtain a first access result, and return the access result to the initiator. In this embodiment, the first target value may be 1. That is, after performing enhancement processing on the access request, the access request accesses the data with the environment identification field value of 1.
[0053] Step S208: If the user identification information is not in the preset identification set, determine that the initiator does not belong to a specific visitor.
[0054] Step S209: Directly process the access request so that the access request accesses the second data with the value of the environment identification field being the second target value, obtain a second access result, and return the second access result to the initiator. In this embodiment, the second target value may be 0.
[0055] The test method of the embodiment of the present invention determines whether the initiator is a specific access user through the user identification information carried in the access request. If so, after performing enhancement processing on the access request, respond to the access request so that the access request accesses specific first data, and obtain a specific first access result; if not, directly respond to the access request so that the access request accesses second data, and obtain a second access result, enabling specific users to access specific data without the user's perception, while normal users or users in a non-user state are not affected, that is, enabling testers to access test data and ordinary users to access ordinary data. The embodiment of the present invention differentiates ordinary users and specific users through user identification information, and differentiates ordinary data and test data through the environment identification field, which is simple, convenient, and easy to implement.
[0056] In an alternative embodiment, when adding an environment identification field to a data table, a whitelist of tables that need to be enhanced can also be set. After determining that the initiator belongs to a specific visitor, it can first be determined whether the data table to be accessed in the access request is in the whitelist of tables that need to be enhanced. If the data table to be accessed is in the whitelist of tables that need to be enhanced, perform enhancement processing on the access request.
[0057] In other alternative embodiments, when adding an environment identification field to a data table, a blacklist of tables that need to be enhanced can also be set. After determining that the initiator belongs to a specific visitor, it can first be determined whether the data table to be accessed in the access request is in the blacklist of tables that need to be enhanced. If the data table to be accessed is not in the blacklist of tables that need to be enhanced, perform enhancement processing on the access request.
[0058] Figure 3 It is a schematic diagram of the main modules of the test device 300 according to the embodiment of the present invention, as Figure 3As shown, the test device includes:
[0059] A request parsing module 301, configured to receive an access request and parse the access request to determine the user identification information of the initiator who initiated the access request;
[0060] A judgment module 302, configured to determine whether the initiator belongs to a specific visitor according to the user identification information;
[0061] A response module 303, configured to, when the initiator belongs to a specific visitor, perform enhancement processing on the access request so that the initiator accesses specific first data; after performing enhancement processing on the access request, respond to the access request to enable the access request to access the specific first data and obtain a specific first access result; when the initiator does not belong to a specific visitor, directly respond to the access request to enable the access request to access second data and obtain a second access result.
[0062] Optionally, the device further includes a setting module, configured to add an environment identification field to a data table and set the value of the environment identification field for each data in the data table to determine the attribute of the data through the value of the environment identification field.
[0063] Optionally, the judgment module is further configured to: determine whether the user identification information exists in a preset identification set; if so, determine that the initiator belongs to a specific visitor.
[0064] Optionally, the response module is further configured to: when the initiator belongs to a specific visitor, parse the access request to determine an enhancement rule corresponding to the access request; according to the enhancement rule, perform enhancement processing on the access request so that the access request accesses first data with the value of the environment identification field being a first target value; when the initiator does not belong to a specific visitor, directly respond to the access request to enable the access request to access second data with the value of the environment identification field being a second target value.
[0065] The test device according to the embodiment of the present invention determines whether the initiator is a specific access user by the user identification information carried in the access request. If so, after enhancing the access request, the access request is responded to, enabling the access request to access specific first data and obtaining a specific first access result; if not, the access request is directly responded to, enabling the access request to access second data and obtaining a second access result, so that a specific user can access specific data without the user's awareness, while normal users or users in a non-user state are not affected, that is, testers can access test data and ordinary users can access ordinary data. The embodiment of the present invention differentiates ordinary users and specific users through user identification information, and differentiates ordinary data and test data through an environment identification field, which is simple, convenient, and easy to implement.
[0066] The above device can execute the method provided by the embodiment of the present invention, and has corresponding functional modules and beneficial effects for executing the method. For technical details not described in detail in this embodiment, reference can be made to the method provided by the embodiment of the present invention.
[0067] Figure 4 An exemplary system architecture 400 is shown to which the test method or test device according to the embodiment of the present invention can be applied.
[0068] As Figure 4 shown, the system architecture 400 may include terminal devices 401, 402, 403, a network 404, and a server 405. The network 404 is used as a medium for providing a communication link between the terminal devices 401, 402, 403 and the server 405. The network 404 may include various connection types, such as wired, wireless communication links, or fiber optic cables, etc.
[0069] Users can use the terminal devices 401, 402, 403 to interact with the server 405 through the network 404 to receive or send messages, etc. Various communication client applications may be installed on the terminal devices 401, 402, 403, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0070] The terminal devices 401, 402, 403 may be various electronic devices with a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, and desktop computers, etc.
[0071] The server 405 may be a server providing various services, such as a background management server that supports shopping websites browsed by users using the terminal devices 401, 402, 403. The background management server may analyze and process data such as product information query requests received, and feedback the processing results (such as target push information, product information) to the terminal devices.
[0072] It should be noted that the test method provided by the embodiments of the present invention is generally executed by the server 405. Correspondingly, the test device is generally disposed in the server 405.
[0073] It should be understood that Figure 4 the numbers of the terminal devices, networks, and servers in
[0074] are merely illustrative. According to actual needs, there can be any number of terminal devices, networks, and servers. Figure 5 is a schematic structural diagram of a computer system 500 of a terminal device suitable for implementing the embodiments of the present invention. Figure 5 The terminal device shown is merely an example and should not impose any limitations on the functions and usage scope of the embodiments of the present invention.
[0075] As Figure 5 shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to the programs stored in the read-only memory (ROM) 502 or the programs loaded from the storage section 508 into the random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the system 500 are also stored. The CPU 501, ROM 502, and RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0076] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including such as a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as required. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as required so that the computer program read from it can be installed into the storage section 508 as required.
[0077] In particular, according to the embodiments disclosed in the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present invention include a computer program product that includes a computer program carried on a computer-readable medium, and the computer program contains program codes for performing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from the network through the communication section 509 and / or installed from the removable medium 511. When the computer program is executed by the central processing unit (CPU) 501, the above functions defined in the system of the present invention are performed.
[0078] It should be noted that the computer-readable medium shown in the present invention can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium can include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, the computer-readable storage medium can be any tangible medium that contains or stores a program, and the program can be used by or in combination with an instruction execution system, apparatus, or device. In the present invention, the computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries the computer-readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, and the computer-readable medium can send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted by any appropriate medium, including but not limited to: wireless, wire, optical fiber cable, RF, etc., or any suitable combination of the above.
[0079] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagram may represent a module, a segment of a program, or a part of code, and the above-mentioned module, segment of a program, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than that marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, as well as the combination of blocks in the block diagram or flowchart, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.
[0080] The modules involved in the embodiments of the present invention can be implemented in software or in hardware. The described modules can also be provided in a processor. For example, it can be described as: a processor includes a sending module, an obtaining module, a determining module, and a first processing module. Among them, the names of these modules do not constitute a limitation on the unit itself in some cases. For example, the sending module can also be described as "a module that sends a picture acquisition request to the connected server".
[0081] As another aspect, the present invention also provides a computer-readable medium, which can be included in the devices described in the above embodiments; or can exist separately without being assembled into the device. The above computer-readable medium carries one or more programs. When the above one or more programs are executed by a device, the device includes:
[0082] Receive an access request, and parse the access request to determine the user identification information of the initiator who initiated the access request;
[0083] Determine whether the initiator belongs to a specific visitor according to the user identification information;
[0084] If so, perform enhanced processing on the access request so that the initiator accesses specific first data; after performing enhanced processing on the access request, respond to the access request so that the access request accesses the specific first data to obtain a specific first access result;
[0085] If not, directly respond to the access request so that the access request accesses second data to obtain a second access result.
[0086] The technical solution of the embodiment of the present invention determines whether the initiator is a specific access user by means of the user identification information of the initiator carried in the access request. If so, after enhancing the access request, the access request is responded to, enabling the access request to access specific first data and obtaining a specific first access result; if not, the access request is directly responded to, enabling the access request to access second data and obtaining a second access result, such that a specific user accesses specific data while normal users or users in a userless state are not affected, that is, testers access test data and ordinary users access ordinary data. The embodiment of the present invention differentiates between ordinary users and specific users by means of user identification information, and differentiates between ordinary data and test data by means of an environment identification field, which is simple, convenient, and easy to implement.
[0087] The above specific embodiments do not constitute a limitation on the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions may occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. A testing method, characterized in that, Including: Adding an environment identification field to a data table and setting the value of the environment identification field for each piece of data in the data table to determine the attribute of the data through the value of the environment identification field; Receiving an access request and parsing the access request to determine the user identification information of the initiator who initiated the access request; Determining whether the initiator belongs to a specific visitor according to the user identification information; If so, parsing the access request to determine an enhancement rule corresponding to the access request, and performing enhancement processing on the access request according to the enhancement rule so that the access request accesses first data with the value of the environment identification field being a first target value; after performing enhancement processing on the access request, responding to the access request to enable the access request to access the specific first data and obtaining a specific first access result; If not, directly responding to the access request to enable the access request to access second data and obtaining a second access result.
2. The method according to claim 1, characterized in that, Determining whether the initiator belongs to a specific visitor according to the user identification information includes: Determining whether the user identification information exists in a preset identification set; If so, determining that the initiator belongs to a specific visitor.
3. The method according to claim 1, characterized in that, Directly responding to the access request to enable the access request to access second data includes: directly responding to the access request to enable the access request to access second data with the value of the environment identification field being a second target value.
4. A testing device, characterized in that, Including: A setting module for adding an environment identification field to a data table and setting the value of the environment identification field for each piece of data in the data table to determine the attribute of the data through the value of the environment identification field; A request parsing module for receiving an access request and parsing the access request to determine the user identification information of the initiator who initiated the access request; A judgment module for determining whether the initiator belongs to a specific visitor according to the user identification information; A response module for, when the initiator belongs to a specific visitor, parsing the access request to determine an enhancement rule corresponding to the access request, and performing enhancement processing on the access request according to the enhancement rule so that the access request accesses first data with the value of the environment identification field being a first target value; after performing enhancement processing on the access request, responding to the access request to enable the access request to access the specific first data and obtaining a specific first access result; when the initiator does not belong to a specific visitor, directly responding to the access request to enable the access request to access second data and obtaining a second access result.
5. The device according to claim 4, characterized in that, The judgment module is further configured to: Determine whether the user identification information exists in a preset identification set; If so, determine that the initiator belongs to a specific visitor.
6. The device according to claim 4, characterized in that, The response module is further configured to: When the initiator does not belong to a specific visitor, directly respond to the access request to enable the access request to access second data with the value of the environment identification field being a second target value.
7. An electronic device, characterized in that, Including: One or more processors; A storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1-3.
8. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by a processor, the method according to any one of claims 1-3 is implemented.
Citation Information
Patent Citations
System security vulnerability detection method and device
CN111104675A
Efficient and reproducible visitor targeting based on propagation of cookie information
US20080140765A1