Method and device for acquiring command execution result, computer equipment and storage medium

By caching the historical execution results of commands and directly obtaining them from the cache when needed, the problem of wasted resources and inefficiency of computers when processing low-frequency update commands is solved, and more efficient command execution is achieved.

CN119597350APending Publication Date: 2025-03-11SANGFOR TECH INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411419846.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-11
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

When a computer processes low-frequency update commands, it will meaninglessly execute a large number of commands, resulting in waste of resources and reduced execution efficiency.

Method used

By cache the historical execution results of the command into the target cache file, the historical execution results are directly obtained from the target cache file as the result of this execution before executing the target execution command to be executed.

Benefits of technology

It reduces the number of command execution times, reduces the occupation of computer resources, improves the efficiency of command execution, and reduces the workload of business personnel.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119597350A_ABST
    Figure CN119597350A_ABST
Patent Text Reader

Abstract

The invention discloses a command execution result obtaining method and device, computer equipment and a storage medium, and the command execution result obtaining method comprises the steps: responding to a to-be-executed target execution command, and determining a target cache file corresponding to the target execution command; and obtaining a historical execution result corresponding to the target execution command from the target cache file, and taking the historical execution result as an execution result of executing the target execution command this time. According to the method, the historical execution result of the execution command is cached in the cache file, before the to-be-executed target execution command is executed, the target execution command does not need to be executed, and the historical execution result corresponding to the target execution command can be obtained only by determining the target cache file corresponding to the target execution command; therefore, the number of times of execution of the target execution command is reduced, resource occupation of the computer equipment is reduced, and the execution efficiency of the execution command is improved.
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 more specifically, to a method, apparatus, computer device and storage medium for obtaining command execution results. Background Art

[0002] In the related art, after obtaining the command to be executed, the computer device usually directly executes the original command to obtain the execution result. However, for commands with low-frequency update results, since the execution results of these commands usually do not change, the computer will meaninglessly execute a large number of commands, thereby wasting resources in the computer. Summary of the invention

[0003] In view of the above problems, the present application proposes a method, apparatus, computer device and storage medium for obtaining command execution results.

[0004] In a first aspect, an embodiment of the present application provides a method for obtaining command execution results, the method comprising: in response to a target execution command to be executed, determining a target cache file corresponding to the target execution command; obtaining the historical execution results corresponding to the target execution command from the target cache file as the execution results of this execution of the target execution command.

[0005] In the second aspect, an embodiment of the present application provides a device for obtaining command execution results, the device comprising: a target cache file determination module, used to determine the target cache file corresponding to the target execution command in response to the target execution command to be executed; an execution result acquisition module, used to obtain the historical execution results corresponding to the target execution command from the target cache file as the execution result of the current execution of the target execution command.

[0006] In a third aspect, an embodiment of the present application provides a computer device, comprising: one or more processors; a memory; one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the method for obtaining command execution results provided in the first aspect above.

[0007] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a program code is stored. The program code can be called by a processor to execute the method for obtaining the command execution result provided in the first aspect above.

[0008] The solution provided by the present application caches the historical execution results of the execution command in a cache file. Before executing the target execution command to be executed, there is no need to execute the target execution command. It is only necessary to determine the target cache file corresponding to the target execution command to obtain the historical execution results corresponding to the target execution command as the execution result of the current execution command, so as to reduce the number of executions of the target execution command, reduce the resource usage of the computer device, and improve the execution efficiency of the execution command. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0010] Figure 1 A flowchart of a method for obtaining command execution results provided in an embodiment of the present application is shown.

[0011] Figure 2 A flowchart of a method for obtaining command execution results provided in another embodiment of the present application is shown.

[0012] Figure 3 A schematic diagram of a storage structure in an embodiment of the present application is shown.

[0013] Figure 4 A schematic diagram of updating command execution results in the method for obtaining command execution results provided in an embodiment of the present application is shown.

[0014] Figure 5 A hardware schematic diagram of a method for obtaining command execution results in an embodiment of the present application is shown.

[0015] Figure 6 A flowchart of a method for obtaining command execution results provided in yet another embodiment of the present application is shown.

[0016] Figure 7 A flowchart of a method for obtaining command execution results provided in yet another embodiment of the present application is shown.

