A use case operation method and device

By generating and storing simulation interface return values ​​based on scenario identifiers, and dynamically calling these return values ​​to generate use case running results, the problem of heavy workload and errors caused by manually modifying simulation interface return values ​​is solved, and the efficiency of use case testing is improved.

CN113590483BActive Publication Date: 2024-09-20BEIJING JINGDONG ZHENSHI INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110871136.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-30
Publication Date
2024-09-20
Estimated Expiration
2041-07-30

AI Technical Summary

Technical Problem

During the testing process, the simulation interface return value needs to be manually modified each time the use case is executed, which results in a heavy workload and error-prone, which in turn affects the progress of the use case testing.

Method used

By receiving the use case running request, the scenario ID is obtained, and the corresponding simulation interface return value is generated and stored according to the scenario ID, and these return values ​​are dynamically called to generate the use case running result to avoid frequent modification of the simulation interface return value.

Benefits of technology

It reduces the probability of errors in the return value of the simulation interface, reduces the workload, and improves the efficiency of use case execution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113590483B
    Figure CN113590483B
Patent Text Reader

Abstract

The present application discloses a method and device for running a use case, and relates to the field of computer technology. A specific implementation method includes receiving a use case running request, obtaining a scenario identifier in the use case running request; determining an external interface to be simulated according to the scenario identifier, and generating a corresponding simulation interface return value according to the scenario identifier and the external interface; running the use case, and then calling the corresponding simulation interface return value according to the scenario identifier to generate a use case running result. Thus, the present application pre-sets a matching scenario identifier and a corresponding simulation interface return value, and when the use case is executed, dynamically retrieves the corresponding simulation interface return value according to the scenario identifier, avoids frequently modifying the simulation interface return value during the execution process, reduces the probability of errors in the simulated interface return value, and improves the use case running efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a use case operation method and device. Background Art

[0002] During the testing process, the system often relies on external interfaces. When the external interfaces have not been developed, the system needs to be tested by simulating the return value of the external interfaces. Each time a use case is executed, if it is data-driven, the simulated external interface return value needs to be manually modified before testing.

[0003] In the process of implementing this application, the inventors found that there are at least the following problems in the prior art:

[0004] Each time a use case is executed, the simulated interface return value data needs to be manually maintained according to different scenarios. This is a large workload and prone to errors, which will slow down the progress of the use case test. Summary of the invention

[0005] In view of this, an embodiment of the present application provides a use case running method and device, which can solve the problem that each time a use case is executed, it is necessary to manually maintain the simulation interface return value data according to different scenarios each time, which is labor-intensive and prone to errors, resulting in slow progress of use case testing.

[0006] To achieve the above objective, according to one aspect of an embodiment of the present application, a use case operation method is provided, including:

[0007] Receive a use case running request and obtain a scenario identifier in the use case running request;

[0008] Determine the external interface to be simulated according to the scenario identifier, and generate the corresponding simulation interface return value according to the scenario identifier and the external interface;

[0009] Run the use case, and then call the corresponding simulation interface return value according to the scenario identifier to generate the use case running result.

[0010] Optionally, the external interface to be simulated is determined according to the scenario identifier, including:

[0011] Determine the external interface that needs to be called based on the scenario identifier;

[0012] The external interface that needs to be called and whose return value is empty is determined as the external interface that needs to be simulated.

[0013] Optionally, according to the scenario identifier and the external interface, a corresponding simulation interface return value is generated, including:

[0014] Determine scenario use case requirement information based on scenario identification;

[0015] Determine the input parameter format and output parameter format of the external interface;

[0016] Generate the corresponding simulation interface return value based on the scenario use case requirement information, input parameter format and output parameter format.

[0017] Optionally, based on the scenario identifier, the scenario use case requirement information is determined, including:

[0018] According to the scene identifier, determine the corresponding scene keyword;

[0019] Based on the corresponding scenario keywords, determine the scenario use case requirement information.

[0020] Optionally, before running the use case, the method further includes:

