Virtual object matching method, virtual object matching device, and storage medium

By obtaining the address and request parameter information of the virtual object, combined with custom matching rules and syntax checks, the problem of inaccurate matching of virtual objects in the prior art is solved, and the testing efficiency and accuracy are improved.

CN115630309BActive Publication Date: 2025-07-29PING AN BANK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211220309.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-29
Publication Date
2025-07-29
Estimated Expiration
2042-09-29

AI Technical Summary

Technical Problem

In the existing virtual object matching methods, fuzzy character matching is not flexible enough, and the regular expression matching rules are too large, which can easily lead to mismatch and inefficient testing.

Method used

By obtaining the address information of the virtual object and the request parameter information, traverse the virtual object list, determine whether the request parameter information is included, and return the matching information according to the customized matching rules, and perform syntax checks before saving the matching rules to avoid errors.

Benefits of technology

It realizes flexible adjustment of matching rules, narrows the matching range, improves the accuracy of matching results, and reduces the waste of time and manpower caused by mismatch of virtual objects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115630309B_ABST
    Figure CN115630309B_ABST
Patent Text Reader

Abstract

The present application discloses a virtual object matching method, a virtual object matching device, and a computer storage medium. The virtual object matching method includes: obtaining address information and request parameter information of a virtual object based on a first request instruction of a user; traversing all virtual objects in a virtual object list under the address information, and determining whether a virtual object includes the request parameter information; if so, returning the virtual object as matching information. By the above method, the present application enables a user to customize and screen out virtual objects that match the requirements according to his own needs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of software testing, and particularly to a virtual object matching method, a virtual object matching device, and a computer storage medium. Background Art

[0002] With the continuous development of the Internet industry, during the software development process, the scale of software is getting larger and the structure is more complex. Each software consists of various modules with different functions, and the functions of these modules affect each other. Therefore, when testing a module, it is necessary to simultaneously simulate the effects of other modules, and virtual objects can be used at this time.

[0003] In an application scenario, the use of virtual objects needs to be matched according to the request parameters involved in the specific module to be simulated. There are two existing matching methods: character fuzzy matching and regular expression matching. The matching rule of character fuzzy matching is not flexible enough, and the matching rule range of regular expressions is too large, which is prone to incorrect matching. Summary of the Invention

[0004] The main technical problem to be solved by this application is how to better match suitable virtual objects. For this purpose, this application provides a virtual object matching method, a virtual object matching device, and a computer storage medium.

[0005] To solve the above technical problem, a technical solution adopted by this application is: to provide a virtual object matching method, which includes: based on a user's first request instruction, obtaining the address information and request parameter information of a virtual object; traversing all virtual objects in the virtual object list under the address information, and determining whether the virtual object contains the request parameter information; if so, returning the virtual object as matching information.

[0006] Wherein, after obtaining the address information and request parameter information of the virtual object based on the user's first request instruction, it further includes: obtaining the matching rule of the virtual object based on the request parameter information.

[0007] Wherein, traversing all virtual objects in the virtual object list under the address information and determining whether the virtual object contains the request parameter information includes: traversing all virtual objects in the virtual object list under the address information and determining whether the virtual object contains the request parameter information that meets the matching rule.

[0008] Wherein, the matching method further includes: if the virtual object does not contain the request parameter information, forwarding the request instruction to the corresponding real code; substituting the request parameter information into the real code to obtain the real result.

[0009] Wherein, after returning the virtual object as matching information, it further includes: substituting the request parameter information into the virtual object to obtain the virtual result.

[0010] Among them, the matching method further includes: creating a matching rule for the virtual object based on the user's second request instruction; saving the matching rule to a text file, and the matching rule in the text file is used to determine whether the virtual object contains request parameter information.

[0011] Among them, saving the matching rule to a text file includes: extracting the function name in the matching rule; determining whether the function name exists in the function list; if not, saving the matching rule to the text file.

[0012] Among them, before saving the matching rule to the text file, it further includes: checking whether the matching rule has a syntax error; if so, reminding the user to correct the syntax error.

[0013] To solve the above technical problems, another technical solution adopted by this application is: providing a virtual object matching device, which includes a processor and a memory. The memory is coupled to the processor, and the memory stores program data. The processor is used to execute the program data to implement the virtual object matching method as described above.

[0014] To solve the above technical problems, another technical solution adopted by this application is: providing a computer-readable storage medium, which stores program data. When the program data is executed, it is used to implement the above virtual object matching method.

[0015] The beneficial effect of this application is: Different from the prior art, the virtual object matching method provided by this application is applied to a virtual object matching device. The virtual object matching device obtains the address information and request parameter information of the virtual object based on the user's first request instruction; traverses all virtual objects in the virtual object list under the address information, and determines whether the virtual object contains request parameter information; if so, returns the virtual object as matching information. By the above method, compared with the conventional virtual object matching method, the method adopted by this application of obtaining the address where the virtual object is located and the request parameter information contained in the virtual object in the user request and matching the corresponding virtual object according to the request parameter information can customize the matching rule of the simulation object through the user's custom request to select the most suitable virtual object. This virtual object matching method can flexibly adjust the matching rule, narrow the matching range, make the matching result more accurate, and reduce the waste of time and manpower caused by incorrect matching of virtual objects. Description of the Drawings