[0017] Figure 8 The comparison result between the storage usage rate corresponding to the method for obtaining the command execution result provided in the embodiment of the present application and the storage usage rate of the command execution result in the related art is shown.

[0018] Fig. 9 A structural block diagram of a command execution result acquisition device provided in an embodiment of the present application is shown.

[0019] Fig.10 A structural block diagram of a computer device provided in an embodiment of the present application for executing a method for obtaining a command execution result according to an embodiment of the present application is shown.

[0020] Fig.11 A storage medium provided in an embodiment of the present application for storing or carrying program code for implementing a method for obtaining command execution results according to an embodiment of the present application is shown. DETAILED DESCRIPTION

[0021] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.

[0022] In the related art, the execution frequency of commands is reduced as much as possible from the business layer by finding out the businesses with high execution frequency and large impact. However, the business will be updated continuously. If the business with high execution frequency and large impact is searched every time the business is updated, the workload of the business personnel will be increased, making this method less universal. In addition, the input / output read / write rate (IOPS) of the software or hardware will be reduced.

[0023] Moreover, when executing commands, these commands will communicate directly with the hardware or software and issue non-native command queue (Non-Native Command Queuing, Non-NCQ) instructions, which not only increases the load on the hardware or software, but may also cause the native command queue (Native Command Queuing, NCQ) instructions to be reordered, which in turn seriously affects the input / output (IO).

[0024] In view of the problems in the background technology, the inventors have proposed a method, device, computer equipment and storage medium for obtaining command execution results provided by the embodiments of the present application. The historical execution results of the execution command are cached in a cache file. Before executing the target execution command to be executed, there is no need to execute the target execution command. It is only necessary to determine the target cache file corresponding to the target execution command to obtain the historical execution result corresponding to the target execution command as the execution result of this execution command, so as to reduce the number of executions of the target execution command, reduce the resource occupation of the computer equipment, and improve the execution efficiency of the execution command. At the same time, there is no need to search for the execution command, and there is no need to increase the workload of business personnel, thereby improving the versatility of obtaining the execution results.

[0025] The following will describe in detail the command execution result acquisition method, apparatus, computer equipment and storage medium provided in the embodiments of the present application in conjunction with the accompanying drawings.

[0026] See also Figure 1 , Figure 1 The flowchart of the method for obtaining the command execution result provided in the embodiment of the present application is shown. The method for obtaining the command execution result can be applied to Fig. 9 The command execution result acquisition device 300 and the computer device 100 ( Fig.10 ).

[0027] The method for obtaining the command execution result may specifically include the following steps:

[0028] Step S110: In response to a target execution command to be executed, determining a target cache file corresponding to the target execution command.

[0029] Among them, execution commands refer to commands that are input, generated or read in a computer, operating system, software application or command line interface in a specific format or syntax, and then let the computer or system execute these commands to complete the task or operation. Execution commands include but are not limited to hardware commands, software commands and other commands. The target execution command to be executed refers to the execution command that has been determined but not executed by the computer or system.

[0030] The target cache file refers to a file storing information related to the target execution command. For example, the target cache file includes but is not limited to the execution software information, execution hardware information, and execution result corresponding to the target execution command.

[0031] In an embodiment of the present application, in response to a target execution command to be executed, the target cache file is determined by first establishing a mapping relationship between the target execution command and the target cache file, so that the target cache file corresponding to the target execution command can be determined according to the mapping relationship. A mapping relationship can also be established between the target execution command and the storage path of the target cache file. After the target execution command is determined, the storage path corresponding to the target execution command can be determined according to the mapping relationship, and then the target cache file is determined according to the storage path. The method of determining the target cache file according to the target execution command to be executed can be set according to the actual situation, and is not specifically limited here.

[0032] Step S120: Obtain the historical execution result corresponding to the target execution command from the target cache file as the execution result of the current execution of the target execution command.

[0033] The historical execution result may be the execution result obtained after the target execution command was executed last time. It may also be the execution result obtained after the target execution command is executed after the execution event corresponding to the target execution command changes. It may also be the execution result obtained after the target execution command is executed at a preset frequency. It should be noted that the target cache file may include all the historical execution results of the target execution command, or may only include the latest historical execution results. The number of historical execution results in the cache file is not specifically limited here.