[0021] The scene keywords and simulation interface return values ​​corresponding to the same scene identifier are stored one by one.

[0022] Optionally, based on the scenario identifier, call the corresponding simulation interface return value to generate the use case running result, including:

[0023] According to the scenario keyword corresponding to the scenario identifier, the corresponding simulation interface return value is called to generate the use case running result.

[0024] In addition, the present application also provides a use case running device, including:

[0025] A receiving unit is configured to receive a use case execution request and obtain a scenario identifier in the use case execution request;

[0026] A generating unit is configured to determine the external interface to be simulated according to the scenario identifier, and to generate a corresponding simulated interface return value according to the scenario identifier and the external interface;

[0027] The running unit is configured to run the use case, and then call the corresponding simulation interface return value according to the scenario identifier to generate the use case running result.

[0028] Optionally, the generating unit is further configured to:

[0029] Determine the external interface that needs to be called based on the scenario identifier;

[0030] The external interface that needs to be called and whose return value is empty is determined as the external interface that needs to be simulated.

[0031] Optionally, the generating unit is further configured to:

[0032] Determine scenario use case requirement information based on scenario identification;

[0033] Determine the input parameter format and output parameter format of the external interface;

[0034] Generate the corresponding simulation interface return value based on the scenario use case requirement information, input parameter format and output parameter format.

[0035] Optionally, the generating unit is further configured to:

[0036] According to the scene identifier, determine the corresponding scene keyword;

[0037] Based on the corresponding scenario keywords, determine the scenario use case requirement information.

[0038] Optionally, the use case execution device further includes a storage unit configured to:

[0039] The scene keywords and simulation interface return values ​​corresponding to the same scene identifier are stored one by one.

[0040] Optionally, the operation unit is further configured to:

[0041] According to the scenario keyword corresponding to the scenario identifier, the corresponding simulation interface return value is called to generate the use case running result.

[0042] In addition, the present application also provides a use case running electronic device, including: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by one or more processors, the one or more processors implement the use case running method as described above.

[0043] In addition, the present application also provides a computer-readable medium on which a computer program is stored, and when the program is executed by a processor, the use case running method as described above is implemented.

[0044] An embodiment of the above invention has the following advantages or beneficial effects: the present application receives a use case running request and obtains a scenario identifier in the use case running request; determines the external interface to be simulated according to the scenario identifier, and generates a corresponding simulation interface return value according to the scenario identifier and the external interface; runs the use case, and then calls the corresponding simulation interface return value according to the scenario identifier to generate the use case running result. Thus, the present application pre-sets the matching scenario identifier and the corresponding simulation interface return value, and dynamically retrieves the corresponding simulation interface return value according to the scenario identifier when the use case is executed, thereby avoiding frequent modification of the simulation interface return value during the execution process, reducing the probability of errors in the simulated interface return value, reducing the workload, and improving the use case running efficiency.

[0045] 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

[0046] The accompanying drawings are used to better understand the present application and do not constitute an improper limitation on the present application.

[0047] Figure 1 is a schematic diagram of the main process of the use case operation method according to the first embodiment of the present application;

[0048] Figure 2 is a schematic diagram of the main process of the use case operation method according to the second embodiment of the present application;

[0049] Figure 3 is a schematic diagram of an application scenario of a use case operation method according to a third embodiment of the present application;

[0050] Figure 4 is a schematic diagram of main units of a use case operation device according to an embodiment of the present application;

[0051] Figure 5 is an exemplary system architecture diagram to which the embodiments of the present application can be applied;

[0052] Figure 6 It is a structural diagram of a computer system of a terminal device or server suitable for implementing an embodiment of the present application. DETAILED DESCRIPTION

[0053] The following is a description of exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0054] Figure 1 is a schematic diagram of the main process of the use case operation method according to the first embodiment of the present application, such as Figure 1 As shown, the use case running method includes:

[0055] Step S101: receiving a use case execution request and obtaining a scenario identifier in the use case execution request.

