Resource cleaning method and device, equipment and storage medium
By receiving resource cleaning instructions in the cloud computing environment and finding target resources for cleaning, the problems of low resource cleaning efficiency and the risk of accidentally deleting data is solved, and efficient and accurate resource cleaning is achieved.
Patent Information
- Application Number
- CN202311147716.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-06
- Publication Date
- 2025-03-07
AI Technical Summary
In a cloud computing environment, resource cleaning efficiency is low, which can easily lead to resource waste and inaccurate test results, and the risk of mistaken data deletion in the existing technology is high.
By receiving the resource cleaning instructions sent by the client device, we judge whether there is a user ID in the resource configuration file, and search for the target resource based on the ID to clean it.
Improve the efficiency and accuracy of resource cleaning, reduce labor costs, and reduce the risk of accidentally deleting data.
Smart Images

Figure CN119576508A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data management technology, and in particular to a resource cleaning method, device, equipment and storage medium. Background Art
[0002] In a cloud computing environment, creating and destroying virtual machines is a common operation. Each time a virtual machine is created, some computing, storage, network and other resources need to be allocated. If these resources are not cleaned up in time, a large amount of hardware resources may be wasted, resulting in reduced cloud computing efficiency or instability. In addition, it may be necessary to simulate various scenarios and environments during cloud computing testing. Sometimes there will be large-scale batch concurrent scenarios, which will generate a large number of virtual machines, snapshots, images, disks, networks, cache files, temporary files, etc. If they are not cleaned up in time, the test results will be inaccurate.
[0003] In the related art, resource cleaning requires a lot of time and manpower costs, has low efficiency, may accidentally delete data, and has poor accuracy. Summary of the invention
[0004] In order to solve the above technical problems, the present disclosure provides a resource cleaning method, device, equipment and storage medium.
[0005] A first aspect of the present disclosure provides a resource cleaning method, comprising:
[0006] Receiving a resource cleanup instruction sent by a client device, where the resource cleanup instruction at least includes a user identifier requesting resource cleanup and resource attribute information of a target resource requested to be cleaned up;
[0007] Determine whether the user ID exists in the resource configuration file;
[0008] When the user identifier exists in the resource configuration file, the target resource identifier corresponding to the resource attribute information is searched from the resource configuration file;
[0009] Based on the target resource identifier, searching for the target resource corresponding to the target resource identifier;
[0010] Clean up the target resources.
[0011] A second aspect of the present disclosure provides a resource cleaning method, comprising:
[0012] In response to a user selecting a resource cleanup option corresponding to a target resource, generating a resource cleanup instruction, the resource cleanup instruction including at least a user identifier requesting resource cleanup and resource attribute information of the target resource requested to be cleaned;
[0013] A resource cleaning instruction is sent to the server device, so that the server device cleans up the target resource corresponding to the resource cleaning instruction based on the user identifier and resource attribute information in the resource cleaning instruction.
[0014] A third aspect of the present disclosure provides a resource cleaning device, comprising:
[0015] An instruction receiving module, used for receiving a resource cleaning instruction sent by a client device, wherein the resource cleaning instruction at least includes a user identifier requesting resource cleaning and resource attribute information of a target resource requested to be cleaned;
[0016] A judgment module, used to judge whether a user identifier exists in a resource configuration file;
[0017] A first search module is used to search the resource configuration file for a target resource identifier corresponding to the resource attribute information when there is a user identifier in the resource configuration file;
[0018] A second search module is used to search for a target resource corresponding to the target resource identifier based on the target resource identifier;
[0019] The cleanup module is used to clean up the target resources.
[0020] A fourth aspect of the present disclosure provides a resource cleaning device, comprising:
[0021] A generating module, configured to generate a resource cleaning instruction in response to a user's selection operation of a resource cleaning option corresponding to a target resource, wherein the resource cleaning instruction at least includes a user identifier requesting resource cleaning and resource attribute information of a target resource requested to be cleaned;
[0022] The instruction sending module is used to send a resource cleaning instruction to the server device, so that the server device cleans up the target resources corresponding to the resource cleaning instruction based on the user identification and resource attribute information in the resource cleaning instruction.
[0023] A fifth aspect of the present disclosure provides a server-side device, including a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the resource cleaning method of the first aspect can be implemented.
[0024] A sixth aspect of the present disclosure provides a client device, including a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the resource cleaning method of the second aspect can be implemented.
[0025] A seventh aspect of the present disclosure provides a client device, including a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the resource cleaning method of the first aspect or the second aspect can be implemented.
[0026] Compared with the prior art, the technical solution provided by the present invention has the following advantages:
[0027] The present invention receives a resource cleaning instruction sent by a client device, wherein the resource cleaning instruction includes at least a user identifier for requesting resource cleaning and resource attribute information of a target resource requested to be cleaned; determines whether the user identifier exists in a resource configuration file; when the user identifier exists in the resource configuration file, searches the resource configuration file for a target resource identifier corresponding to the resource attribute information; searches for a target resource corresponding to the target resource identifier based on the target resource identifier; and cleans the target resource. According to the resource cleaning instruction of the client device, the target resource can be accurately found and cleaned, thereby improving the efficiency and accuracy of resource cleaning. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0029] 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, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0030] Figure 1 is a flow chart of a resource cleaning method provided by an embodiment of the present disclosure;
[0031] Figure 2 is a flow chart of another resource cleaning method provided by an embodiment of the present disclosure;
[0032] Figure 3 is a flow chart of another resource cleaning method provided by an embodiment of the present disclosure;
[0033] Figure 4 is a structural schematic diagram of a resource cleaning device provided by an embodiment of the present disclosure;
[0034] Figure 5 It is a structural diagram of another resource cleaning device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0035] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0036] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0037] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0038] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0039] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0040] In order to better understand the inventive concept of the embodiments of the present disclosure, the technical solutions of the embodiments of the present disclosure are described below in conjunction with exemplary embodiments.
[0041] Figure 1 is a flow chart of a resource cleaning method provided by an embodiment of the present disclosure. The method can be executed by a server-side device, which can be understood as any device with computing functions and processing capabilities, such as a cloud server, etc. Figure 1 As shown, the resource cleaning method provided in this embodiment includes the following steps:
[0042] Step 110: Receive a resource cleanup instruction sent by a client device, where the resource cleanup instruction at least includes a user identifier requesting resource cleanup and resource attribute information of a target resource requested to be cleaned up.
[0043] In the embodiments of the present disclosure, the client device can be understood as any device with computing functions and processing capabilities, which may include but are not limited to mobile terminals such as smart phones, laptops, tablet computers (PADs), etc., and fixed electronic devices such as digital TVs, desktop computers, etc.
[0044] The client device can communicate with the server device.
[0045] The resource cleanup instruction can be understood as an instruction to clean up resources in the server device, and the resource cleanup instruction at least includes the user identification requesting resource cleanup and the resource attribute information of the target resource requested for cleanup. The user identification can be understood as an identification that can uniquely identify the identity information of the user requesting resource cleanup; the resource attribute information can be understood as an identification that can uniquely identify the target resource.
[0046] In the disclosed embodiment, when it is necessary to clean up resources in the server device, the client device may send a resource cleanup instruction to the server device, and the server device may receive the resource cleanup instruction.
[0047] Step 120: Determine whether there is a user identifier in the resource configuration file.
[0048] In the disclosed embodiment, a resource configuration file is pre-stored in the server device. The resource configuration file can be understood as a file for managing resources in the server device. The resource configuration file includes at least a user identifier with resource cleanup authority and a resource identifier of each resource in the server device. The resource identifier can be understood as an identifier that can uniquely identify the resource identity. For example, the resource configuration file can be a Config file.
[0049] In the embodiment of the present disclosure, after receiving the resource cleanup instruction, the server device may determine whether there is a user identifier in the resource configuration file.
[0050] Step 130: When the user identifier exists in the resource configuration file, the target resource identifier corresponding to the resource attribute information is searched from the resource configuration file.
[0051] In the disclosed embodiment, when a user identifier exists in a resource configuration file, it indicates that the user identifier has resource cleanup authority, and the server device can search the resource configuration file for a target resource identifier corresponding to the resource attribute information according to the resource attribute information in the resource cleanup instruction.
[0052] In some embodiments, the resource attribute information may include at least one of an operating environment identifier, a resource type identifier, and a resource name corresponding to the target resource. The operating environment identifier may be understood as the operating environment identifier of the target resource, and the operating environment may include an online environment, a test environment, etc.; the resource type identifier may be understood as the identifier of the type of the target resource, and the resource type may include a virtual machine, a disk, a snapshot, an image, etc.; the resource name may be understood as the name of the target resource.
[0053] In some embodiments, searching the resource configuration file for the target resource identifier corresponding to the resource attribute information may include steps 1301-1305:
[0054] Step 1301: Search the resource configuration file for a first resource identifier corresponding to the user identifier.
[0055] In the disclosed embodiment, the server device may search the resource configuration file for the first resource identifier corresponding to the user identifier. Each user identifier may correspond to at least one first resource identifier.
[0056] Step 1302: In response to finding the first resource identifier corresponding to the user identifier, find the second resource identifier corresponding to the operating environment identifier in the first resource identifier.
[0057] In the disclosed embodiment, in response to finding the first resource identifier corresponding to the user identifier, the server device can search the first resource identifier for the second resource identifier corresponding to the operating environment identifier. Each operating environment identifier can correspond to at least one second resource identifier.
[0058] Step 1303: In response to finding the second resource identifier corresponding to the operating environment identifier, find the third resource identifier corresponding to the resource type identifier in the second resource identifier.
[0059] In the embodiment of the present disclosure, in response to finding the second resource identifier corresponding to the operating environment identifier, the server device can search for a third resource identifier corresponding to the resource type identifier in the second resource identifier. Each resource type identifier can correspond to at least one third resource identifier.
[0060] Step 1304: In response to finding the third resource identifier corresponding to the resource type identifier, search for a fourth resource identifier corresponding to the resource name in the third resource identifier.
[0061] In the embodiment of the present disclosure, in response to finding the third resource identifier corresponding to the resource type identifier, the server device can search the third resource identifier for the fourth resource identifier corresponding to the resource name. Each resource name can correspond to at least one fourth resource identifier.
[0062] Step 1305: determine the fourth resource identifier as the target resource identifier.
[0063] In the embodiment of the present disclosure, the server device may determine the fourth resource identifier as the target resource identifier.
[0064] Step 140: Based on the target resource identifier, search for the target resource corresponding to the target resource identifier.
[0065] In the disclosed embodiment, the server device may search for a target resource corresponding to the target resource identifier based on the target resource identifier.
[0066] In some embodiments, based on the target resource identifier, searching for the target resource corresponding to the target resource identifier may include steps 1401-1402:
[0067] Step 1401: Determine a target interface corresponding to a target resource identifier based on a correspondence between a resource identifier and a resource interface.
[0068] In the disclosed embodiment, the server device pre-stores the correspondence between the resource identifier and the resource interface, and can determine the target interface corresponding to the target resource identifier based on the correspondence between the resource identifier and the resource interface. The resource interface can be understood as an interface that can find resources, and can include a network interface, a hardware interface, etc., wherein the network interface can include nova, cinder, glance, neutron, etc.
[0069] Step 1402: call the target interface to search for the target resource corresponding to the target resource identifier.
[0070] In the disclosed embodiment, the server device may call a target interface to search for a target resource corresponding to a target resource identifier.
[0071] Step 150: Clean up the target resources.
[0072] In the disclosed embodiment, after finding the target resource, the server device may clean up the target resource.
[0073] The disclosed embodiment receives a resource cleanup instruction sent by a client device, wherein the resource cleanup instruction includes at least a user identifier for requesting resource cleanup and resource attribute information of a target resource for requesting cleanup; determines whether the user identifier exists in a resource configuration file; when the user identifier exists in the resource configuration file, searches the resource configuration file for a target resource identifier corresponding to the resource attribute information; searches for a target resource corresponding to the target resource identifier based on the target resource identifier; and cleans up the target resource. According to the resource cleanup instruction of the client device, the target resource can be accurately found and cleaned up, thereby improving the efficiency and accuracy of resource cleanup.
[0074] In some embodiments of the disclosure, after the target resource is cleaned up as described above, the server device may send a first prompt message indicating that the target resource has been cleaned up successfully to the client device.
[0075] In other embodiments of the present disclosure, when there is no user identifier in the above-mentioned resource configuration file, or the target resource identifier corresponding to the resource attribute information is not found in the resource configuration file, or the target resource corresponding to the target resource identifier is not found, the server device can determine that the cleanup of the target resource has failed, and send a second prompt information of the failure to clean up the target resource to the client device, and the second prompt information can include the reason for the failure to clean up the target resource.
[0076] In this way, users can obtain the status of resource cleanup in a timely manner.
[0077] Figure 2 is a flow chart of a resource cleaning method provided by an embodiment of the present disclosure. The method can be executed by a client device. The server device can be understood as any device with computing function and processing capability, such as a mobile terminal such as a smart phone, a laptop computer, a tablet computer (PAD), and a fixed electronic device such as a digital TV, a desktop computer, etc. Figure 2 As shown, the resource cleaning method provided in this embodiment includes the following steps:
[0078] Step 210: In response to the user's selection operation of a resource cleanup option corresponding to a target resource, a resource cleanup instruction is generated, where the resource cleanup instruction at least includes a user identifier requesting resource cleanup and resource attribute information of the target resource requested to be cleaned up.
[0079] In the disclosed embodiment, when a user needs to clean up a target resource in a server device, the user can select a resource cleanup option corresponding to the target resource in a display interface of the client device, for example, by clicking or sliding the resource cleanup option. The client device can generate a resource cleanup instruction in response to the user's selection of the resource cleanup option corresponding to the target resource. The resource cleanup instruction includes at least a user identifier requesting resource cleanup and resource attribute information of the target resource requested to be cleaned up.
[0080] The display form of the resource cleanup option may include an input box, an option box, a list, and the like.
[0081] Step 220: Send a resource cleanup instruction to the server device, so that the server device cleans up the target resource corresponding to the resource cleanup instruction based on the user identifier and resource attribute information in the resource cleanup instruction.
[0082] In the disclosed embodiment, after generating a resource cleanup instruction, the client device may send the resource cleanup instruction to the server device, so that the server device cleans up the target resource corresponding to the resource cleanup instruction based on the user identifier and resource attribute information in the resource cleanup instruction.
[0083] The present invention generates a resource cleaning instruction in response to a user's selection operation of a resource cleaning option corresponding to a target resource, wherein the resource cleaning instruction includes at least a user identifier for requesting resource cleaning and resource attribute information of the target resource requested to be cleaned; the resource cleaning instruction is sent to a server-side device so that the server-side device cleans the target resource corresponding to the resource cleaning instruction based on the user identifier and resource attribute information in the resource cleaning instruction. According to the resource cleaning instruction of the client device, the target resource can be accurately found and cleaned, thereby improving the efficiency and accuracy of resource cleaning.
[0084] In some embodiments of the present disclosure, the resource cleanup options may include at least one of a user identification option, an operating environment identification option corresponding to the target resource, a resource type identification option, and a resource name option.
[0085] In some embodiments of the disclosure, before generating a resource cleaning instruction in response to the user's selection operation of the resource cleaning option corresponding to the target resource, the client device may construct a resource cleaning option in response to the user's resource cleaning option construction operation. For example, the resource cleaning option may be constructed based on Hyper Text Markup Language (HTML) and js (JavaScript) scripting language.
[0086] Figure 3 is a flow chart of a resource cleaning method provided by an embodiment of the present disclosure, and the method can be executed by a client device, such as Figure 3 As shown, the resource cleaning method provided in this embodiment includes the following steps:
[0087] Step 310: In response to the user's selection operation of a resource cleanup option corresponding to a target resource, a resource cleanup instruction is generated, where the resource cleanup instruction at least includes a user identifier requesting resource cleanup and resource attribute information of the target resource requested to be cleaned up.
[0088] Step 320: Send a resource cleanup instruction to the server device, so that the server device cleans up the target resource corresponding to the resource cleanup instruction based on the user identifier and resource attribute information in the resource cleanup instruction.
[0089] Steps 310 - 320 in the embodiment of the present disclosure may refer to the contents of the above-mentioned steps 210 - 220 and will not be repeated here.
[0090] Step 330: Receive the first prompt information and / or the second prompt information sent by the server device, the first prompt information includes information that the target resource cleaning is successful, and the second prompt information includes information that the target resource cleaning fails and the reason for the target resource cleaning failure.
[0091] In the disclosed embodiment, the server device may send a first prompt message and / or a second prompt message to the client device. The first prompt message may include information on successful target resource cleaning, and the second prompt message may include information on target resource cleaning failure and the reason for the target resource cleaning failure. The client device may receive the first prompt message and / or the second prompt message sent by the server device.
[0092] Step 340: Save the first prompt information and / or the second prompt information in the resource cleanup list, and record the saving time.
[0093] In the disclosed embodiment, a resource cleanup list is provided in the client device, which can be used to record the resource cleanup result of the server device. The client device can save the first prompt information and / or the second prompt information in the resource cleanup list, and record the saving time, that is, record the time for which the resource cleanup list saves the first prompt information and / or the second prompt information.
[0094] Step 350: In response to the storage time being equal to the preset storage time, the first prompt information and / or the second prompt information is deleted.
[0095] In an embodiment of the present disclosure, when the time duration for which the first prompt information and / or the second prompt information is saved in the resource cleanup list is equal to a preset saving time duration, the client device may delete the first prompt information and / or the second prompt information in response to the saving time duration being equal to the preset saving time duration.
[0096] Among them, the preset saving period can be set as needed, for example, 7 days, and there is no specific limitation here.
[0097] Therefore, the target resources can be accurately found and cleaned up according to the resource cleaning instructions of the client device, the efficiency and accuracy of resource cleaning can be improved, and the user can obtain the resource cleaning status in time.
[0098] Figure 4 A schematic diagram of the structure of a resource cleaning device provided in an embodiment of the present disclosure, the device can be understood as the above-mentioned server device or some functional modules in the above-mentioned server device. Figure 4 As shown, the resource cleaning device 400 may include:
[0099] The instruction receiving module 410 is used to receive a resource cleaning instruction sent by a client device, where the resource cleaning instruction at least includes a user identifier requesting resource cleaning and resource attribute information of a target resource requested to be cleaned;
[0100] A determination module 420 is used to determine whether a user identifier exists in the resource configuration file;
[0101] A first search module 430 is used to search the resource configuration file for a target resource identifier corresponding to the resource attribute information when there is a user identifier in the resource configuration file;
[0102] A second search module 440 is used to search for a target resource corresponding to the target resource identifier based on the target resource identifier;
[0103] The cleaning module 450 is used to clean up the target resources.
[0104] Optionally, the resource attribute information includes at least one of an operating environment identifier, a resource type identifier, and a resource name corresponding to the target resource;
[0105] The first search module 430 includes:
[0106] A first search submodule, used to search for a first resource identifier corresponding to a user identifier in a resource configuration file;
[0107] A second search submodule is used for searching, in response to finding the first resource identifier corresponding to the user identifier, a second resource identifier corresponding to the operating environment identifier in the first resource identifier;
[0108] A third search submodule is used for searching, in response to finding the second resource identifier corresponding to the operating environment identifier, a third resource identifier corresponding to the resource type identifier in the second resource identifier;
[0109] A fourth search submodule, configured to search for a fourth resource identifier corresponding to a resource name in the third resource identifier in response to finding the third resource identifier corresponding to the resource type identifier;
[0110] The first determining submodule is used to determine the fourth resource identifier as the target resource identifier.
[0111] Optionally, the second search module 440 includes:
[0112] A second determination submodule, configured to determine a target interface corresponding to a target resource identifier based on a correspondence between the resource identifier and the resource interface;
[0113] The calling submodule is used to call the target interface and find the target resource corresponding to the target resource identifier.
[0114] Optionally, the resource cleaning device 400 includes:
[0115] The first sending module is used to send first prompt information indicating that the target resource has been successfully cleaned up to the client device.
[0116] Optionally, the resource cleaning device 400 includes:
[0117] A determination module, used to determine that cleaning up the target resource fails when there is no user identifier in the resource configuration file, or when the target resource identifier corresponding to the resource attribute information is not found in the resource configuration file, or when the target resource corresponding to the target resource identifier is not found;
[0118] The second sending module is used to send second prompt information of target resource cleaning failure to the client device, and the second prompt information includes the reason for the target resource cleaning failure.
[0119] The resource cleaning device provided in the embodiments of the present disclosure can implement the method of any of the above embodiments, and its execution method and beneficial effects are similar, which will not be repeated here.
[0120] Figure 5 A schematic diagram of the structure of a resource cleaning device provided in an embodiment of the present disclosure, the device can be understood as the above-mentioned server device or some functional modules in the above-mentioned server device. Figure 5 As shown, the resource cleaning device 500 may include:
[0121] A generating module 510, configured to generate a resource cleaning instruction in response to a user selecting a resource cleaning option corresponding to a target resource, wherein the resource cleaning instruction includes at least a user identifier requesting resource cleaning and resource attribute information of a target resource requested to be cleaned;
[0122] The instruction sending module 520 is used to send a resource cleaning instruction to the server device, so that the server device cleans up the target resource corresponding to the resource cleaning instruction based on the user identifier and resource attribute information in the resource cleaning instruction.
[0123] Optionally, the resource cleanup options include at least one of a user identification option, an operating environment identification option corresponding to the target resource, a resource type identification option, and a resource name option.
[0124] Optionally, the resource cleaning device 500 includes:
[0125] An information receiving module, used to receive first prompt information and / or second prompt information sent by the server device, the first prompt information including information on successful target resource cleaning, and the second prompt information including information on target resource cleaning failure and the reason for the target resource cleaning failure;
[0126] A saving module, used to save the first prompt information and / or the second prompt information in the resource cleanup list and record the saving time;
[0127] The deleting module is used to delete the first prompt information and / or the second prompt information in response to the storage time being equal to the preset storage time.
[0128] The resource cleaning device provided in the embodiments of the present disclosure can implement the method of any of the above embodiments, and its execution method and beneficial effects are similar, which will not be repeated here.
[0129] The present disclosure also provides a server device, which includes a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the above-mentioned Figure 1 The method of any embodiment has similar execution mode and beneficial effects, which will not be described in detail here.
[0130] The present disclosure also provides a client device, which includes a processor and a memory, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the above-mentioned Figure 2-Figure 3 The method of any embodiment has similar execution mode and beneficial effects, which will not be described in detail here.
[0131] An embodiment of the present disclosure provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the method of any of the above embodiments can be implemented. The execution method and beneficial effects are similar and will not be repeated here.
[0132] The above-mentioned computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0133] The computer program may be written in any combination of one or more programming languages to write program codes for performing the operations of the disclosed embodiments, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer device, partially on the user's device, as a separate software package, partially on the user's computer device and partially on a remote computer device, or entirely on a remote computer device or server.
[0134] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0135] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0136] The above description is only a specific embodiment of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A resource cleaning method, characterized in that: include: Receiving a resource cleanup instruction sent by a client device, wherein the resource cleanup instruction includes at least a user identifier requesting resource cleanup and resource attribute information of a target resource requested to be cleaned up; Determine whether the user identifier exists in the resource configuration file; When the user identifier exists in the resource configuration file, searching the resource configuration file for a target resource identifier corresponding to the resource attribute information; Based on the target resource identifier, searching for the target resource corresponding to the target resource identifier; Clean up the target resource.
2. The method according to claim 1, characterized in that The resource attribute information includes at least one of an operating environment identifier, a resource type identifier, and a resource name corresponding to the target resource; The step of searching the resource configuration file for a target resource identifier corresponding to the resource attribute information includes: In the resource configuration file, searching for a first resource identifier corresponding to the user identifier; In response to finding the first resource identifier corresponding to the user identifier, searching the first resource identifier for a second resource identifier corresponding to the operating environment identifier; In response to finding the second resource identifier corresponding to the operating environment identifier, searching the second resource identifier for a third resource identifier corresponding to the resource type identifier; In response to finding the third resource identifier corresponding to the resource type identifier, searching the third resource identifier for a fourth resource identifier corresponding to the resource name; The fourth resource identifier is determined as the target resource identifier.
3. The method according to claim 1, characterized in that The searching, based on the target resource identifier, for a target resource corresponding to the target resource identifier includes: Based on the correspondence between the resource identifier and the resource interface, determining the target interface corresponding to the target resource identifier; The target interface is called to search for the target resource corresponding to the target resource identifier.
4. The method according to claim 1, characterized in that: After the target resource is cleaned up, the method further includes: A first prompt message indicating that the target resource has been successfully cleaned up is sent to the client device.
5. The method according to claim 1, characterized in that: Also includes: When the user identifier does not exist in the resource configuration file, or the target resource identifier corresponding to the resource attribute information is not found in the resource configuration file, or the target resource corresponding to the target resource identifier is not found, it is determined that the cleaning of the target resource has failed; Sending second prompt information indicating that the target resource cleaning fails to the client device, wherein the second prompt information includes a reason for the target resource cleaning failure.
6. A resource cleaning method, characterized in that: include: In response to a user selecting a resource cleanup option corresponding to a target resource, generating a resource cleanup instruction, the resource cleanup instruction including at least a user identifier requesting resource cleanup and resource attribute information of the target resource requested to be cleaned; The resource cleaning instruction is sent to a server device, so that the server device cleans up the target resource corresponding to the resource cleaning instruction based on the user identifier and resource attribute information in the resource cleaning instruction.
7. The method according to claim 6, characterized in that The resource cleanup options include at least one of a user identification option, an operating environment identification option corresponding to the target resource, a resource type identification option, and a resource name option.
8. The method according to claim 6, characterized in that After sending the resource cleanup instruction to the server device, the method further includes: Receiving first prompt information and / or second prompt information sent by the server device, wherein the first prompt information includes information that the target resource is successfully cleaned up, and the second prompt information includes information that the target resource is failed to be cleaned up and the reason for the failure to clean up the target resource; Saving the first prompt information and / or the second prompt information in a resource cleanup list, and recording the saving time; In response to the storage time being equal to the preset storage time, the first prompt information and / or the second prompt information is deleted.
9. A resource cleaning device, characterized in that: include: An instruction receiving module, used to receive a resource cleanup instruction sent by a client device, wherein the resource cleanup instruction at least includes a user identifier requesting resource cleanup and resource attribute information of a target resource requested to be cleaned; A judgment module, used for judging whether the user identifier exists in the resource configuration file; A first search module, configured to search the resource configuration file for a target resource identifier corresponding to the resource attribute information when the user identifier exists in the resource configuration file; A second search module, used to search for a target resource corresponding to the target resource identifier based on the target resource identifier; A cleaning module is used to clean up the target resource.
10. A resource cleaning device, characterized in that: include: A generating module, configured to generate a resource cleaning instruction in response to a user's selection operation of a resource cleaning option corresponding to a target resource, wherein the resource cleaning instruction at least includes a user identifier requesting resource cleaning and resource attribute information of a target resource requested to be cleaned; The instruction sending module is used to send the resource cleaning instruction to the server device, so that the server device cleans up the target resources corresponding to the resource cleaning instruction based on the user identifier and resource attribute information in the resource cleaning instruction.
11. A server device, characterized in that: include: A memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the resource cleaning method according to any one of claims 1 to 5 is implemented.
12. A client device, characterized in that: include: A memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the resource cleaning method as described in any one of claims 6 to 8 is implemented.
13. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by the processor, the resource cleaning method according to any one of claims 1 to 8 is implemented.