[0034] In an embodiment of the present application, obtaining the historical execution results of the target execution command from the target cache file is to obtain the latest historical execution results, and use the historical execution results as the execution results of the current execution of the target execution command, without the need to execute the target execution command again.

[0035] The solution provided in this embodiment caches the historical execution results of the execution command in a cache file. Before executing the target execution command to be executed, there is no need to execute the target execution command. It is only necessary to determine the target cache file corresponding to the target execution command to obtain the historical execution results corresponding to the target execution command as the execution result of this execution command, so as to reduce the number of executions of the target execution command, reduce the resource usage of the computer device, and improve the execution efficiency of the execution command. At the same time, there is no need to search for the execution command, so there is no need to increase the workload of business personnel, and the versatility of execution result acquisition is improved.

[0036] See also Figure 2 , Figure 2 A flowchart of a method for obtaining command execution results provided in another embodiment of the present application is shown.

[0037] Step S210: In response to the acquired target service, the target execution command carried by the target service is acquired.

[0038] The acquisition of the target service may be in response to the user's selection and determination operation in a human-computer interaction device, thereby acquiring the target service. The human-computer interaction device includes but is not limited to a terminal device, a computer device, and other devices with interactive functions. The selection and determination operation includes but is not limited to a click-to-determine operation, a drag-to-determine operation, and an input operation, and the human-computer interaction device and the selection and determination operation are not specifically limited herein.

[0039] Further, the method for obtaining the target execution command carried by the target service may be to parse the target service according to a preset parsing method to obtain the target execution command carried by the target service. Alternatively, a keyword in the target service may be obtained, and the target execution command corresponding to the target service may be determined according to the keyword. The specific method for obtaining the target execution command carried by the target service is not limited herein.

[0040] For example, the target execution command is determined based on the keywords in the target business. The target business is to query the disk status of the disk id 1, and the keywords in the target business are query, id 1, and disk status. Based on the keywords, the target execution command is determined to be search scsi_id=1.

[0041] Step S220: Determine a target query command corresponding to the target execution command according to the target execution command.

[0042] Among them, the target query command can be a target query command that is determined according to the target cache file after determining the target cache file corresponding to the target execution command according to the target execution command. It can also be a soft link command of the target execution command to point to the target cache file corresponding to the target execution command. A soft link is also called a symbolic link, which is actually a file that contains the path name of another file. A soft link can point to any file or directory, and can even link files in different file systems. In other words, when the target query command is a soft link to the target execution command, the target query command includes the path name of the target cache file to query the execution result corresponding to the target execution command.

[0043] For example, the target execution command test is renamed to test.orig, and a soft link test is created as the target query instruction corresponding to the target execution command to replace the test command.

[0044] In some embodiments, determining a target query command corresponding to the target execution command based on the target execution command includes: replacing the original name of the target execution command with the target name, and establishing a target query command corresponding to the target execution command, wherein the name of the target query command is the original name.

[0045] In the implementation manner of the present application, in order to ensure that when a user accesses the target service, the target service carries the execution target execution command.

[0046] Step S230: Execute the target query command and determine the target cache file corresponding to the target execution command from the cached files.

[0047] In the embodiment of the present application, since the target query command includes the path name of the target cache file, when the target query command is executed, the target cache file corresponding to the target execution command can be determined from the cached files.

[0048] In some embodiments, the caching of cached files is implemented through a plug-in mode. The plug-in mode includes but is not limited to storage methods such as file storage backend and distributed key-value pair (etcd) storage backend. The file storage backend refers to a storage backend based on the file system, which is also the default storage backend. It uses a file directory as the storage directory, and the cache of each different command uses a separate file storage and is named in a specific naming format. The distributed key-value pair storage backend refers to a storage backend based on distributed key-value pairs, which is designed to reliably store and retrieve data and provide high availability and consistency guarantees.

[0049] See also Figure 3 , Figure 3 A schematic diagram of the storage structure in the implementation mode of the present application is shown. The storage location corresponding to each cache file is determined according to the resource identifier corresponding to the cache file, and then the storage location corresponding to the resource identifier is determined according to the resource type to which the resource identifier belongs. Finally, the root directory manages all resource types to achieve caching of cache files.