[0056] In this embodiment, the execution subject of the use case running method (for example, it can be a server) can receive the use case running request sent by the user through the terminal device through a wired connection or a wireless connection. A use case is a plot description in text form, and its essence is to discover and record functional requirements by writing a plot of using the system to achieve user goals. Each use case provides one or more scenarios, and each scenario has a corresponding scenario identifier. The scenario describes how the system interacts with the end user or other systems, that is, who can do what with the system, so as to obtain a clear business goal. A use case is a definition and description of a coherent functional unit of a system or subsystem without showing the internal structure of a system or subsystem. A use case describes a part of the entire system function, which is a relatively complete functional flow in logic. The scenario identifiers corresponding to each scenario can be included in the use case running request. After receiving the use case running request, the execution subject can obtain the scenario identifiers in the use case running request.

[0057] Step S102: determine the external interface to be simulated according to the scenario identifier, and generate a corresponding simulation interface return value according to the scenario identifier and the external interface.

[0058] Before running the use case, the execution subject needs to first determine whether it needs to call the external interface and whether it needs to simulate the external interface. When the execution subject determines that it needs to call the external interface but does not need to simulate the external interface, it keeps calling the external interface normally and runs the use case.

[0059] When the execution subject determines that it needs to call an external interface and needs to simulate the external interface, that is, in some optional implementation methods of this embodiment, the external interface that needs to be simulated may be an interface that is needed for the current use case and has not yet been developed. In order not to affect the operation of the use case, the execution subject needs to simulate the return value of the external interface.

[0060] In some optional implementations of this embodiment, determining the external interface to be simulated according to the scenario identifier includes:

[0061] According to the scenario identifier, determine the external interface that needs to be called; determine the external interface that needs to be called with a null return value as the external interface that needs to be simulated. If the return value is null, it may be that the external interface has been developed, but the execution subject cannot obtain the return value based on the external interface. It may be that the external interface fails or other situations cause the return value to be null. In this case, the execution subject can determine the external interface as the external interface that needs to be simulated.

[0062] Step S103, run the use case, and then call the corresponding simulation interface return value according to the scenario identifier to generate the use case running result.

[0063] After the execution subject generates the simulation interface return value corresponding to each scenario identifier in the use case execution request, before running the use case, the use case execution method also includes: determining the scenario keyword corresponding to the scenario identifier, and storing the scenario keyword and simulation interface return value corresponding to the same scenario identifier in a one-to-one correspondence.

[0064] In this embodiment, according to the scenario identifier, the corresponding simulation interface return value is called to generate the use case running result, including: according to the scenario keyword corresponding to the scenario identifier, the corresponding simulation interface return value is called to generate the use case running result. Specifically, the execution subject can be driven by data to execute the required scenario in the use case as a whole. During the execution process, according to the input scenario keyword, the corresponding simulation interface return value pre-configured is automatically obtained to run the use case.

[0065] This embodiment receives a use case execution request and obtains a scenario identifier in the use case execution request; determines the external interface to be simulated according to the scenario identifier, and generates a corresponding simulation interface return value according to the scenario identifier and the external interface; executes the use case, and then calls the corresponding simulation interface return value according to the scenario identifier to generate a use case execution result. Thus, this application pre-sets a matching scenario identifier and a corresponding simulation interface return value, and dynamically retrieves the corresponding simulation interface return value according to the scenario identifier when the use case is executed, thereby avoiding frequent modification of the simulation interface return value during the execution process, reducing the probability of errors in the simulated interface return value, reducing the workload, and improving the use case operation efficiency.

[0066] Figure 2 is a schematic diagram of the main flow of the use case operation method according to the second embodiment of the present application, such as Figure 2 As shown, the use case running method includes:

[0067] Step S201: receiving a use case execution request and obtaining a scenario identifier in the use case execution request.

[0068] Step S202: determine the external interface to be simulated according to the scenario identifier, and generate a corresponding simulation interface return value according to the scenario identifier and the external interface.

[0069] The principles of step S201 to step S202 are similar to those of step S101 to step S102 and will not be described in detail here.

