Resource auditing method and device and related equipment
By utilizing target storage and preset sorting rules in the cloud platform, the resources of the virtual system are transferred to the physical machine system, solving the problem of low resource audit efficiency and achieving efficient resource auditing and data security improvement.
Patent Information
- Application Number
- CN202410995097.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-24
- Publication Date
- 2024-11-26
AI Technical Summary
In cloud platform products, resource auditing efficiency is low, resulting in resource waste and user loss. In the existing technology, the underlying resource information is sent in batches and data alignment operations are performed, which is relatively low.
Through the target storage settings, the resources of the virtual system are transferred to the physical machine system, circumventing batch transmission and data alignment operations, using preset sorting rules to sort the resources of the virtual system and the physical machine system, and auditing the real-time user data of the virtual system , avoid real-time data modification.
It improves the efficiency of resource auditing, reduces the coupling between the upper and lower systems, avoids complaints caused by real-time user data modification, and improves data security and audit accuracy.
Smart Images

Figure CN119025262A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of cloud computing, and in particular to a resource audit method, device and related equipment. Background Art
[0002] Cloud platform products, such as cloud computer products, are a type of digital product that virtualizes physical machines for user use. In the entire product architecture, the upper-level system has a weak perception of the status of the underlying physical machines.
[0003] When the entire system of a cloud platform product is working, if a failure occurs when the upper-level system communicates with the underlying system, it is easy for the upper-level system to have a deviation in its perception of the status of physical machine resources, resulting in waste of resources or loss to users. Therefore, it is necessary to perform resource auditing on the underlying physical machine resources in the upper-level system.
[0004] At present, in the process of resource auditing, the relevant technology will send the underlying resource information to the upper-level system in batches. After the upper-level system receives the underlying resource information, it needs to perform data alignment operations with the underlying system. For each batch of data, the upper-level system and the underlying system also need to confirm that the batch information is correct. The existence of such data alignment operations and batch confirmation operations makes the efficiency of data auditing relatively low. Summary of the invention
[0005] The purpose of the present invention is to provide a resource audit method, device and related equipment to solve the technical problem of low audit efficiency when performing data audit work on cloud platform products in related technologies.
[0006] In a first aspect, an embodiment of the present disclosure provides a resource audit method, which is applied to a physical machine system in a cloud platform, wherein the cloud platform also includes a virtual system corresponding to the physical machine system, and the method includes:
[0007] Obtaining a download address of a first sequence in a target storage, and downloading the first sequence from the target storage according to the download address, wherein the first sequence is a resource sequence obtained by sorting a plurality of resources included in the virtual system according to a preset sorting rule;
[0008] A resource audit is performed on a second sequence based on the first sequence to obtain audit information, wherein the second sequence is a resource sequence obtained by sorting a plurality of resources included in the physical machine system according to the preset sorting rule.
[0009] In a second aspect, an embodiment of the present disclosure provides a resource auditing device, which is applied to a physical machine system in a cloud platform, wherein the cloud platform further includes a virtual system corresponding to the physical machine system, and the device includes:
[0010] A download module, used to obtain a download address of a first sequence in a target storage, and download the first sequence from the target storage according to the download address, wherein the first sequence is a resource sequence obtained by sorting a plurality of resources included in the virtual system according to a preset sorting rule;
[0011] An audit module is used to perform resource audit on a second sequence based on the first sequence to obtain audit information, wherein the second sequence is a resource sequence obtained by sorting multiple resources included in the physical machine system according to the preset sorting rule.
[0012] In a third aspect, the present disclosure provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the method described in the first aspect.
[0013] In a fourth aspect, the present disclosure provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method described in the first aspect are implemented.
[0014] In a fifth aspect, the present disclosure provides a computer program product, comprising computer instructions, which, when executed by a processor, implement the steps of the method described in the first aspect.
[0015] In the present disclosure, the target storage setting is utilized to transfer the resources of the virtual system to the physical machine system, which can avoid the operation of transferring resources in batches, and further avoid the batch confirmation operation and data alignment operation caused by the batch transfer, thereby improving the efficiency of data auditing, and auditing the resources of the physical machine system based on the resources of the virtual system, that is, auditing based on the real-time user data involved in the resources of the virtual system, which can avoid the modification of the real-time user data, and further avoid complaints caused by the modification of the real-time user data. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 It is a flowchart of a resource audit method provided by an embodiment of the present disclosure;
[0017] Figure 2 It is a flowchart of a cloud computer resource audit method provided by an embodiment of the present disclosure;
[0018] Figure 3 It is a structural diagram of a resource auditing device provided by an embodiment of the present disclosure;
[0019] Figure 4 It is a schematic diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0020] The following will be combined with the drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.
[0021] The present disclosure provides a resource audit method, which is applied to a physical machine system in a cloud platform, wherein the cloud platform also includes a virtual system corresponding to the physical machine system, such as Figure 1 As shown, the method includes:
[0022] Step 101: Obtain a download address of a first sequence in a target storage, and download the first sequence from the target storage according to the download address.
[0023] In this application, the cloud platform should be understood as a platform corresponding to any cloud product, such as: cloud computer platform, cloud server platform, cloud storage platform, etc.
[0024] The virtual system of the physical machine system should be understood as a virtual system formed by virtualizing the physical machine system.
[0025] The first sequence is a resource sequence obtained by sorting a plurality of resources included in the virtual system according to a preset sorting rule.
[0026] Exemplarily, the multiple resources included in the virtual system may be all the resources included in the virtual system, or may be multiple resources within the target audit scope among all the resources included in the virtual system. The content indicated by the target audit scope may be set according to actual needs, for example, indicating a set geographical area or a set user (such as a high-value user) based on the target audit scope.
[0027] In an example, the target storage may be a third-party storage platform implemented based on object storage technology.
[0028] In some implementations, the download address can be transmitted based on a message queue, that is, the physical machine system subscribes to the message queue, and after the virtual system obtains the download address and sends the download address to the message queue, the message queue pushes the download address to the physical machine system.
[0029] It should be understood that compared with the method of transmitting resources through message queues, the method of transmitting the download address corresponding to the resource through message queues is more lightweight, which can not only reduce the transmission interference caused by network fluctuations, but also adapt to the application of growing resources.
[0030] Step 102: Perform resource audit on the second sequence based on the first sequence to obtain audit information.
[0031] The second sequence is a resource sequence obtained by sorting a plurality of resources included in the physical machine system according to the preset sorting rule.
[0032] In the present disclosure, the target storage setting is utilized to transfer the resources of the virtual system to the physical machine system, which can avoid the operation of transferring resources in batches, and further avoid the batch confirmation operation and data alignment operation caused by the batch transfer, thereby improving the efficiency of data auditing, and auditing the resources of the physical machine system based on the resources of the virtual system, that is, auditing based on the real-time user data involved in the resources of the virtual system, which can avoid the modification of the real-time user data, and further avoid complaints caused by the modification of the real-time user data.
[0033] In one embodiment, performing resource audit on the second sequence based on the first sequence to obtain audit information includes:
[0034] According to a preset resource segmentation parameter, the first sequence and the second sequence are segmented respectively to obtain a plurality of first subsequences and a plurality of second subsequences arranged in order, wherein the first sequence includes the plurality of first subsequences, the second sequence includes the plurality of second subsequences, the number of resources included in the first subsequence is less than or equal to the number of resources indicated by the resource segmentation parameter, and the number of resources included in the second subsequence is less than or equal to the number of resources indicated by the resource segmentation parameter;
[0035] The multiple first subsequences and the multiple second subsequences are iterated to obtain audit information.
[0036] For example, if the resource segmentation parameter is set to 1000, the first sequence is A, and the second sequence is B, then after the first sequence and the second sequence are segmented respectively, the first subsequences arranged in order can be represented as {A1, A2, ..., A n}, the ordered multiple second subsequences can be represented as {B1, B2, ..., B m}, where A={A1,A2,...,A n}, B={B1, B2, ..., B m}, n and m are positive integers, A1, A2, ..., A n-1 The number of resources included in any first subsequence is 1000, A n The number of resources included is less than or equal to 1000; B1, B2, ..., Bm-1 The number of resources included in any second subsequence is 1000, B m The number of included resources is less than or equal to 1000;
[0037] If the preset sorting rule is a rule for sorting according to the resource number of the resource, then A n-1 The resource number of any resource in is greater than A n The largest resource number among all the included resources, or, A n-1 The resource number of any resource in is less than A n The lowest resource number among all included resources;
[0038] Similarly, B m-1 The resource number of any resource in is greater than B m The largest resource number among all the included resources, or, B m-1 The resource number of any resource in is less than B m The lowest resource number among all included resources.
[0039] It should be understood that the specific values of the above resource segmentation parameters can be selected according to actual needs, and this application does not limit the specific values of the resource segmentation parameters.
[0040] In one embodiment, the sth traversal in the iterative traversal includes:
[0041] Obtain a first target resource according to the first pointer number of the s-th traversal, and obtain a second target resource according to the second pointer number of the s-th traversal, wherein the first target resource is the k-th resource of the i-th first subsequence, the second target resource is the p-th resource of the j-th second subsequence, and s, i, j, k, and p are all positive integers;
[0042] Perform resource comparison on the first target resource and the second target resource to obtain a comparison result of the sth traversal;
[0043] According to the comparison result of the s-th traversal, the first pointer number of the s-th traversal and the second pointer number of the s-th traversal are updated to obtain the first pointer number of the s+1-th traversal and the second pointer number of the s+1-th traversal;
[0044] Among them, when s is equal to 1, the first pointer number of the s-th traversal is used to obtain the first resource of the first first subsequence, and the second pointer number of the s-th traversal is used to obtain the first resource of the first second subsequence.
[0045] In one embodiment, the preset sorting rule is a rule for sorting according to resource numbers of resources;
[0046] When the resource number of the first target resource is the same as the resource number of the second target resource, and the status value of the first target resource is the same as the status value of the second target resource, determining that the comparison result of the s-th traversal is a normal result;
[0047] In the case where the resource number of the first target resource is different from the resource number of the second target resource, and the resource number of the first target resource is between the resource number of the second target resource and the resource number of the third target resource, it is determined that the comparison result of the s-th traversal is a first abnormal result, and the third target resource is the resource number of the previous resource of the second target resource in the second sequence;
[0048] When the resource number of the first target resource is different from the resource number of the second target resource, and the resource number of the second target resource is between the resource number of the first target resource and the resource number of the fourth target resource, it is determined that the comparison result of the s-th traversal is a second abnormal result, and the fourth target resource is a resource preceding the first target resource in the first sequence;
[0049] When the resource number of the first target resource is the same as the resource number of the second target resource, and the state value of the first target resource is different from the state value of the second target resource, determining that the comparison result of the s-th traversal is a third abnormal result;
[0050] The audit information includes the first abnormal result, the second abnormal result and the third abnormal result.
[0051] In one embodiment, when the comparison result of the s-th traversal is the normal result or the third abnormal result, the difference between the first pointer number of the s-th traversal and the first pointer number of the s+1-th traversal is 1, and the difference between the second pointer number of the s-th traversal and the second pointer number of the s+1-th traversal is 1, or, the difference between the first pointer number of the s-th traversal and the first pointer number of the s+1-th traversal is -1, and the difference between the second pointer number of the s-th traversal and the second pointer number of the s+1-th traversal is -1;
[0052] When the comparison result of the s-th traversal is the first abnormal result, the difference between the first pointer number of the s-th traversal and the first pointer number of the s+1-th traversal is 1, and the difference between the second pointer number of the s-th traversal and the second pointer number of the s+1-th traversal is 0, or the difference between the first pointer number of the s-th traversal and the first pointer number of the s+1-th traversal is -1, and the difference between the second pointer number of the s-th traversal and the second pointer number of the s+1-th traversal is 0;
[0053] When the comparison result of the s-th traversal is the second abnormal result, the difference between the first pointer number of the s-th traversal and the first pointer number of the s+1-th traversal is 0, and the difference between the second pointer number of the s-th traversal and the second pointer number of the s+1-th traversal is 1, or, the difference between the first pointer number of the s-th traversal and the first pointer number of the s+1-th traversal is 0, and the difference between the second pointer number of the s-th traversal and the second pointer number of the s+1-th traversal is -1.
[0054] Wherein, if the first pointer number of the s-th traversal is different from the first pointer number of the s+1-th traversal, and the resource obtained by the first pointer number of the s-th traversal is the last resource of the i-th first subsequence, the first pointer number of the s+1-th traversal is used to obtain the first resource of the i+1-th first subsequence;
[0055] In the case where the first pointer number of the s-th traversal is different from the first pointer number of the s+1-th traversal, and the resource obtained by the first pointer number of the s-th traversal is not the last resource of the i-th first subsequence, the first pointer number of the s+1-th traversal is used to obtain the k+1-th resource of the i-th first subsequence;
[0056] In the case where the second pointer number of the s-th traversal is different from the second pointer number of the s+1-th traversal, and the resource obtained by the second pointer number of the s-th traversal is the last resource of the j-th second subsequence, the second pointer number of the s+1-th traversal is used to obtain the first resource of the j+1-th second subsequence;
[0057] When the second pointer number of the s-th traversal is different from the second pointer number of the s+1-th traversal, and the resource obtained by the second pointer number of the s-th traversal is not the last resource of the j-th second subsequence, the second pointer number of the s+1-th traversal is used to obtain the p+1-th resource of the j-th second subsequence;
[0058] In the case where the resource obtained by the first pointer number of the s-th traversal is the last resource of the last first subsequence, and the resource obtained by the second pointer number of the s-th traversal is not the last resource of the last second subsequence, a fourth abnormal result is formed according to the untraversed resources in the multiple second subsequences,
[0059] In the case where the resource obtained by the first pointer number of the s-th traversal is not the last resource of the last first subsequence, and the resource obtained by the second pointer number of the s-th traversal is the last resource of the last second subsequence, a fifth abnormal result is formed according to the untraversed resources in the multiple first subsequences,
[0060] The audit information also includes the fourth abnormal result or the fifth abnormal result.
[0061] In one example, a double pointer can be used to traverse multiple first subsequences and multiple second subsequences, wherein the pointer in the double pointer corresponding to the multiple first subsequences is the first pointer, and the pointer in the double pointer corresponding to the multiple second subsequences is the second pointer, the aforementioned first pointer number can be understood as the number of the first pointer, and the aforementioned second pointer number can be understood as the number of the second pointer, and the initial values of the first pointer number and the second pointer number are both 1. During the above-mentioned iterative traversal process, the first pointer number and the second pointer number will be adaptively updated.
[0062] In this example, the first subsequences arranged in order are set to be {A1, A2, ..., A n}, the multiple second subsequences arranged in order are {B1, B2, ..., B m}, the preset sorting rule is to sort the resources in ascending order according to their resource numbers, then the first traversal in the above iterative traversal is:
[0063] Take out the first resource a1 from A1, take out the first resource b1 from B1, and compare whether the resource numbers of a1 and b1 (which can be understood as the primary key value of the resource) are the same. If the resource numbers are the same, further compare whether the status values of a1 and b1 are the same. If the status values are the same, enter the second traversal (that is, determine that the comparison result of the first traversal is a normal result). If the status values are different, record a1 and b1 as an abnormal data pair (that is, determine that the comparison result of the first traversal is the third abnormal result), and enter the second traversal after recording;
[0064] If the resource numbers are different and a1 < b1, it indicates that the a1 resource exists in the first sequence but not in the second sequence. a1 needs to be recorded as abnormal data, that is, it is determined that the comparison result of the first traversal is the first abnormal result. After completing the recording, enter the second traversal. For example, if the resource number of a1 is 1 and the resource number of b1 is also 2, then the resource with the resource number 1 exists in the first sequence but not in the second sequence. At this time, a1 needs to be marked as abnormal data;
[0065] If the resource numbers are different and a1 > b1, it indicates that the b1 resource exists in the second sequence but not in the first sequence. b1 needs to be recorded as abnormal data, that is, it is determined that the comparison result of the first traversal is the second abnormal result. After completing the recording, enter the second traversal;
[0066] During the traversal process, if the resources in A1 are taken out, then the corresponding resources are taken out from A2 in turn. Similarly, if the resources in B1 are taken out, then the corresponding resources are taken out from B2 in turn, and so on until the resources in the first sequence or the second sequence are taken out, then the traversal is terminated. When the traversal ends, the remaining unextracted resources will be batch-identified as abnormal data.
[0067] It should be noted that when the second target resource is the first resource in the second sequence, the resource number of the first target resource is less than the resource number of the second target resource, and the preset sorting rule is the rule of sorting in ascending order according to the resource numbers of the resources, it will be determined that the comparison result of the s-th traversal is the first abnormal result;
[0068] When the second target resource is the first resource in the second sequence, the resource number of the first target resource is greater than the resource number of the second target resource, and the preset sorting rule is the rule of sorting in descending order according to the resource numbers of the resources, it will be determined that the comparison result of the s-th traversal is the first abnormal result.
[0069] In one embodiment, after obtaining the comparison result of the s-th traversal by comparing the first target resource and the second target resource, the method further includes:
[0070] When the comparison result of the s-th traversal is the third abnormal result, initiate a status acquisition request for the first target resource to the virtual system;
[0071] Receive the real-time status value of the first target resource returned by the virtual system in response to the status acquisition request;
[0072] If the real-time status value of the first target resource is the same as the status value of the second target resource, the comparison result of the sth traversal is deleted from the database, and the database is used to store the audit information.
[0073] For two resources with the same resource number but different status values, the real-time status values of the corresponding resources are obtained from the virtual system to further verify the status values of the two resources with the same resource number, so as to identify the resource differences caused by the data transmission delay between the virtual system and the physical machine system, and delete the abnormal data caused by such abnormal differences to avoid the resulting false alarm problems.
[0074] In the application, an interface may be pre-set in the virtual system, and the physical machine system may obtain the real-time status value of the resource to be re-verified by calling the interface.
[0075] In one embodiment, after performing resource comparison on the first target resource and the second target resource to obtain the comparison result of the s-th traversal, the method further includes:
[0076] When the comparison result of the s-th traversal is the first abnormal result, adding the corresponding first target resource to the database;
[0077] When the comparison result of the s-th traversal is the second abnormal result, deleting the corresponding second target resource in the database;
[0078] The database is used to store the audit information.
[0079] Through the above settings, the resource situation of the virtual system is used as the basis for resource auditing, and the resources of the physical system are adaptively increased or decreased to match actual business requirements, avoiding audit operations that result in changes to user data involved in the virtual system, thereby avoiding user complaints caused by changes in user data.
[0080] For ease of understanding, the following examples are provided:
[0081] like Figure 2 As shown, the embodiment of the present application also provides a cloud computer resource audit method, and its specific process is as follows:
[0082] The upper-level system (which can be understood as the aforementioned virtual system) sorts all resources and the status information of each resource in the specified order of the specified column and exports it into a spreadsheet (which can be understood as the first sequence), and then uploads it to the object storage (which can be understood as the target storage). After obtaining the corresponding download address, the download address is sent to the message queue.
[0083] After the underlying system (which can be understood as a physical machine system) obtains the download address of the object storage of all resources of the upper-level system and the status information of each resource from the message queue, it downloads the resource information spreadsheet of the upper-level system to the local computer, and then performs data comparison according to the aforementioned data comparison process (i.e., the process of iteratively traversing the multiple first subsequences and the multiple second subsequences).
[0084] Through the above settings, the upper-level system and the underlying system can each maintain their own resource data, which can reduce the resource coupling between the underlying system and the upper-level system; in addition, the data audit logic adapts to the actual production requirements, and is based on the resource information close to the user side (that is, based on the first sequence). If abnormal resource information is identified, the resource status of the underlying system is modified to protect the user's data property security; and the upper-level system sends information to the object storage, and the underlying system completes the data transmission by downloading from the object storage. This is more convenient and less affected by network fluctuations, and is not easy to lose data, and data security is also greatly improved.
[0085] This application sets up a process of first sorting, then batching, and finally iterating resources in sequence to perform data comparison, which can avoid putting all data into memory for comparison at one time, and also avoids the use of loops in the algorithm, reduces the complexity of the algorithm, and improves the stability and speed of program execution.
[0086] In the resource audit process of cloud computer products, the application of the above method can not only reduce the coupling degree between the upper system and the underlying system corresponding to the cloud computer products, thereby reducing the difficulty of maintaining the cloud computer products; it can also fully protect the data and property security of users, and improve the resource audit efficiency of cloud computer products, which can greatly enhance the market competitiveness of cloud computer products.
[0087] The embodiment of the present disclosure also provides a resource auditing device, which is applied to a physical machine system in a cloud platform, wherein the cloud platform also includes a virtual system corresponding to the physical machine system, such as Figure 3 As shown, the resource auditing device 300 includes:
[0088] The download module 301 is used to obtain a download address of a first sequence in a target storage, and download the first sequence from the target storage according to the download address, wherein the first sequence is a resource sequence obtained by sorting a plurality of resources included in the virtual system according to a preset sorting rule;
[0089] The audit module 302 is used to perform resource audit on the second sequence based on the first sequence to obtain audit information, wherein the second sequence is a resource sequence obtained by sorting multiple resources included in the physical machine system according to the preset sorting rule.
[0090] In one embodiment, the audit module 302 is specifically used to:
[0091] According to a preset resource segmentation parameter, the first sequence and the second sequence are segmented respectively to obtain a plurality of first subsequences and a plurality of second subsequences arranged in order, wherein the first sequence includes the plurality of first subsequences, the second sequence includes the plurality of second subsequences, the number of resources included in the first subsequence is less than or equal to the number of resources indicated by the resource segmentation parameter, and the number of resources included in the second subsequence is less than or equal to the number of resources indicated by the resource segmentation parameter;
[0092] The multiple first subsequences and the multiple second subsequences are iterated to obtain audit information.
[0093] In one embodiment, the sth traversal in the iterative traversal includes:
[0094] Obtain a first target resource according to the first pointer number of the s-th traversal, and obtain a second target resource according to the second pointer number of the s-th traversal, wherein the first target resource is the k-th resource of the i-th first subsequence, the second target resource is the p-th resource of the j-th second subsequence, and s, i, j, k, and p are all positive integers;
[0095] Perform resource comparison on the first target resource and the second target resource to obtain a comparison result of the sth traversal;
[0096] According to the comparison result of the s-th traversal, the first pointer number of the s-th traversal and the second pointer number of the s-th traversal are updated to obtain the first pointer number of the s+1-th traversal and the second pointer number of the s+1-th traversal;
[0097] Among them, when s is equal to 1, the first pointer number of the s-th traversal is used to obtain the first resource of the first first subsequence, and the second pointer number of the s-th traversal is used to obtain the first resource of the first second subsequence.
[0098] In one embodiment, the preset sorting rule is a rule for sorting according to resource numbers of resources;
[0099] When the resource number of the first target resource is the same as the resource number of the second target resource, and the status value of the first target resource is the same as the status value of the second target resource, determining that the comparison result of the s-th traversal is a normal result;
[0100] In the case where the resource number of the first target resource is different from the resource number of the second target resource, and the resource number of the first target resource is between the resource number of the second target resource and the resource number of the third target resource, it is determined that the comparison result of the s-th traversal is a first abnormal result, and the third target resource is the resource number of the previous resource of the second target resource in the second sequence;
[0101] When the resource number of the first target resource is different from the resource number of the second target resource, and the resource number of the second target resource is between the resource number of the first target resource and the resource number of the fourth target resource, it is determined that the comparison result of the s-th traversal is a second abnormal result, and the fourth target resource is a resource preceding the first target resource in the first sequence;
[0102] When the resource number of the first target resource is the same as the resource number of the second target resource, and the state value of the first target resource is different from the state value of the second target resource, determining that the comparison result of the s-th traversal is a third abnormal result;
[0103] The audit information includes the first abnormal result, the second abnormal result and the third abnormal result.
[0104] In one embodiment, when the comparison result of the s-th traversal is the normal result or the third abnormal result, the difference between the first pointer number of the s-th traversal and the first pointer number of the s+1-th traversal is 1, and the difference between the second pointer number of the s-th traversal and the second pointer number of the s+1-th traversal is 1, or, the difference between the first pointer number of the s-th traversal and the first pointer number of the s+1-th traversal is -1, and the difference between the second pointer number of the s-th traversal and the second pointer number of the s+1-th traversal is -1;
[0105] When the comparison result of the s-th traversal is the first abnormal result, the difference between the first pointer number of the s-th traversal and the first pointer number of the s+1-th traversal is 1, and the difference between the second pointer number of the s-th traversal and the second pointer number of the s+1-th traversal is 0, or the difference between the first pointer number of the s-th traversal and the first pointer number of the s+1-th traversal is -1, and the difference between the second pointer number of the s-th traversal and the second pointer number of the s+1-th traversal is 0;
[0106] When the comparison result of the s-th traversal is the second abnormal result, the difference between the first pointer number of the s-th traversal and the first pointer number of the s+1-th traversal is 0, and the difference between the second pointer number of the s-th traversal and the second pointer number of the s+1-th traversal is 1, or, the difference between the first pointer number of the s-th traversal and the first pointer number of the s+1-th traversal is 0, and the difference between the second pointer number of the s-th traversal and the second pointer number of the s+1-th traversal is -1.
[0107] In one embodiment, the resource auditing device 300 further includes a review module, and the review module is used to:
[0108] In a case where the comparison result of the s-th traversal is the third abnormal result, initiating a status acquisition request corresponding to the first target resource to the virtual system;
[0109] Receiving a real-time status value of the first target resource returned by the virtual system in response to the status acquisition request;
[0110] If the real-time status value of the first target resource is the same as the status value of the second target resource, the comparison result of the sth traversal is deleted from the database, and the database is used to store the audit information.
[0111] In one embodiment, the resource auditing device 300 further includes an audit processing module, and the audit processing module is used to:
[0112] When the comparison result of the s-th traversal is the first abnormal result, adding the first target resource to the database;
[0113] When the comparison result of the s-th traversal is the second abnormal result, deleting the second target resource in the database;
[0114] The database is used to store the audit information.
[0115] The resource auditing device 300 provided in the embodiment of the present disclosure can implement each process in the above-mentioned resource auditing method embodiment, and will not be described again here to avoid repetition.
[0116] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device and a readable storage medium.
[0117] Figure 4A schematic block diagram of an example electronic device 400 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0118] like Figure 4 As shown, the device 400 includes a computing unit 401, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 402 or a computer program loaded from a storage unit 408 to a random access memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the device 400 can also be stored. The computing unit 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.
[0119] A number of components in the device 400 are connected to the I / O interface 405, including: an input unit 406, such as a keyboard, a mouse, etc.; an output unit 407, such as various types of displays, speakers, etc.; a storage unit 408, such as a disk, an optical disk, etc.; and a communication unit 409, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 409 allows the device 400 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0120] The computing unit 401 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 401 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSP), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 401 performs the various methods and processes described above, such as the resource audit method. For example, in some embodiments, the resource audit method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 408. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 400 via the ROM 402 and / or the communication unit 409. When the computer program is loaded into the RAM 403 and executed by the computing unit 401, one or more steps of the resource audit method described above may be performed. Alternatively, in other embodiments, the computing unit 401 may be configured to execute the resource auditing method in any other appropriate manner (eg, by means of firmware).
[0121] Various embodiments of the systems and techniques described above herein may be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0122] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0123] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0124] As used herein, the term "machine-readable medium" refers to any computer program product, apparatus, and / or device (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.
[0125] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0126] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0127] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0128] The present application also provides a computer program product, including computer instructions, which, when executed by a processor, implement the above Figure 1 The various processes of the method embodiment shown can achieve the same technical effect, and will not be described again here to avoid repetition.
[0129] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0130] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A resource audit method, characterized in that: In a physical machine system applied in a cloud platform, the cloud platform further includes a virtual system corresponding to the physical machine system, the method comprising: Obtaining a download address of a first sequence in a target storage, and downloading the first sequence from the target storage according to the download address, wherein the first sequence is a resource sequence obtained by sorting a plurality of resources included in the virtual system according to a preset sorting rule; A resource audit is performed on a second sequence based on the first sequence to obtain audit information, wherein the second sequence is a resource sequence obtained by sorting a plurality of resources included in the physical machine system according to the preset sorting rule.
2. The method according to claim 1, characterized in that The performing resource audit on the second sequence based on the first sequence to obtain audit information includes: According to a preset resource segmentation parameter, the first sequence and the second sequence are segmented respectively to obtain a plurality of first subsequences and a plurality of second subsequences arranged in order, wherein the first sequence includes the plurality of first subsequences, the second sequence includes the plurality of second subsequences, the number of resources included in the first subsequence is less than or equal to the number of resources indicated by the resource segmentation parameter, and the number of resources included in the second subsequence is less than or equal to the number of resources indicated by the resource segmentation parameter; The multiple first subsequences and the multiple second subsequences are iterated to obtain audit information.
3. The method according to claim 2, characterized in that The sth traversal in the iterative traversal includes: Obtain a first target resource according to the first pointer number of the s-th traversal, and obtain a second target resource according to the second pointer number of the s-th traversal, wherein the first target resource is the k-th resource of the i-th first subsequence, the second target resource is the p-th resource of the j-th second subsequence, and s, i, j, k, and p are all positive integers; Perform resource comparison on the first target resource and the second target resource to obtain a comparison result of the sth traversal; According to the comparison result of the s-th traversal, the first pointer number of the s-th traversal and the second pointer number of the s-th traversal are updated to obtain the first pointer number of the s+1-th traversal and the second pointer number of the s+1-th traversal; Among them, when s is equal to 1, the first pointer number of the s-th traversal is used to obtain the first resource of the first first subsequence, and the second pointer number of the s-th traversal is used to obtain the first resource of the first second subsequence.
4. The method according to claim 3, characterized in that The preset sorting rule is a rule for sorting according to the resource numbers of the resources; When the resource number of the first target resource is the same as the resource number of the second target resource, and the status value of the first target resource is the same as the status value of the second target resource, determining that the comparison result of the s-th traversal is a normal result; In the case where the resource number of the first target resource is different from the resource number of the second target resource, and the resource number of the first target resource is between the resource number of the second target resource and the resource number of the third target resource, it is determined that the comparison result of the s-th traversal is a first abnormal result, and the third target resource is the resource number of the previous resource of the second target resource in the second sequence; When the resource number of the first target resource is different from the resource number of the second target resource, and the resource number of the second target resource is between the resource number of the first target resource and the resource number of the fourth target resource, it is determined that the comparison result of the s-th traversal is a second abnormal result, and the fourth target resource is a resource preceding the first target resource in the first sequence; When the resource number of the first target resource is the same as the resource number of the second target resource, and the state value of the first target resource is different from the state value of the second target resource, determining that the comparison result of the s-th traversal is a third abnormal result; The audit information includes the first abnormal result, the second abnormal result and the third abnormal result.
5. The method according to claim 4, characterized in that When the comparison result of the s-th traversal is the normal result or the third abnormal result, the difference between the first pointer number of the s-th traversal and the first pointer number of the s+1-th traversal is 1, and the difference between the second pointer number of the s-th traversal and the second pointer number of the s+1-th traversal is 1, or, the difference between the first pointer number of the s-th traversal and the first pointer number of the s+1-th traversal is -1, and the difference between the second pointer number of the s-th traversal and the second pointer number of the s+1-th traversal is -1; When the comparison result of the s-th traversal is the first abnormal result, the difference between the first pointer number of the s-th traversal and the first pointer number of the s+1-th traversal is 1, and the difference between the second pointer number of the s-th traversal and the second pointer number of the s+1-th traversal is 0, or the difference between the first pointer number of the s-th traversal and the first pointer number of the s+1-th traversal is -1, and the difference between the second pointer number of the s-th traversal and the second pointer number of the s+1-th traversal is 0; When the comparison result of the s-th traversal is the second abnormal result, the difference between the first pointer number of the s-th traversal and the first pointer number of the s+1-th traversal is 0, and the difference between the second pointer number of the s-th traversal and the second pointer number of the s+1-th traversal is 1, or, the difference between the first pointer number of the s-th traversal and the first pointer number of the s+1-th traversal is 0, and the difference between the second pointer number of the s-th traversal and the second pointer number of the s+1-th traversal is -1.
6. The method according to claim 4, characterized in that After performing resource comparison on the first target resource and the second target resource to obtain the comparison result of the s-th traversal, the method further includes: In a case where the comparison result of the s-th traversal is the third abnormal result, initiating a status acquisition request corresponding to the first target resource to the virtual system; Receiving a real-time status value of the first target resource returned by the virtual system in response to the status acquisition request; If the real-time status value of the first target resource is the same as the status value of the second target resource, the comparison result of the sth traversal is deleted from the database, and the database is used to store the audit information.
7. The method according to claim 4, characterized in that After performing resource comparison on the first target resource and the second target resource to obtain the comparison result of the s-th traversal, the method further includes: When the comparison result of the s-th traversal is the first abnormal result, adding the first target resource to the database; When the comparison result of the s-th traversal is the second abnormal result, deleting the second target resource in the database; The database is used to store the audit information.
8. A resource auditing device, characterized in that: In a physical machine system applied to a cloud platform, the cloud platform further includes a virtual system corresponding to the physical machine system, and the device includes: a download module, configured to obtain a download address of a first sequence in a target storage, and download the first sequence from the target storage according to the download address, wherein the first sequence is a resource sequence obtained by sorting a plurality of resources included in the virtual system according to a preset sorting rule; An audit module is used to perform resource audit on a second sequence based on the first sequence to obtain audit information, wherein the second sequence is a resource sequence obtained by sorting multiple resources included in the physical machine system according to the preset sorting rule.
9. An electronic device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps of the method according to any one of claims 1 to 7 when executed by the processor.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
11. A computer program product, characterized in that The method comprises computer instructions, which, when executed by a processor, implement the steps of the method according to any one of claims 1 to 7.
