Path searching method and device, computer equipment and computer readable storage medium
By automatically adjusting the status value using the path search method in application tests, the problem of high script cost in the existing technology of manual translation test cases is solved, and automated testing is realized, reducing costs.
Patent Information
- Application Number
- CN202411579305.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-06
- Publication Date
- 2025-03-14
AI Technical Summary
During the testing process of existing applications, test cases need to be translated manually into scripts, resulting in high labor costs.
Provide a path search method, by obtaining the initial state value and the target state value of the target attribute, performing path search based on these values, obtaining target event information, and performing these events to automatically adjust the state value until the target state value is reached.
It realizes automatic path search and event execution during application testing, reducing the cost of writing test cases.
Smart Images

Figure CN119621546A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a path search method, device, computer equipment and computer-readable storage medium. Background Art
[0002] System-level applications such as LiveTV and Settings are stable but complex, have long development cycles, and are burdened with history. To ensure that the application can run normally on the terminal device, the application needs to be tested after the application is developed or updated. However, the existing application testing process usually requires manual translation of test cases into scripts, which is labor-intensive. Summary of the invention
[0003] The embodiments of the present application provide a path search method, apparatus, computer device, and computer-readable storage medium, which can automatically perform path search and event execution, thereby reducing the cost of writing test cases.
[0004] The technical solution adopted by the present invention to solve the problem is as follows:
[0005] On the one hand, the present application provides a path search method, comprising:
[0006] Obtaining an initial state value corresponding to the first target attribute and a target state value corresponding to the first target attribute;
[0007] Perform path search based on the initial state value and the target state value to obtain target event information;
[0008] Executing the target event corresponding to the target event information to adjust the state value of the first target attribute from the initial state value to the first state value;
[0009] The first state value is used as the initial state value, and the step of performing a path search based on the initial state value and the target state value is continued until the first state value becomes the target state value.
[0010] In some embodiments of the present application, the target state value includes multiple state values, and a path search is performed based on the initial state value and the target state value to obtain a target event, including:
[0011] Taking any state value in the target state value as the target value, determine whether the initial state value is equal to the target value and whether the target value has been searched;
[0012] If the initial state value is not equal to the target value and the target value has not been searched, determine whether the initial state value can directly reach the target value;
[0013] If the initial state value can directly reach the target value, the event information between the initial state value and the target value is determined as the target event information.
[0014] In some embodiments of the present application, after determining whether the initial state value can directly reach the target value, the following steps are included:
[0015] If the initial state value cannot directly reach the target value, a second state value is determined based on the target value; the second state value is a state value that can directly reach the target value;
[0016] Taking the second state value as the target value, continuing to perform the steps of determining whether the initial state value is equal to the target value and whether the target value has been searched, until the initial state value can directly reach the target value;
[0017] The event information between the initial state value and the target value is determined as the target event information.
[0018] In some embodiments of the present application, after determining whether the initial state value is equal to the target value and whether the target value has been searched, the following steps are performed:
[0019] If the initial state value is equal to the target value or the target value has been searched, any state value that has not been traversed in the target state value is used as the target value, and the steps of determining whether the initial state value is equal to the target value and whether the target value has been searched are continued until the initial state value can directly reach the target value;
[0020] The event information between the initial state value and the target value is determined as the target event information.
[0021] In some implementation schemes of the present application, the target state value corresponding to the first target attribute is obtained by the following steps:
[0022] Obtaining a candidate state value corresponding to a first target attribute of the application to be tested and a target state corresponding to the first target attribute;
[0023] Based on the candidate state values and the target state, a target state value corresponding to the first target attribute is determined.
[0024] In some implementation schemes of the present application, after executing the target event corresponding to the target event information, the following steps are included:
[0025] Determine a second target attribute from all attributes of the application to be tested based on the first target attribute; the second target attribute is an attribute that has a dependency relationship with the first target attribute among all attributes;
[0026] The state value of the second target attribute is updated based on the target event information.
[0027] In some embodiments of the present application, updating the state value of the second target attribute based on the target event information includes:
[0028] Obtain a third state value corresponding to the second target attribute;
[0029] Determine a fourth state value corresponding to the second target attribute based on the target event information and the third state value;
[0030] It is determined whether the fourth state value is the same as the third state value. If the fourth state value is not the same as the third state value, the state value of the second target attribute is adjusted from the third state value to the fourth state value.
[0031] In a second aspect, an embodiment of the present invention further provides a path search device, including:
[0032] An information acquisition module, used to acquire an initial state value corresponding to the first target attribute and a target state value corresponding to the first target attribute;
[0033] A first search module, used for performing path search based on the initial state value and the target state value to obtain target event information;
[0034] An event execution module, used for executing a target event corresponding to the target event information, so as to adjust the state value of the first target attribute from an initial state value to a first state value;
[0035] The second search module is used to use the first state value as the initial state value and continue to perform the step of performing path search based on the initial state value and the target state value until the first state value becomes the target state value.
[0036] In a third aspect, the present application further provides a computer device, the computer device comprising:
[0037] one or more processors;
[0038] Memory; and
[0039] One or more application programs, wherein the one or more application programs are stored in a memory and configured to be executed by a processor to implement any one of the path search methods in the first aspect.
[0040] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, and the computer program is loaded by a processor to execute the steps in any one of the path search methods in the first aspect.
[0041] The beneficial effects of the present invention are as follows: target event information is obtained by performing a path search based on an initial state value and a target state value, a target event corresponding to the target event information is executed, and the first state value is used as the initial state value, and the step of performing a path search based on the initial state value and the target state value is continued until the first state value is the target state value. During the application testing process, path search and event execution can be automatically performed, and the test of the application to be tested can be implemented without translating the test case into a script, which can reduce the cost of writing the test case. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0043] Figure 1 is a schematic diagram of a scenario of a path search system provided by an embodiment of the present invention;
[0044] Figure 2 is a flow chart of a path search method provided by an embodiment of the present invention;
[0045] Figure 3 is a schematic diagram of a scenario of a path search method provided by an embodiment of the present invention;
[0046] Figure 4 is a principle block diagram of a path search device provided by an embodiment of the present invention;
[0047] Figure 5 It is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0048] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0049] In the description of the present application, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present application. In addition, the terms "first", "second", "third" and the like are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, features defined as "first", "second", "third" and the like may explicitly or implicitly include one or more of the said features.
[0050] In this application, the word "exemplary" is used to mean "used as an example, illustration, or description." Any embodiment described in this application as "exemplary" is not necessarily to be construed as being preferred or advantageous over other embodiments. The following description is given to enable any technician in the field to implement and use the present application. In the following description, details are listed for the purpose of explanation. It should be understood that a person of ordinary skill in the art can recognize that the present application can be implemented without using these specific details. In other instances, well-known structures and processes will not be elaborated in detail to avoid obscuring the description of the present application with unnecessary details. Therefore, the present application is not intended to be limited to the embodiments shown, but is consistent with the widest scope consistent with the principles and features disclosed in the present application.
[0051] It should be noted that since the method of the embodiment of the present application is executed in a computer device, the processing objects of each computer device exist in the form of data or information. For example, time is actually time information. It can be understood that if size, quantity, position, etc. are mentioned in subsequent embodiments, they are all corresponding data for processing by the computer device. The details will not be repeated here.
[0052] The embodiments of the present application provide a path search method, apparatus, computer device, and computer-readable storage medium, which are described in detail below.
[0053] See also Figure 1 , Figure 1 Schematic diagram of a scenario of a path search system provided in an embodiment of the present application. The path search system may include a computer device 100, in which a path search device is integrated, such as Figure 1 Computer equipment in.
[0054] In the embodiment of the present application, the computer device 100 is mainly used to obtain an initial state value corresponding to a first target attribute and a target state value corresponding to the first target attribute; perform a path search based on the initial state value and the target state value to obtain target event information; execute a target event corresponding to the target event information to adjust the state value of the first target attribute from the initial state value to the first state value; use the first state value as the initial state value, and continue to perform the step of performing a path search based on the initial state value and the target state value until the first state value is the target state value. During the application testing process, path search and event execution can be automatically performed, and the test of the application to be tested can be implemented without translating the test case into a script, which can reduce the cost of writing the test case.
[0055] In the embodiment of the present application, the computer device 100 may be an independent server, or a server network or server cluster composed of servers. For example, the computer device 100 described in the embodiment of the present application includes but is not limited to a computer, a network host, a single network server, a plurality of network server sets or a cloud server composed of a plurality of servers. The cloud server is composed of a large number of computers or network servers based on cloud computing.
[0056] It is understandable that the computer device 100 used in the embodiments of the present application may be a device including both receiving and transmitting hardware, that is, a device having receiving and transmitting hardware capable of performing two-way communication on a two-way communication link. Such a device may include: a cellular or other communication device having a single-line display or a multi-line display or a cellular or other communication device without a multi-line display. The specific computer device 100 may be a desktop terminal or a mobile terminal, and the computer device 100 may also be one of a smart TV, a mobile phone, a tablet computer, a laptop computer, etc.
[0057] Those skilled in the art will understand that Figure 1 The application environment shown in the figure is only one application scenario of the present application solution and does not constitute a limitation on the application scenario of the present application solution. Other application environments may also include Figure 1 More or less computer equipment as shown in Figure 1 Only one computer device is shown in the figure. It can be understood that the path search system can also include one or more other services, which are not specifically limited here.
[0058] In addition, if Figure 1 As shown, the path search system may further include a memory 200 for storing data, such as state values, such as initial state values, target state values, etc., such as target attributes, such as first target attributes, second target attributes, etc.
[0059] It should be noted that Figure 1 The scenario diagram of the path search system shown is only an example. The path search system and scenario described in the embodiment of the present application are intended to more clearly illustrate the technical solution of the embodiment of the present application, and do not constitute a limitation on the technical solution provided in the embodiment of the present application. Ordinary technicians in this field can know that with the evolution of the path search system and the emergence of new business scenarios, the technical solution provided in the embodiment of the present application is also applicable to similar technical problems.
[0060] First, a path search method is provided in an embodiment of the present application. The execution subject of the path search method is a path search device, and the path search device is applied to a computer device. The path search method includes: obtaining an initial state value corresponding to a first target attribute and a target state value corresponding to the first target attribute; performing a path search based on the initial state value and the target state value to obtain target event information; executing a target event corresponding to the target event information to adjust the state value of the first target attribute from the initial state value to the first state value; using the first state value as the initial state value, and continuing to perform the step of performing a path search based on the initial state value and the target state value until the first state value is the target state value.
[0061] like Figure 2 FIG. 2 is a flow chart of an embodiment of a path search method in an embodiment of the present application. The path search method may include the following steps S201 to S204, which are as follows:
[0062] Step S201: Acquire an initial state value corresponding to a first target attribute and a target state value corresponding to the first target attribute.
[0063] In this embodiment, the first target attribute is the attribute that the application to be tested currently needs to test. For example, the first target attribute can be the current page, or the first target attribute can also be focus change, etc. This embodiment does not limit this. The initial state value is the current attribute value of the first target attribute. For example, the first target attribute is the current page, and the current attribute value of the current page is page A, then the initial state value is page A. The target state value is the attribute value that the first target attribute needs to reach during the test. For example, if the current page needs to jump from page A to page B, then the target state value is page B.
[0064] In a specific embodiment, the target state value corresponding to the first target attribute is obtained by the following steps: obtaining the candidate state value corresponding to the first target attribute of the application to be tested and the target state corresponding to the first target attribute; based on the candidate state value and the target state, determining the target state value corresponding to the first target attribute.
[0065] The first target attribute is the attribute that the test application currently needs to test, and the candidate state values corresponding to the first target attribute are all possible state values of the first target attribute of the application to be tested. For example, the first target attribute is the current page, and the current page can be page A, page B, page C, or page D. The candidate state values corresponding to the first target attribute include page A, page B, page C, and page D. The target state corresponding to the first target attribute is the attribute state that the first target attribute needs to reach, for example, the target state is current page = page B, the target state is current page ≠ page B, etc.
[0066] It should be noted that the target status value may include only one status value or multiple status values. For example, the candidate status values corresponding to the first target attribute include page A, page B, page C and page D. If the target state of the first target attribute is that the current page = page B, then the target status value is page B; if the target state of the first target attribute is that the current page ≠ page B, then the target status value includes page A, page C and page D.
[0067] Step S202: Perform path search based on the initial state value and the target state value to obtain target event information.
[0068] In this embodiment, the target event information is the event information between the initial state value and the first state value obtained by performing a path search based on the initial state value and the target state value. For example, Figure 3 As shown, the initial state value is page A, the first state value is page C, and the target event information is the key event information between page A and page C.
[0069] In a specific embodiment, the target state value includes multiple state values, and the above-mentioned path search based on the initial state value and the target state value to obtain the target event specifically includes: taking any state value in the target state value as the target value, judging whether the initial state value is equal to the target value and whether the target value has been searched; if the initial state value is not equal to the target value and the target value has not been searched, judging whether the initial state value can directly reach the target value; if the initial state value can directly reach the target value, determining the event information between the initial state value and the target value as the target event information.
[0070] In this embodiment, judging whether the initial state value can directly reach the target value refers to judging whether the state value of the first target attribute can be adjusted from the initial state value to the target value through a specific event. If the state value of the first target attribute can be adjusted from the initial state value to the target value through a specific event, it is determined that the initial state value can directly reach the target value. Conversely, if the state value of the first target attribute cannot be adjusted from the initial state value to the target value through a specific event, it is determined that the initial state value cannot directly reach the target value. For example, continue to refer to Figure 3 As shown, the current page can be adjusted from page A to page C through a key event, so page A can directly reach page C. Page A needs to go through some intermediate events to reach page B, so page A cannot directly reach page B.
[0071] In a specific embodiment, the step of determining whether the initial state value can directly reach the target value specifically includes: inputting the initial state value and the target value into a preset first function to obtain first output information; and determining whether the initial state value can directly reach the target value based on the first output information. The first function can be expressed as: getEvent(from:X, to:Y), X represents the initial state value, Y represents the target value, and for a given X / Y combination, if X can directly reach Y, the first output information is the event information between X and Y, and if X cannot directly reach Y, the first output information is Null. Therefore, based on whether the first output information is Null, it can be determined whether the initial state value can directly reach the target value.
[0072] In a specific embodiment, if the initial state value is not equal to the target value and the target value has not been searched, it is further determined whether the initial state value can directly reach the target value. If the initial state value can directly reach the target value, it is determined whether the path dependencies between the initial state value and the target value are all satisfied. If the path dependencies between the initial state value and the target value are all satisfied, the event information between the initial state value and the target value is determined as the target event information. For example, if page A can directly reach page C, it is determined whether the path dependencies between page A and page C are all satisfied. If the path dependencies between page A and page C are all satisfied, the key event information between page A and page C is determined as the target event information.
[0073] In a specific embodiment, after the above-mentioned determination of whether the initial state value can directly reach the target value, it includes: if the initial state value cannot directly reach the target value, determining a second state value based on the target value; taking the second state value as the target value, continuing to execute the steps of determining whether the initial state value is equal to the target value and whether the target value has been searched, until the initial state value can directly reach the target value; determining the event information between the initial state value and the target value as the target event information.
[0074] In this embodiment, the second state value is a state value that can directly reach the target value. If the initial state value cannot directly reach the target value, the second state value that can directly reach the target value is selected as the target value, and the aforementioned steps of determining whether the initial state value is equal to the target value and whether the target value has been searched are continued until a target value that can directly reach the initial state value is searched, and the event information between the initial state value and the target value is determined as the target event information.
[0075] For example, continue to refer to Figure 3As shown, if page A cannot directly reach page B, then page D that can directly reach page B is selected as the target value. If page D is not equal to page A and page D has not been searched, determine whether page A can directly reach page D. If page A cannot directly reach page D, then page C that can directly reach page D is selected as the target value. If page C is not equal to page A and page C has not been searched, determine whether page A can directly reach page C. If page A can directly reach page C, the key event information between page A and page C is determined as the target event information.
[0076] In a specific embodiment, the step of determining the second state value based on the target value specifically includes: inputting the target value into a preset second function, and outputting the second state value through the second function. The second function can be expressed as: getFrom(to:Y), Y represents the target value, and for a given Y, there may be 0 (out of the value range, Null is returned), 1 or multiple second state values.
[0077] In a specific embodiment, after the above-mentioned determination of whether the initial state value is equal to the target value and whether the target value has been searched, it includes: if the initial state value is equal to the target value or the target value has been searched, taking any state value in the target state value that has not been traversed as the target value, and continuing to execute the steps of determining whether the initial state value is equal to the target value and whether the target value has been searched, until the initial state value can directly reach the target value; and determining the event information between the initial state value and the target value as the target event information.
[0078] In this embodiment, any state value in the target state value is used as the target value. If the initial state value is equal to the target value or the target value has been searched, any other state value in the target state value that has not been traversed is used as the target value, and the aforementioned steps of determining whether the initial state value is equal to the target value and whether the target value has been searched are continued until the initial state value can directly reach the target value; the event information between the initial state value and the target value is determined as the target event information.
[0079] S203: Execute the target event corresponding to the target event information to adjust the state value of the first target attribute from the initial state value to the first state value.
[0080] In this embodiment, the target event information is the event information between the initial state value and the first state value obtained by performing a path search based on the initial state value and the target state value. After determining the target event information, executing the target event corresponding to the target event information can adjust the state value of the first target attribute from the initial state value to the first state value. Figure 3 As shown, the initial state value of the current page is page A. By executing a key event between page A and page C, the state value of the current page can be adjusted from page A to page C.
[0081] In a specific embodiment, after executing the target event corresponding to the target event information in the above step S203, the following steps are included: determining a second target attribute from all attributes of the application to be tested based on the first target attribute; the second target attribute is an attribute that has a dependency relationship with the first target attribute among all attributes; and updating the state value of the second target attribute based on the target event information. In this embodiment, the second target attribute is determined from all attributes of the application to be tested, and the state value of the second target attribute is updated based on the target event information, so that the attribute value corresponding to the second target attribute that has a dependency relationship with the first target attribute changes with the change of the attribute value of the first target attribute.
[0082] In a specific embodiment, the above-mentioned step of updating the status value of the second target attribute based on the target event information specifically includes: obtaining the third status value corresponding to the second target attribute; determining the fourth status value corresponding to the second target attribute based on the target event information and the third status value; judging whether the fourth status value is the same as the third status value, and if the fourth status value is different from the third status value, adjusting the status value of the second target attribute from the third status value to the fourth status value.
[0083] In this embodiment, the third state value is the current state value corresponding to the second target attribute. In a specific embodiment, the step of determining the fourth state value corresponding to the second target attribute based on the target event information and the third state value specifically includes: inputting the target event information and the third state value into a preset third function to obtain second output information; based on the second output information, determining the fourth state value corresponding to the second target attribute. The third function can be expressed as: getTo(from:V, event:Event), V represents the third state value, Event represents the target event information, and for a given V, if it is not within the value range of x, Null is returned; otherwise, there is a unique function value To corresponding to it.
[0084] S204: Taking the first state value as the initial state value, and continuing to perform the step of performing a path search based on the initial state value and the target state value until the first state value becomes the target state value.
[0085] In this embodiment, the first state value is used as the initial state value, and the path search step based on the initial state value and the target state value is continued until the first state value is the target state value, so that the test of the application to be tested can be implemented. For example, the first target attribute is the current page, and the current page is jumped from page A to page D, and then page D is jumped to page C, and then page C is jumped to page B, so that the page jump function of the application to be tested can be tested.
[0086] It should be noted that a test case is essentially a path. For example, to jump from page A to page B, press the X key to observe whether the interface performance meets expectations. In the existing application testing process, the test case needs to be translated into a script, which has high labor costs. This embodiment performs a path search based on the initial state value and the target state value to obtain the target event information, executes the target event corresponding to the target event information, and uses the first state value as the initial state value, and continues to perform the path search based on the initial state value and the target state value until the first state value is the target state value. Without translating the test case into a script, the test of the application to be tested can be realized, which can reduce the cost of writing the test case.
[0087] In summary, the path search method provided by this implementation scheme obtains the initial state value corresponding to the first target attribute and the target state value corresponding to the first target attribute, performs path search based on the initial state value and the target state value, obtains target event information, executes the target event corresponding to the target event information, so as to adjust the state value of the first target attribute from the initial state value to the first state value, takes the first state value as the initial state value, and continues to perform the step of performing path search based on the initial state value and the target state value until the first state value is the target state value. In this scheme, a path search is performed based on the initial state value and the target state value to obtain target event information, the target event corresponding to the target event information is executed, and the first state value is used as the initial state value, and the step of performing a path search based on the initial state value and the target state value is continued until the first state value is the target state value. In the application testing process, path search and event execution can be automatically performed, and the test of the application to be tested can be implemented without translating the test case into a script, which can reduce the cost of writing the test case. Furthermore, a second target attribute that has a dependency relationship with the first target attribute is determined from all attributes of the application to be tested, and the state value of the second target attribute is updated based on the target event information, so that the attribute value corresponding to the second target attribute that has a dependency relationship with the first target attribute in the application to be tested can change with the change of the attribute value of the first target attribute.
[0088] In order to better implement the path search method in the embodiment of the present application, based on the path search method, the embodiment of the present application also provides a path search device, such as Figure 4 As shown, the path search device 600 includes:
[0089] An information acquisition module 610 is used to acquire an initial state value corresponding to the first target attribute and a target state value corresponding to the first target attribute;
[0090] A first search module 620, configured to perform a path search based on an initial state value and a target state value to obtain target event information;
[0091] An event execution module 630, configured to execute a target event corresponding to the target event information, so as to adjust the state value of the first target attribute from an initial state value to a first state value;
[0092] The second search module 640 is used to use the first state value as the initial state value and continue to perform the step of performing a path search based on the initial state value and the target state value until the first state value becomes the target state value.
[0093] In an embodiment of the present application, a path search is performed based on the initial state value and the target state value to obtain target event information, the target event corresponding to the target event information is executed, and the first state value is used as the initial state value, and the step of performing a path search based on the initial state value and the target state value is continued until the first state value is the target state value. During the application testing process, path search and event execution can be automatically performed, and the testing of the application to be tested can be implemented without translating the test case into a script, which can reduce the cost of writing the test case.
[0094] In some embodiments of the present application, the target state value includes multiple state values, and the first search module 620 is specifically used to:
[0095] Taking any state value in the target state value as the target value, determine whether the initial state value is equal to the target value and whether the target value has been searched;
[0096] If the initial state value is not equal to the target value and the target value has not been searched, determine whether the initial state value can directly reach the target value;
[0097] If the initial state value can directly reach the target value, the event information between the initial state value and the target value is determined as the target event information.
[0098] In some embodiments of the present application, the first search module 620 is further configured to:
[0099] If the initial state value cannot directly reach the target value, a second state value is determined based on the target value; the second state value is a state value that can directly reach the target value;
[0100] Taking the second state value as the target value, continuing to perform the steps of determining whether the initial state value is equal to the target value and whether the target value has been searched, until the initial state value can directly reach the target value;
[0101] The event information between the initial state value and the target value is determined as the target event information.
[0102] In some embodiments of the present application, the first search module 620 is further configured to:
[0103] If the initial state value is equal to the target value or the target value has been searched, any state value that has not been traversed in the target state value is used as the target value, and the steps of determining whether the initial state value is equal to the target value and whether the target value has been searched are continued until the initial state value can directly reach the target value;
[0104] The event information between the initial state value and the target value is determined as the target event information.
[0105] In some embodiments of the present application, the information acquisition module 610 is specifically used to:
[0106] Obtaining a candidate state value corresponding to a first target attribute of the application to be tested and a target state corresponding to the first target attribute;
[0107] Based on the candidate state values and the target state, a target state value corresponding to the first target attribute is determined.
[0108] In some embodiments of the present application, the event execution module 630 is further used to:
[0109] Determine a second target attribute from all attributes of the application to be tested based on the first target attribute; the second target attribute is an attribute that has a dependency relationship with the first target attribute among all attributes;
[0110] The state value of the second target attribute is updated based on the target event information.
[0111] In some embodiments of the present application, the event execution module 630 is further used to:
[0112] Obtain a third state value corresponding to the second target attribute;
[0113] Determine a fourth state value corresponding to the second target attribute based on the target event information and the third state value;
[0114] It is determined whether the fourth state value is the same as the third state value. If the fourth state value is not the same as the third state value, the state value of the second target attribute is adjusted from the third state value to the fourth state value.
[0115] An embodiment of the present application also provides a computer device, which integrates any one of the path search devices provided in the embodiments of the present application, and the computer device includes: one or more processors, a memory, and one or more applications, wherein the one or more applications are stored in the memory and are configured to execute the steps of the path search method in any one of the above-mentioned path search method embodiments by the processor.
[0116] The present application also provides a computer device that integrates any of the path search devices provided in the present application. Figure 5As shown, it shows a schematic diagram of the structure of the computer device involved in the embodiment of the present application, specifically:
[0117] The computer device may include one or more processing core processors 801, one or more computer-readable storage media memories 802, a power supply 803, an input unit 804 and other components. Those skilled in the art will appreciate that Figure 5 The computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. Among them:
[0118] The processor 801 is the control center of the computer device. It uses various interfaces and lines to connect various parts of the entire computer device. By running or executing software programs and / or modules stored in the memory 802 and calling data stored in the memory 802, it executes various functions of the computer device and processes data, thereby monitoring the computer device as a whole. Optionally, the processor 801 may include one or more processing cores; preferably, the processor 801 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 801.
[0119] The memory 802 can be used to store software programs and modules. The processor 801 executes various functional applications and data processing by running the software programs and modules stored in the memory 802. The memory 802 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 802 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage device. Accordingly, the memory 802 may also include a memory controller to provide the processor 801 with access to the memory 802.
[0120] The computer device also includes a power supply 803 for supplying power to each component. Preferably, the power supply 803 can be logically connected to the processor 801 through a power management system, so that the power management system can manage charging, discharging, power consumption and other functions. The power supply 803 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators and other arbitrary components.
[0121] The computer device may further include an input unit 804, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0122] Although not shown, the computer device may further include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 801 in the computer device will load the executable files corresponding to the processes of one or more application programs into the memory 802 according to the following instructions, and the processor 801 will run the application programs stored in the memory 802, thereby realizing various functions, as follows:
[0123] Obtaining an initial state value corresponding to the first target attribute and a target state value corresponding to the first target attribute;
[0124] Perform path search based on the initial state value and the target state value to obtain target event information;
[0125] Executing the target event corresponding to the target event information to adjust the state value of the first target attribute from the initial state value to the first state value;
[0126] The first state value is used as the initial state value, and the step of performing a path search based on the initial state value and the target state value is continued until the first state value becomes the target state value.
[0127] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0128] To this end, an embodiment of the present application provides a computer-readable storage medium, which may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc. A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in any path search method provided in the embodiment of the present application. For example, the computer program is loaded by the processor to execute the following steps:
[0129] Obtaining an initial state value corresponding to the first target attribute and a target state value corresponding to the first target attribute;
[0130] Perform path search based on the initial state value and the target state value to obtain target event information;
[0131] Executing the target event corresponding to the target event information to adjust the state value of the first target attribute from the initial state value to the first state value;
[0132] The first state value is used as the initial state value, and the step of performing a path search based on the initial state value and the target state value is continued until the first state value becomes the target state value.
[0133] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the detailed description of other embodiments above, and will not be repeated here.
[0134] In specific implementation, the above units or structures can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same or several entities. The specific implementation of the above units or structures can refer to the previous method embodiments, which will not be repeated here.
[0135] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0136] The above is a detailed introduction to a path search method, device, computer equipment and computer-readable storage medium provided in an embodiment of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A path search method, characterized in that: include: Acquire an initial state value corresponding to a first target attribute and a target state value corresponding to the first target attribute; Perform path search based on the initial state value and the target state value to obtain target event information; executing the target event corresponding to the target event information to adjust the state value of the first target attribute from the initial state value to a first state value; The first state value is used as the initial state value, and the step of performing a path search based on the initial state value and the target state value is continued until the first state value reaches the target state value.
2. The path search method according to claim 1, characterized in that: The target state value includes a plurality of state values, and the path search is performed based on the initial state value and the target state value to obtain a target event, including: Taking any state value among the target state values as a target value, determining whether the initial state value is equal to the target value and whether the target value has been searched; If the initial state value is not equal to the target value and the target value has not been searched, determining whether the initial state value can directly reach the target value; If the initial state value can directly reach the target value, the event information between the initial state value and the target value is determined as the target event information.
3. The path search method according to claim 2, characterized in that: After determining whether the initial state value can directly reach the target value, the method further comprises: If the initial state value cannot directly reach the target value, determining a second state value based on the target value; the second state value is a state value that can directly reach the target value; Taking the second state value as the target value, continuing to perform the step of determining whether the initial state value is equal to the target value and whether the target value has been searched, until the initial state value can directly reach the target value; The event information between the initial state value and the target value is determined as the target event information.
4. The path search method according to claim 2, characterized in that: After determining whether the initial state value is equal to the target value and whether the target value has been searched, the method further comprises: If the initial state value is equal to the target value or the target value has been searched, any state value among the target state values that has not been traversed is used as the target value, and the steps of determining whether the initial state value is equal to the target value and whether the target value has been searched are continued until the initial state value can directly reach the target value; The event information between the initial state value and the target value is determined as the target event information.
5. The path search method according to claim 1, characterized in that: The target state value corresponding to the first target attribute is obtained by the following steps: Obtaining a candidate state value corresponding to a first target attribute of the application to be tested and a target state corresponding to the first target attribute; Based on the candidate state values and the target state, a target state value corresponding to the first target attribute is determined.
6. The path search method according to claim 1, characterized in that: After executing the target event corresponding to the target event information, the method includes: Determine a second target attribute from all attributes of the application to be tested based on the first target attribute; the second target attribute is an attribute that has a dependency relationship with the first target attribute among all attributes; The state value of the second target attribute is updated based on the target event information.
7. The path search method according to claim 6, characterized in that: The updating of the state value of the second target attribute based on the target event information includes: Obtaining a third state value corresponding to the second target attribute; Determining a fourth state value corresponding to the second target attribute based on the target event information and the third state value; It is determined whether the fourth state value is the same as the third state value; if the fourth state value is not the same as the third state value, the state value of the second target attribute is adjusted from the third state value to the fourth state value.
8. A route search device, characterized in that: include: An information acquisition module, used to acquire an initial state value corresponding to a first target attribute and a target state value corresponding to the first target attribute; A first search module, configured to perform a path search based on the initial state value and the target state value to obtain target event information; an event execution module, configured to execute the target event corresponding to the target event information, so as to adjust the state value of the first target attribute from the initial state value to a first state value; The second search module is used to use the first state value as the initial state value and continue to perform the step of performing a path search based on the initial state value and the target state value until the first state value becomes the target state value.
9. A computer device, characterized in that: The computer device comprises: one or more processors, a memory, and one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the processor to implement the path search method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in the path search method according to any one of claims 1 to 7.