[0070] Specifically, step S202 can also be implemented through steps S2021 to S2023:

[0071] Step S2021, determine the scenario use case requirement information based on the scenario identifier.

[0072] The scenario use case demand information in this embodiment may be the demand generated by the user in order to solve the problem encountered when developing a new system or software modification, including information on when, where, and under what circumstances the demand was generated. The scenario use case demand information may specifically include the source of demand, the method of processing demand, the requirements for demand, and the information obtained after analyzing the demand. Among them, the demand processing should comprehensively and completely record the user's expression content, including those described in language and those not described (the environment in which the user's demand is generated, the work background of the person who proposed the demand, the situation of the organization where the person who proposed the demand is located, etc.). Demand analysis can be to restore the user's needs through scenarios. Scenario is a transformation of demand, making the demand more specific and describing it in more detail in a narrative way. A demand can be decomposed into several scenarios. Among them, the scenario of the use case can include situations in different situations such as normal, special, and abnormal.

[0073] Among them, according to the scenario identification, the scenario use case requirement information is determined, including:

[0074] According to the scene identifier, determine the corresponding scene keyword.

[0075] After obtaining the scenario identifier, the execution subject can also determine the scenario keyword corresponding to the scenario identifier. The scenario keyword can be a concise description of the scenario corresponding to the scenario identifier. For example, the scenario identifier is 01, and the corresponding scenario keyword can be "transfer successful". It can be understood that the scenario identifier is just a code, and the user cannot know the meaning of the scenario identifier only from the scenario identifier. Therefore, the execution subject can match a keyword for each scenario identifier in the use case execution request to indicate the meaning of the scenario identifier. So that when a node in the use case execution outputs the scenario identifier, the user can accurately understand the meaning of the scenario identifier and make adaptive scene adjustments.

[0076] Based on the corresponding scenario keywords, determine the scenario use case requirement information.

[0077] For example, scenario keywords may be, for example, "transfer is normal" or "transfer is abnormal", and the corresponding scenario use case requirement information may include, but is not limited to, the input parameter format and output parameter format of the interface to be simulated, and the corresponding input parameter values ​​and output parameter values ​​to be assigned, and the parameter format corresponding to the system module interface that receives the return value of the simulated interface. This application does not specifically limit the content included in the scenario use case requirement information. The input parameter format and output parameter format of the interface to be simulated may be the same or different.

[0078] Step S2022, determining the input parameter format and output parameter format of the external interface.

[0079] The input parameter format of the external interface can be a numerical format, and the corresponding output parameter format can be a numerical format or a text format; the input parameter format of the external interface can be a text format, and the corresponding output parameter format can be a text format or a numerical format. The execution subject can determine the parameter format corresponding to the system module interface that receives the return value of the simulation interface in the scenario use case requirement information as the output parameter format of the interface to be simulated. Then, the execution subject can select the input parameter format corresponding to the determined output parameter format from the preset adaptable parameter formats of the interface to be simulated as the format of the input parameters for simulating the external interface.

[0080] For example, when the parameter format corresponding to the system module interface that receives the return value of the simulation interface in the scenario use case requirement information is a numerical format, that is, when the output parameter format in the parameter format adapted to the interface to be simulated is a numerical format, the preset corresponding input parameter format is a text format. Therefore, it can be determined that when simulating the external interface, the required input parameter format is a text format, and the output parameter format is a numerical format.

[0081] Step S2023, generate the corresponding simulation interface return value according to the scenario use case requirement information, input parameter format and output parameter format.

[0082] After determining the scenario use case requirement information, input parameter format and output parameter format, the execution entity can assign values ​​to the input parameters based on the scenario use case requirement information, such as the need for summation, difference or product, etc., as well as the required parameter format, and generate the corresponding simulation interface return value according to the logical algorithm in the interface to be simulated.