[0050] Step S240: Obtain the historical execution result corresponding to the target execution command from the target cache file as the execution result of the current execution of the target execution command.

[0051] For the detailed description of step S240, please refer to step S120 in the aforementioned embodiment, which will not be repeated here.

[0052] Step S250: in response to the monitored change of the target event corresponding to the target execution command, the historical execution result in the target cache file is updated.

[0053] In the embodiment of the present application, in order to ensure the timeliness and accuracy of the historical execution results, the target events corresponding to each execution command are monitored, and when the target event changes, the historical results are updated according to the change of the target event. Alternatively, when the target event changes, the target execution command is executed in time to obtain the latest historical execution results after the target event changes.

[0054] For example, when the sda ​​device is plugged in or out, the relevant changes of the target event will be sent out immediately. If the sda ​​device is unplugged, the storage path related to the sda ​​device will be deleted, and the cache data and files related to the sda ​​device will be cleared. If the sda ​​device is plugged in, the storage path related to the sda ​​device will be updated, and the relevant cache data and files will be updated.

[0055] In some implementations, the historical execution results in the target cache file may also be updated by using a polling mechanism to detect whether the target event has changed. When a change in the target event is detected, the data and file of the target event are updated in a timely manner.

[0056] For example, at 10 o'clock, the status of the disk array raid card 0 is ok, and at 10:01, the status of the raid card 0 is bad, indicating that the status of the raid card 0 has changed, so the relevant data and files corresponding to the raid card 0 need to be updated.

[0057] In other implementations, the cache validity period of the execution result corresponding to the target event can also be monitored in real time. When the execution result has been cached and expired, the target execution command will be executed to update the execution result. It should be noted that the cache validity period is greater than the execution frequency of the target execution command, so as to achieve an update frequency that is lower than the execution frequency and improve the number of executions of the target execution command.

[0058] Exemplarily, the cache validity period of the execution result of target event 1 is 10 days. When the cache validity period is reached, the target execution command is executed to update the execution result corresponding to target event 1.

[0059] See also Figure 4 , Figure 4 The update schematic diagram of the command execution result in the acquisition method of the command execution result provided by the embodiment of the present application is shown. Multiple events are monitored jointly by an event listener, a poller, and a cache expiration scanner. When there is an event that meets the corresponding conditions, a cache to be updated is allocated for each event to be updated, and added to the task queue, so as to realize the update of the cache file corresponding to the event to be updated through the cache refresh thread, and then update the execution result of the target execution command. It is mainly necessary to minimize the impact on the entire system in the embodiment of the present application, and update the cache serially by deduplication task queue and a single task (worker), so as to ensure that only one command is in operation at the same time. Multiple tasks can also be configured as needed to speed up the update process of the cache.

[0060] During the specific implementation process, the historical execution results are cached in a cache file through a cache tool (cached-tool), and cached using a multi-level cache method of a cache store (cache store), and refreshed in combination with a cache refresher (cacherefresher), so that when a target business is generated, the execution result obtained by the target execution command corresponding to the target business is the latest execution result, so as to ensure the timeliness of the execution result acquisition.

[0061] See also Figure 5 , Figure 5The hardware schematic diagram of the method for obtaining the command execution result in the embodiment of the present application is shown. Figure 5 In the process, the cache tool is first used to create a query command based on the execution command, and a corresponding relationship between the query command and the cache warehouse is established. In addition, the cache warehouse will update the historical execution results according to the cache refresher. When the execution command corresponding to the business required by the user is obtained, the corresponding historical execution result in the cache warehouse will be directly obtained through the query command as the execution result of this time, so as to reduce the execution of the execution command and improve the efficiency of obtaining the execution result.

[0062] The solution provided in this embodiment establishes a corresponding target query command according to the target execution command, and obtains the target cache file corresponding to the target execution command according to the target query command, and then obtains the historical execution result in the target cache file as the execution result of the target execution command executed by this vehicle, and replaces the execution action with the query action. There is no need to execute the target execution command, thereby reducing the number of executions of the target execution command, and also reducing the load on software or hardware. At the same time, it is transparent to the business and does not require any modification to the business. There is no need to worry about negative impact on the function, and there is no need to worry about business developers repeatedly introducing the same problem.