[0016] To more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the accompanying drawings required for the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can be obtained based on these drawings. Among them:

[0017] Figure 1 is a schematic flowchart of an embodiment of the virtual object matching method provided by the present application;

[0018] Figure 2 is a schematic flowchart of the virtual object matching device provided by the present application executing the virtual object matching method;

[0019] Figure 3 is a schematic structural diagram of the first embodiment of the virtual object matching device provided by the present application;

[0020] Figure 4 is a schematic structural diagram of the second embodiment of the virtual object matching device provided by the present application;

[0021] Figure 5 is a schematic structural diagram of an embodiment of the computer-readable storage medium provided by the present application. Detailed implementation manners

[0022] The following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, rather than all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope protected by the present application.

[0023] Refer to Figure 1 and Figure 2 , Figure 1 is a schematic flowchart of an embodiment of the virtual object matching method provided by the present application; Figure 2 is a schematic flowchart of the virtual object matching device provided by the present application executing the virtual object matching method.

[0024] In the actual software development process, there will be a situation where one module depends on another module. When testing this module, it may occur that the dependent module has not been fully developed or the module is unstable, resulting in the inability to carry out the testing work normally. Therefore, a virtual module can be introduced to simulate the functions implemented by the dependent module for the convenience of testing. The virtual module is a substitute for the real module during the testing period.

[0025] Step 11: Based on the first request instruction of the user, obtain the address information and request parameter information of the virtual object.

[0026] Specifically, the user can input the requirements of the virtual object that can meet their own needs into the virtual module matching device. The virtual module matching device, according to the user's requirements, obtains the address where the virtual object is located in the requirements and the request parameters that need to be included in the virtual object. Among them, the user will also input the module information to be tested into the virtual module matching device for subsequent simulation testing.

[0027] Specifically, after that, the virtual module matching device will also obtain the matching rules of the virtual object based on the request parameter information. Among them, the matching rules define which virtual objects can meet the user's requirements, including the information contained in the request parameters in the virtual object.

[0028] In an embodiment of the present application, the virtual module matching device can also create the matching rules of the virtual object based on the user's second request instruction; save the matching rules to a text file, and the matching rules in the text file are used to determine whether the virtual object contains request parameter information. By customizing the matching rules of the virtual object, the user can flexibly add information such as conditional logic judgments therein, reduce the matching range, and make the matching rules more accurate.

[0029] See Figure 2 , the user can, based on specific test needs, use the virtual module matching device to online write the matching rules of the virtual object, and can also well match some virtual objects with special features. And the virtual module matching device can modify the matching rules to avoid the situation of mis-matching due to the too large range of the matching rules, and can effectively improve the working efficiency of virtual object matching.

[0030] Specifically, during the process of saving the matching rules, the virtual module matching device will also trigger the syntax check mechanism carried in the virtual module matching device. If there is a syntax exception in the matching rules, it will prompt the user with the syntax exception information, and the user needs to modify the matching rules until there is no syntax error before the matching rules can be saved to the virtual module matching device.

[0031] Specifically, after the virtual module matching device performs a syntax check on the matching rule, it will also extract the function name of the matching rule and determine whether the function name exists in the virtual object list stored in the virtual module matching device. If it exists, the user will be prompted to modify the function name of the matching rule until the function name does not duplicate the function names in the virtual object list, and then the matching rule can be successfully saved in the virtual module matching device. Through two checks of syntax and function name, the virtual module matching device reduces the probability of errors in the stored virtual object matching rules, ensuring the stable operation of subsequent virtual object matching. Moreover, the matching rules are stored at different addresses, ensuring the independent operation of each function without interference, guaranteeing the independence and stability of subsequent matching, and avoiding the situation where the entire virtual module matching device malfunctions due to an error in a certain matching rule.

[0032] Step 12: Traverse all virtual objects in the virtual object list under the address information and determine whether the virtual object contains the request parameter information.

[0033] Continue to refer to Figure 2 , the virtual module matching device will traverse all virtual objects in the virtual object list under the address information obtained in Step 11 and determine whether the virtual object contains the request parameter information that meets the matching rule. If the virtual object does not match, the determination of the next virtual object will be carried out until all virtual objects are traversed. If the virtual object contains the request parameter information that meets the matching rule, proceed to Step 13.

[0034] Specifically, when the virtual module matching device traverses all virtual objects in the virtual object list and fails to find a virtual object that meets the user input request, it will send the user's request to the real request address, substitute the request parameter information in the request into the real code under the real request address to obtain the real result, and then output and display the real result to the user.

[0035] Step 13: Return the virtual object as the matching information.

[0036] Please continue to refer to Figure 2 , if the virtual module matching device finds a virtual object that matches the user request, it will use the virtual object as the matching information and substitute the user request into the matching information to obtain the virtual result.