[0083] For example, when transferring money, you need to first calculate the amount of the transfer before you can drive the data and run the use case. The transfer amount calculated by the external interface is the return value of the interface that needs to be simulated, so you can determine that the input parameter format and output parameter format of the interface that needs to be simulated are both numerical formats. For example, according to the scenario keywords "transfer normal" and "transfer abnormal", it is determined that the format of the return value of the simulated interface to be called is a numerical format. Assuming that the internal logic algorithm function of the interface to be simulated is a+b, the execution subject can assign input parameters a and b according to the scenario use case requirement information (such as the format information of the return value of the simulated interface called, that is, the output parameter format of the interface to be simulated). When the input parameter format is a numerical format, for example, input parameters a=1, b=8, and the output parameter format is also a numerical format, the return value of the simulated interface is 9.

[0084] This embodiment generates a corresponding simulation interface return value according to scenario use case requirement information, input parameter format and output parameter format, so that the generation of the simulation interface return value can be more accurate.

[0085] Step S203, run the use case, and then call the corresponding simulation interface return value according to the scenario identifier to generate the use case running result.

[0086] The principle of step S203 is similar to that of step S103 and will not be described in detail here.

[0087] Specifically, an overall embodiment of the present application can be divided into five steps, namely, determining the external interface to be simulated (needed to be called during the use case operation); setting the scenario keywords and the return value of the simulation interface; storing the scenario keywords and the return value of the simulation interface; running the use case; and dynamically obtaining the result. The system modules corresponding to the five steps are independent of each other, and the running codes will not be mixed together. The calls between services are based on interfaces or services.

[0088] Specifically, determine the external interface that needs to be simulated (needed to be called during the use case operation). First, determine the output parameters and input parameters of the interface that needs to be simulated. Regardless of whether you fill in the input and output parameters directly through the simulation tool or simulate the interface through the program, you need to determine the output parameter and input parameter format of the interface that needs to be simulated, and generate the corresponding data according to the scenario use case requirements.

[0089] Specifically, the scenario keywords and the setting of the simulated interface return value are to determine the use case according to the scenario needs, and the number of use cases and parameter values ​​that need to be passed in are designed according to the data drive. Each scenario is described by a keyword, and the external interface needs to have a different return value for each scenario. This part of the return value is written in advance, that is, each scenario has its corresponding simulated interface return value. For example, when method A is called (external interface) method A, two parameters BC need to be passed in. When B is 1, 1.1 is returned, and when B is 2, 2.2 is returned. The 1.1 and 2.2 are the simulated interface return values ​​(i.e. mock values), which can be set to 1 and 2 respectively.

[0090] The storage of scene keywords and simulation interface return values ​​stores the simulation interface return values ​​and scene keywords in a one-to-one correspondence.

[0091] The use case runs according to data-driven and overall execution of the required scenarios, whether manual or automated. During the execution process, the pre-configured simulation interface return value is automatically obtained based on the passed scenario keywords to run the use case.

[0092] Dynamically obtain the value to obtain the result, dynamically obtain the simulation interface return value corresponding to the scenario identifier to run the test case to ensure the normal operation of the test case, and then obtain the operation result.

[0093] This embodiment pre-sets the simulation interface return values ​​for multiple scenarios to avoid the need to set the simulation interface return values ​​one by one during the execution process; and can process use cases in batches to reduce the probability of errors in the simulation interface return values ​​and improve the efficiency of running use cases.

[0094] Figure 3 1 is a schematic diagram of an application scenario of the use case operation method according to the third embodiment of the present application. The use case operation method is applied to a scenario where an external interface is required during the use case operation. Figure 3 As shown, the server 303 receives the use case execution request 301 and obtains the scenario identifier 302 in the use case execution request 301. The server 303 determines the external interface 304 to be simulated according to the scenario identifier 302, and generates the corresponding simulation interface return value 305 according to the scenario identifier 302 and the external interface 304. The server 303 executes the use case 306, and then calls the corresponding simulation interface return value 307 according to the scenario identifier 302 to generate the use case execution result 308.

[0095] Figure 4 Schematic diagram of the main units of the use case operation device according to the embodiment of the present application. Figure 4 As shown, the use case running device includes a receiving unit 401, a generating unit 402 and an running unit 403.