[0063] See also Figure 6 , Figure 6 A flowchart of a method for obtaining command execution results provided in yet another embodiment of the present application is shown.

[0064] Step S310: In response to the acquired target service, the target execution command carried by the target service is acquired.

[0065] Step S320: Determine a target query command corresponding to the target execution command according to the target execution command.

[0066] For detailed description of steps S310 to S320, please refer to steps S210 to S220 in the aforementioned embodiment, which will not be repeated here.

[0067] Step S330: Obtain the command type corresponding to the target query command.

[0068] The command type includes but is not limited to a cacheable type and a non-cacheable type. The command type may be determined based on the parameters of the target query command, or based on the specific command form of the target query command, or based on the configuration information corresponding to the target query command. The method for determining the command type is not specifically limited herein.

[0069] Furthermore, the configuration information includes but is not limited to cache options, event identifiers, cache validity periods, and associated event types, etc. The cache options include short options that do not need to be cached and long options that do not need to be cached. When the configuration information is a short option that does not need to be cached, it means that the command type is a cacheable type. When the configuration information is a long option that does not need to be cached, it means that the command type is a non-cacheable type.

[0070] For example, the command type is determined according to the configuration information. When the target query command is test, the corresponding configuration information is the short option dont_cache_short=1 that does not require caching, the long option dont_cache_long=0 that does not require caching, the cache validity period cache_time=1min, the event identifier id_getter=1, and the event type is disk, which means that the command type corresponding to the target query command is a cacheable type.

[0071] Step S340: If the command type is a cacheable type, the target query command is executed to determine the target cache file corresponding to the target execution command from the cached files.

[0072] In an embodiment of the present application, when the command type is a cacheable type, the historical execution results corresponding to the target execution command have been cached in the target cache file. At this time, after executing the target query command, the target cache file corresponding to the target execution command will be directly determined from the cached file, and there is no need to execute the target execution command to obtain the execution result corresponding to the target execution command.

[0073] In some implementations, when the command type is a non-cacheable type, the historical execution result corresponding to the target execution command cannot be cached. At this time, the target execution command is executed to obtain the execution result corresponding to the target execution command as the execution result after executing the target execution command this time.

[0074] Step S350: Obtain the historical execution result corresponding to the target execution command from the target cache file as the execution result of the current execution of the target execution command.

[0075] For the detailed description of step S350, please refer to step S120 in the aforementioned embodiment, which will not be repeated here.

[0076] The solution provided in this embodiment determines whether the historical execution results of the execution command are stored according to the command type of the execution command, thereby determining whether the execution command needs to be executed. There is no need for business personnel to manually screen commands or businesses, thereby improving the efficiency of obtaining execution results.

[0077] See also Figure 7 , Figure 7 A flowchart of a method for obtaining command execution results provided in yet another embodiment of the present application is shown.

[0078] Step S410: According to the target execution command, a target cache path corresponding to the target execution command is obtained.

[0079] Among them, the cache path refers to the path used to cache data or files. In the embodiment of the present application, the target cache path refers to the path of the target cache file corresponding to the cache target execution command.

[0080] In an embodiment of the present application, the method for obtaining the target cache path according to the target execution command may be that the creation and acquisition methods of the cache paths of data and files in different operating systems or application software are different, and the creation and acquisition methods of the target cache path are not specifically limited here.

[0081] In some implementations, obtaining a target cache path corresponding to the target execution command according to the target execution command includes: obtaining a target hash value corresponding to the target execution command according to the target execution command, and determining the target cache path according to the target hash value.

[0082] Among them, hashing is also called pre-mapping, which can transform an input of any length into an output of fixed length through a hash algorithm. In an embodiment of the present application, the target execution command is hashed so that the target execution command after hashing is a hash value of a fixed length. When the same target execution command is input, the same hash value will be generated, and the target cache path of the target execution command can be determined based on the hash value.