[0037] Different from the prior art, the virtual object matching method provided in this application is applied to a virtual object matching device. The virtual object matching device obtains the address information and request parameter information of the virtual object based on the user's first request instruction; traverses all virtual objects in the virtual object list under the address information, and determines whether the virtual object contains the request parameter information; if so, returns the virtual object as the matching information. In this way, compared with the conventional virtual object matching method, the method adopted in this application, which obtains the address where the virtual object is located and the request parameter information contained in the virtual object in the user's request and matches the corresponding virtual object according to the request parameter information, can customize the matching rules for simulating objects through the user's customized request to select the most suitable virtual object. This virtual object matching method can flexibly adjust the matching rules, narrow the matching range, make the matching result more accurate, and reduce the waste of time and manpower caused by incorrect matching of virtual objects.

[0038] The method of the above embodiment can be implemented by using a virtual object matching device. The following will be described in conjunction with Figure 3 for description. Figure 3 FIG. is a schematic structural diagram of the first embodiment of the virtual object matching device provided in this application.

[0039] As Figure 3 shown, the virtual object matching device 30 of the embodiment of this application includes an acquisition module 31, a judgment module 32, and a matching module 33.

[0040] Among them, the acquisition module 31 is used to obtain the address information and request parameter information of the virtual object based on the user's first request instruction.

[0041] The judgment module 32 is used to traverse all virtual objects in the virtual object list under the address information and determine whether the virtual object contains the request parameter information.

[0042] The matching module 33 is used to return the virtual object as the matching information when the virtual object contains the request parameter information.

[0043] The method of the above embodiment can be implemented by using a virtual object matching device. The following will be described in conjunction with Figure 4 , Figure 4 FIG. is a schematic structural diagram of the second embodiment of the virtual object matching device provided in this application. The virtual object matching device 40 includes a memory 41 and a processor 42. The memory 41 is used to store program data, and the processor 42 is used to execute the program data to implement the following method:

[0044] Based on the user's first request instruction, obtain the address information and request parameter information of the virtual object; traverse all virtual objects in the virtual object list under the address information, and determine whether the virtual object contains the request parameter information; if so, return the virtual object as the matching information.

[0045] See Figure 5 , Figure 5 FIG. Figure 5 is a schematic structural diagram of an embodiment of the computer-readable storage medium provided by the present application. The computer-readable storage medium 50 stores program data 51, and when the program data 51 is executed by a processor, it is used to implement the following method:

[0046] Based on the user's first request instruction, obtain the address information and request parameter information of the virtual object; traverse all virtual objects in the virtual object list under the address information, and determine whether the virtual object contains the request parameter information; if so, return the virtual object as the matching information.

[0047] When the embodiments of the present application are implemented in the form of software function units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods described in various embodiments of the present application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs that can store program codes.

[0048] The above are only the embodiments of the present application, and do not limit the patent scope of the present application. Any equivalent structural or equivalent process transformation made by using the content of the specification and drawings of the present application, or directly or indirectly applied in other related technical fields, shall be equally included in the patent protection scope of the present application.

Claims

1. A virtual object matching method, characterized in that The matching method includes: Based on the user's first request instruction, obtain the address information and request parameter information of the virtual object; Obtain the matching rule of the virtual object based on the request parameter information; Traverse all virtual objects in the virtual object list under the address information, and determine whether the virtual object contains the request parameter information; If so, return the virtual object as the matching information; Substitute the request parameter information into the virtual object to obtain a virtual result; If the virtual object does not contain the request parameter information, forward the request instruction to the corresponding real code; Substitute the request parameter information into the real code to obtain a real result.

2. The matching method according to claim 1, wherein: The step of traversing all virtual objects in the virtual object list under the address information and determining whether the virtual object contains the request parameter information includes: Traverse all virtual objects in the virtual object list under the address information, and determine whether the virtual object contains the request parameter information that meets the matching rule.

3. The matching method according to claim 1, wherein: The matching method further includes: Based on the user's second request instruction, create a matching rule for the virtual object; Save the matching rule to a text file, and the matching rule in the text file is used to determine whether the virtual object contains the request parameter information.

4. The matching method according to claim 3, wherein: The step of saving the matching rule to a text file includes: Extract the function name in the matching rule; Determine whether the function name exists in the function list; If not, save the matching rule to the text file.

5. The matching method according to claim 3, wherein: Before saving the matching rule to the text file, it further includes: Check whether the matching rule has a syntax error; If so, remind the user to correct the syntax error.

6. A virtual object matching device, characterized in that, The virtual object matching device includes a memory and a processor coupled to the memory; Wherein, the memory is used to store program data, and the processor is used to execute the program data to implement the virtual object matching method according to any one of claims 1 to 5.

7. A computer storage medium, characterized in that, The computer storage medium is used to store program data, and when the program data is executed by a computer, it is used to implement the virtual object matching method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Virtual object acquisition method, devices and electronic equipment

    CN109547444A

  • Resource recommendation method and device, electronic equipment and storage medium

    CN114579867A