[0096] The receiving unit 401 is configured to receive a use case execution request and obtain a scenario identifier in the use case execution request.

[0097] The generating unit 402 is configured to determine the external interface to be simulated according to the scenario identifier, and generate a corresponding simulated interface return value according to the scenario identifier and the external interface.

[0098] The running unit 403 is configured to run the use case, and then call the corresponding simulation interface return value according to the scenario identifier to generate the use case running result.

[0099] In some embodiments, the generation unit 402 is further configured to: determine the external interface that needs to be called according to the scenario identifier; and determine the external interface that needs to be called and whose return value is null as the external interface that needs to be simulated.

[0100] In some embodiments, the generation unit 402 is further configured to: determine the scenario use case requirement information based on the scenario identifier; determine the input parameter format and output parameter format of the external interface; and generate a corresponding simulation interface return value based on the scenario use case requirement information, input parameter format and output parameter format.

[0101] In some embodiments, the generating unit 402 is further configured to: determine corresponding scenario keywords according to the scenario identifier; and determine scenario use case requirement information based on the corresponding scenario keywords.

[0102] In some embodiments, the use case execution device further includes Figure 4 The storage unit not shown in the figure is configured to store scene keywords and simulation interface return values ​​corresponding to the same scene identifier in a one-to-one correspondence.

[0103] In some embodiments, the running unit 403 is further configured to: call the corresponding simulation interface return value according to the scenario keyword corresponding to the scenario identifier, and then generate the use case running result.

[0104] It should be noted that the use case running method and the use case running device of the present application have a corresponding relationship in terms of specific implementation content, so the repeated content will not be explained again.

[0105] Figure 5 An exemplary system architecture 500 is shown to which the use case execution method or use case execution apparatus according to the embodiments of the present application can be applied.

[0106] like Figure 5 As shown, system architecture 500 may include terminal devices 501, 502, 503, a network 504 and a server 505. Network 504 is used to provide a medium for communication links between terminal devices 501, 502, 503 and server 505. Network 504 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0107] Users can use terminal devices 501, 502, 503 to interact with server 505 through network 504 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 501, 502, 503, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).

[0108] The terminal devices 501 , 502 , and 503 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.

[0109] Server 505 can be a server that provides various services, such as a background management server that provides support for use case operation requests submitted by users using terminal devices 501, 502, and 503 (only as an example). The background management server can receive the use case operation request and obtain the scenario identifier in the use case operation request; determine the external interface that needs to be simulated according to the scenario identifier, and generate the corresponding simulation interface return value according to the scenario identifier and the external interface; run the use case, and then call the corresponding simulation interface return value according to the scenario identifier to generate the use case operation result. Therefore, the present application pre-sets the matching scenario identifier and the corresponding simulation interface return value, and when the use case is executed, the corresponding simulation interface return value is dynamically taken out according to the scenario identifier, so as to avoid frequent modification of the simulation interface return value during the execution process, reduce the probability of error in the simulated interface return value, and improve the use case operation efficiency.

[0110] It should be noted that the use case running method provided in the embodiment of the present application is generally executed by the server 505 , and accordingly, the use case running device is generally set in the server 505 .

[0111] It should be understood that Figure 5 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0112] Reference below Figure 6 , which shows a schematic diagram of the structure of a computer system 600 of a terminal device suitable for implementing an embodiment of the present application. Figure 6 The terminal device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0113] like Figure 6 As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the computer system 600 are also stored. The CPU 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0114] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage section 608 as needed.

[0115] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the central processing unit (CPU) 601, the above-mentioned functions defined in the system of the present application are executed.

[0116] It should be noted that the computer-readable medium shown in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with 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 application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0117] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the above-mentioned module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0118] The units involved in the embodiments described in the present application may be implemented by software or hardware. The units described may also be set in a processor, for example, it may be described as: a processor includes a receiving unit, a generating unit, and an operating unit. The names of these units do not constitute limitations on the units themselves in some cases.