[0083] For example, the target execution command is scsi_id, and the cache is enabled for the execution result of the target execution command. Then, when the target execution command carried by the target service is / lib / udev / scsi_id--replace-whitespace--whitelisted / dev / sda, the hardware type associated with the command is obtained according to the configuration file of the target execution command, and the hard disk identifier obtained from the command is sda, and the hash value of the parameter "--replace-whitespace--whitelisted / dev / sda" is calculated to be 16b2c576be38c5f0fb329bd7e3ca571d. The final cache file path is / var / lib / cache / disk / sda / scsi_id+16b2c576be38c5f0fb329bd7e3ca571d; and the cache file exists. By reading the cache file, the command result is finally obtained as 336c92bf000a17aa3, which can be output.

[0084] Step S420: Acquire the target cache file according to the target cache path.

[0085] In the embodiment of the present application, the target cache file corresponding to the target execution command can be determined according to the target cache path, and then the target cache file corresponding to the target execution command can be obtained.

[0086] Step S430: Obtain the historical execution result corresponding to the target execution command from the target cache file as the execution result of the current execution of the target execution command.

[0087] For the detailed description of step S430, please refer to step S120 in the aforementioned embodiment, which will not be repeated here.

[0088] The solution provided in this embodiment determines the target cache path according to the target execution command, and then accurately obtains the target cache file in the target cache path, thereby accurately obtaining the historical execution result corresponding to the target execution command as the execution result of this execution command, so as to reduce the number of execution times of the target execution command, so as to reduce the load on software or hardware. At the same time, there is no need to execute the command for search, and thus there is no need to increase the workload of business personnel, thereby improving the versatility of execution result acquisition.

[0089] See also Figure 8 , Figure 8 The figure shows the comparison between the storage usage rate corresponding to the method for obtaining the command execution result provided in the embodiment of the present application and the storage usage rate of the command execution result in the related art. Figure 7It can be seen that for the same business, the space required for caching command execution results in related technologies varies greatly. However, after using the method for obtaining command execution results provided by this application, the space required for caching each command execution result is roughly the same. And under the same business, the cache space required by the friendly business is greater. Therefore, Figure 7 It can be seen that the method for obtaining command execution results provided by the present application saves cache space for command execution results.

[0090] See also Fig. 9 , which shows a structural block diagram of a command execution result acquisition device 300 provided in an embodiment of the present application. The command execution result acquisition device 300 is applied to a computer device 100, and the command execution result acquisition device 300 includes: a target cache file determination module 310, which is used to determine the target cache file corresponding to the target execution command in response to the target execution command to be executed; and an execution result acquisition module 320, which is used to obtain the historical execution result corresponding to the target execution command from the target cache file as the execution result of the current execution of the target execution command.

[0091] In some embodiments of the present application, the target cache file determination module 310 includes: a target execution command acquisition unit, used to obtain the target execution command carried by the target business in response to the acquired target business; a target query command determination unit, used to determine the target query command corresponding to the target execution command based on the target execution command; a target cache file determination unit, used to execute the target query command and determine the target cache file corresponding to the target execution command from the cached file.

[0092] In some embodiments of the present application, the target query command determination unit includes: a target query command establishment subunit, which is used to replace the original name of the target execution command with the target name, and establish a target query command corresponding to the target execution command, and the name of the target query command is the original name.

[0093] In some embodiments of the present application, the target cache file determination module 310 also includes: a command type acquisition unit, used to obtain the command type corresponding to the target query command; the target cache file determination unit also includes: a target cache file determination sub-unit, used to execute the target query command if the command type is a cacheable type, and determine the target cache file corresponding to the target execution command from the cached file.

[0094] In some embodiments of the present application, the target cache file determination module 310 includes: a target cache path acquisition unit, used to acquire the target cache path corresponding to the target execution command according to the target execution command; a target cache file acquisition unit, used to acquire the target cache file according to the target cache path.

[0095] In some embodiments of the present application, the target cache path acquisition unit includes: a target hash value acquisition subunit, used to acquire a target hash value corresponding to the target execution command according to the target execution command; and a target cache path determination subunit, used to determine the target cache path according to the target hash value.

[0096] In some embodiments of the present application, the command execution result acquisition device 300 also includes: an image evaluation command execution result acquisition module, which is used to update the historical execution results in the target cache file in response to changes in the target event corresponding to the target execution command monitored.

[0097] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.

[0098] In several embodiments provided in the present application, the coupling between modules may be electrical, mechanical or other forms of coupling.