[0119] As another aspect, the present application also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently and not be 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 receives a use case execution request and obtains a scenario identifier in the use case execution request; determines the external interface to be simulated according to the scenario identifier, and generates a corresponding simulation interface return value according to the scenario identifier and the external interface; runs the use case, and then calls the corresponding simulation interface return value according to the scenario identifier to generate the use case execution result. Therefore, the present application pre-sets the matching scenario identifier and the corresponding simulation interface return value, and dynamically retrieves the corresponding simulation interface return value according to the scenario identifier when the use case is executed, so as to avoid frequent modification of the simulation interface return value during the execution process, reduce the probability of errors in the simulated interface return value, and improve the use case operation efficiency.

[0120] According to the technical solution of the embodiment of the present application, by receiving a use case execution request, the scenario identifier in the use case execution request is obtained; the external interface to be simulated is determined according to the scenario identifier, and the corresponding simulation interface return value is generated according to the scenario identifier and the external interface; the use case is executed, and then the corresponding simulation interface return value is called according to the scenario identifier to generate the use case execution result. Thus, the present application pre-sets the matching scenario identifier and the corresponding simulation interface return value, and when the use case is executed, the corresponding simulation interface return value is dynamically retrieved according to the scenario identifier, so as to avoid frequent modification of the simulation interface return value during the execution process, reduce the probability of error in the simulated interface return value, and improve the use case operation efficiency.

[0121] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art 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 principles of this application should be included in the protection scope of this application.

Claims

1. A use case running method, characterized in that: include: Receive a use case execution request, and obtain a scenario identifier in the use case execution request; Determine the external interface to be simulated according to the scenario identifier, and generate a corresponding simulation interface return value according to the scenario identifier and the external interface, wherein the determining the external interface to be simulated according to the scenario identifier includes: determining the external interface to be called according to the scenario identifier, and determining the external interface to be called with a return value of null as the external interface to be simulated; generating the corresponding simulation interface return value according to the scenario identifier and the external interface includes: determining the scenario use case requirement information according to the scenario identifier; determining the input parameter format and the output parameter format of the external interface; generating the corresponding simulation interface return value according to the scenario use case requirement information, the input parameter format and the output parameter format; determining the scenario use case requirement information according to the scenario identifier includes: determining the corresponding scenario keyword according to the scenario identifier; determining the scenario use case requirement information based on the corresponding scenario keyword; Run the use case, and then call the corresponding simulation interface return value according to the scenario identifier to generate the use case running result.

2. The method according to claim 1, characterized in that Before running the use case, the method further includes: The scene keywords and simulation interface return values ​​corresponding to the same scene identifier are stored one by one.

3. The method according to claim 2, characterized in that The calling of the corresponding simulation interface return value according to the scenario identifier to generate the use case running result includes: According to the scenario keyword corresponding to the scenario identifier, the corresponding simulation interface return value is called to generate the use case running result.

4. A use case running device, characterized in that: include: A receiving unit, configured to receive a use case execution request and obtain a scenario identifier in the use case execution request; A generation unit is configured to determine an external interface to be simulated according to the scenario identifier, and to generate a corresponding simulation interface return value according to the scenario identifier and the external interface, wherein the generation unit is further configured to: determine the external interface to be called according to the scenario identifier, and determine the external interface to be called with a return value of null as the external interface to be simulated; the generation of the corresponding simulation interface return value according to the scenario identifier and the external interface includes: determining scenario use case requirement information according to the scenario identifier; determining the input parameter format and output parameter format of the external interface; generating the corresponding simulation interface return value according to the scenario use case requirement information, the input parameter format and the output parameter format; the determination of the scenario use case requirement information according to the scenario identifier includes: determining the corresponding scenario keyword according to the scenario identifier; determining the scenario use case requirement information based on the corresponding scenario keyword; The running unit is configured to run the use case, and then call the corresponding simulation interface return value according to the scenario identifier to generate the use case running result.

5. A use case operation electronic device, characterized in that: include: 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 to 3.

6. 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 to 3 is implemented.