[0099] In addition, each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or software functional modules.

[0100] A structural block diagram of a computer device provided in an embodiment of the present application. Please refer to Fig.10 , which shows a block diagram of a computer device provided in an embodiment of the present application. The computer device 100 may be a computer device such as a computer, a server, etc. that can run an application program. The computer device 100 in the present application may include one or more of the following components: a processor 101, a memory 102, and one or more application programs, wherein the one or more application programs may be stored in the memory 102 and configured to be executed by one or more processors 101, and the one or more programs are configured to execute the method described in the aforementioned method embodiment.

[0101] The processor 101 may include one or more processing cores. The processor 101 uses various interfaces and lines to connect various parts of the entire computer device 100, and executes various functions and processes data of the computer device 100 by running or executing commands, programs, code sets or command sets stored in the memory 102, and calling data stored in the memory 102. Optionally, the processor 101 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 101 can integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing display content; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 101, but may be implemented separately through a communication chip.

[0102] The memory 102 may include a random access memory (RAM) or a read-only memory (ROM). The memory 102 may be used to store commands, programs, codes, code sets or command sets. The memory 102 may include a program storage area and a data storage area, wherein the program storage area may store commands for implementing an operating system, commands for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), commands for implementing the following various method embodiments, etc. The data storage area may also store data (such as a phone book, audio and video data, chat record data) created by the computer device 100 during use.

[0103] Please refer to Fig.11 , which shows a structural block diagram of a computer-readable storage medium provided in an embodiment of the present application. The computer-readable storage medium 200 stores program codes, which can be called by a processor to execute the method described in the above method embodiment.

[0104] The computer-readable storage medium 200 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer-readable storage medium 200 includes a non-transitory computer-readable storage medium. The computer-readable storage medium 200 has storage space for program code 210 that performs any method steps of the above method. These program codes can be read from or written to one or more computer program products. The program code 210 can be compressed, for example, in an appropriate form.

[0105] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for obtaining command execution results, characterized in that: The method comprises: In response to a target execution command to be executed, determining a target cache file corresponding to the target execution command; The historical execution result corresponding to the target execution command is obtained from the target cache file as the execution result of the current execution of the target execution command.

2. The method according to claim 1, characterized in that The step of determining, in response to a target execution command to be executed, a target cache file corresponding to the target execution command comprises: In response to the acquired target service, acquiring the target execution command carried by the target service; Determine, according to the target execution command, a target query command corresponding to the target execution command; The target query command is executed to determine the target cache file corresponding to the target execution command from the cached files.

3. The method according to claim 2, characterized in that The step of determining, according to the target execution command, a target query command corresponding to the target execution command comprises: The original name of the target execution command is replaced with the target name, and a target query command corresponding to the target execution command is established, wherein the name of the target query command is the original name.

4. The method according to claim 2, characterized in that: Before executing the target query command and determining the target cache file corresponding to the target execution command from the cached files, the method further includes: Obtaining the command type corresponding to the target query command; The executing the target query command and determining the target cache file corresponding to the target execution command from the cached files includes: If the command type is a cacheable type, the target query command is executed to determine the target cache file corresponding to the target execution command from the cached files.

5. The method according to claim 1, characterized in that The step of determining, in response to a target execution command to be executed, a target cache file corresponding to the target execution command comprises: According to the target execution command, obtaining a target cache path corresponding to the target execution command; According to the target cache path, the target cache file is obtained.

6. The method according to claim 5, characterized in that The acquiring, according to the target execution command, a target cache path corresponding to the target execution command comprises: According to the target execution command, obtaining a target hash value corresponding to the target execution command; The target cache path is determined according to the target hash value.

7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: In response to the monitored change of the target event corresponding to the target execution command, the historical execution result in the target cache file is updated.

8. A device for obtaining command execution results, characterized in that: The device comprises: A target cache file determination module, configured to determine, in response to a target execution command to be executed, a target cache file corresponding to the target execution command; The execution result acquisition module is used to acquire the historical execution result corresponding to the target execution command from the target cache file as the execution result of the current execution of the target execution command.

9. A computer device, characterized in that: The computer device comprises: one or more processors; Memory; One or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program codes, which can be called by a processor to execute the method according to any one of claims 1 to 7.