Resource reporting method and device based on dynamic plug-in, equipment and medium
By using dynamic plug-in resource reporting methods in cloud computing, the problem of fixed resource information acquisition methods and low version update efficiency in the existing technology is solved, and the effect of flexible acquisition of resource information and improving version update efficiency is achieved.
Patent Information
- Application Number
- CN202311245197.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-25
- Publication Date
- 2025-03-25
AI Technical Summary
In the prior art, when creating a cloud host, the scheduling layer needs to obtain the underlying resource information through polling, resulting in a fixed way to obtain resource information. When adding resource information, the software version needs to be updated, which increases the development, testing and operation and maintenance workload, and reduces the efficiency of version update and iteration.
Provide a dynamic plug-in resource reporting method, by loading dynamic plug-ins in the target configuration file, execute dynamic plug-ins regularly to obtain target resource information, and report it to the central database.
Resource information is obtained through dynamic plug-ins. When adding resource information, only the corresponding dynamic plug-ins need to be added without modifying the code, which reduces the workload and improves the efficiency of version update and iteration.
Smart Images

Figure CN119690533A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of cloud computing, and in particular to a method, device, equipment and medium for reporting resources based on dynamic plug-ins. Background Art
[0002] When creating a cloud host, the scheduling layer needs the resource information reported by the underlying layer. The resource information includes the required hardware information, such as the central processing unit (CPU), memory, disk, network card, etc.
[0003] In related technologies, polling is usually used to obtain underlying resource information through coding at fixed intervals and report it to a central database. However, the reported resource field information, field structure, and method of obtaining information cannot be changed and are fixed in the coding. Each time resource information is added, the software version needs to be updated, which increases the workload of development, testing, and operation and maintenance, and reduces the efficiency of version update iterations. Summary of the invention
[0004] In order to solve the above technical problems, the present disclosure provides a method, device, equipment and medium based on dynamic plug-in resource reporting.
[0005] In a first aspect, the present disclosure provides a method for reporting resources based on a dynamic plug-in, comprising:
[0006] Load dynamic plugins in the target configuration file;
[0007] The dynamic plug-in is executed regularly based on the first preset time to obtain target resource information;
[0008] Report target resource information to the central database.
[0009] In a second aspect, the present disclosure provides a dynamic plug-in resource reporting device, comprising:
[0010] The first loading module is used to load the dynamic plug-in in the target configuration file;
[0011] A plug-in execution module, used to execute the dynamic plug-in regularly based on a first preset time to obtain target resource information;
[0012] The resource reporting module is used to report target resource information to the central database.
[0013] In a third aspect, the present disclosure provides a dynamic plug-in resource reporting device, including:
[0014] processor;
[0015] A memory for storing executable instructions;
[0016] The processor is used to read executable instructions from the memory and execute the executable instructions to implement the dynamic plug-in resource reporting method based on the first aspect.
[0017] In a fourth aspect, the present disclosure provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the processor implements the dynamic plug-in resource reporting method according to the first aspect.
[0018] Compared with the prior art, the technical solution provided by the embodiments of the present disclosure has the following advantages:
[0019] The dynamic plug-in resource reporting method, device, equipment and medium based on the disclosed embodiments can load the dynamic plug-in in the target configuration file, then execute the dynamic plug-in based on a first preset time to obtain the target resource information, and finally report the target resource information to the central database. Thus, the target resource information can be obtained by means of a dynamic plug-in. When adding new resource information, only the corresponding dynamic plug-in needs to be added without modifying the code, thereby reducing the workload and improving the efficiency of version update iteration. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0021] Figure 1 A flowchart of a dynamic plug-in resource reporting method provided in an embodiment of the present disclosure;
[0022] Figure 2 A schematic diagram of a process of dynamically loading a configuration file provided by an embodiment of the present disclosure;
[0023] Figure 3 A schematic diagram of a process of dynamic loading of a dynamic plug-in provided in an embodiment of the present disclosure;
[0024] Figure 4 A schematic diagram of the structure of a dynamic plug-in resource reporting device provided in an embodiment of the present disclosure;
[0025] Figure 5 A schematic diagram of the structure of a dynamic plug-in resource reporting device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0026] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0027] 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.
[0028] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0029] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0030] 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".
[0031] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0032] In order to solve the above problems, the present disclosure provides a method, device, equipment and medium based on dynamic plug-in resource reporting. Figures 1 to 3 The dynamic plug-in resource reporting method provided in the embodiment of the present disclosure is described in detail.
[0033] Figure 1 A flow chart of a dynamic plug-in resource reporting method provided in an embodiment of the present disclosure is shown.
[0034] In the embodiment of the present disclosure, the dynamic plug-in resource reporting method may be executed by a server, wherein the server may include but is not limited to servers such as cloud servers or cloud server clusters.
[0035] like Figure 1 As shown, the dynamic plug-in resource reporting method may include the following steps.
[0036] S110. Load the dynamic plug-in in the target configuration file.
[0037] In an embodiment of the present disclosure, the server may load a dynamic plug-in in a target configuration file.
[0038] Optionally, the target configuration file may be a resource information field for different hardware configurations, wherein the target configuration file may be in a yaml format.
[0039] For example, hardware may include CPU, memory, disk, network card, etc.
[0040] Optionally, the dynamic plug-in may be used to obtain resource information of different hardware. For example, the dynamic plug-in may be a shell, python, libvirt plug-in, etc., which are not limited here. The dynamic plug-in may be a custom script or a custom tool.
[0041] Specifically, the server may load the dynamic plug-in in the target configuration file.
[0042] S120: Execute the dynamic plug-in based on the first preset time to obtain target resource information.
[0043] In an embodiment of the present disclosure, the server may periodically execute the dynamic plug-in based on a first preset time to obtain target resource information.
[0044] Optionally, the first preset time may be a pre-set time. For example, the first preset time may be 5s, 10s, etc., which is not limited here.
[0045] Optionally, the target resource information may be information corresponding to different hardware, wherein the target resource information may be in json format.
[0046] Specifically, the server may periodically execute the dynamic plug-in based on the first preset time. For example, the server may execute the dynamic plug-in once every 5 seconds, so that the dynamic plug-in obtains the target resource information of the corresponding hardware.
[0047] S130. Report target resource information to the central database.
[0048] In the disclosed embodiment, the server may report target resource information to a central database.
[0049] Optionally, the central database may be a database storing target resource information.
[0050] Specifically, after acquiring the target resource information, the server may report the target resource information to the central database, so that the central database saves the target resource information.
[0051] Therefore, in the disclosed embodiment, the dynamic plug-in in the target configuration file can be loaded, and then the dynamic plug-in is executed based on the first preset time to obtain the target resource information, and finally the target resource information is reported to the central database. Thus, the target resource information can be obtained by means of the dynamic plug-in. When adding new resource information, only the corresponding dynamic plug-in needs to be added without modifying the code, thereby reducing the workload and improving the efficiency of version update iteration.
[0052] Optionally, before S110, the dynamic plug-in resource reporting method may further include: regularly reading the target configuration file based on a second preset time and saving it in the memory; and reloading the target configuration file saved in the memory when it is detected that the modification time of the target configuration file has changed.
[0053] In the embodiment of the present disclosure, the server may periodically read the target configuration file based on the second preset time and save it in the memory.
[0054] Optionally, the second preset time may be a pre-set time. For example, the second preset time may be 2s, 3s, etc., which is not limited here.
[0055] Optionally, the memory may be server host memory.
[0056] Specifically, the server may periodically read the target configuration file based on the second preset time. For example, the server may periodically read the target configuration file once every 2 seconds and save the target configuration file in the memory.
[0057] Furthermore, when it is detected that the modification time of the target configuration file is changed, the target configuration file stored in the memory is reloaded.
[0058] Specifically, when the user modifies the target configuration file, the modification time of the target configuration file will change. After detecting that the modification time of the target configuration file has changed, the server can reload the target configuration file stored in the memory.
[0059] Figure 2 A schematic diagram of a process of dynamic loading based on a configuration file provided by an embodiment of the present disclosure is shown.
[0060] like Figure 2As shown, conifg.yaml can be the target configuration file. After starting loading, the server can read the target configuration file regularly based on the second preset time and save it in the server host memory (map). The server can monitor (goroutine) whether the modification time of the target configuration file changes (update time change), and when it detects that the modification time of the target configuration file changes, the target configuration file (conifg.yaml) is reloaded into the server host memory (map).
[0061] In this way, the target configuration file can be updated dynamically in real time, improving the efficiency of version update iteration.
[0062] Optionally, after S110, the dynamic plug-in resource reporting method may further include: when the target configuration file is reloaded, determining the modification type of the target configuration file; when the modification type is a first modification type, loading a first dynamic plug-in; when the modification type is a second modification type, deleting a second dynamic plug-in.
[0063] In an embodiment of the present disclosure, the server may determine the modification type of the target configuration file when the target configuration file is reloaded.
[0064] Optionally, the modification type may be a type of modification operation performed on the target configuration file, for example, the modification type may be a new plug-in type or a deleted plug-in type.
[0065] Specifically, after detecting that the target configuration file is reloaded, the server may determine the modification type of the target configuration file.
[0066] In some embodiments, when the modification type is a first modification type, the server may load a first dynamic plug-in.
[0067] Optionally, the first modification type may be a preset type. For example, the first modification type may be a newly added plug-in type.
[0068] Optionally, the first dynamic plug-in may be a newly added dynamic plug-in.
[0069] Specifically, when the server determines that the modification type is the first modification type, such as the modification type is a newly added plug-in type, the server may load a newly added dynamic plug-in, namely, the first dynamic plug-in, and save it in the memory.
[0070] In other embodiments, when the modification type is the second modification type, the server may delete the second dynamic plug-in.
[0071] Optionally, the second modification type may be a preset type. For example, the second modification type may be a plug-in deletion type.
[0072] Optionally, the second dynamic plug-in may be a dynamic plug-in to be deleted.
[0073] Specifically, when the server determines that the modification type is the second modification type, such as the modification type of deleting a plug-in, the server may delete the dynamic plug-in to be deleted from the loaded dynamic plug-ins, that is, delete the second dynamic plug-in.
[0074] Figure 3 A schematic diagram of a process of dynamic loading of a dynamic plug-in provided by an embodiment of the present disclosure is shown.
[0075] like Figure 3 As shown, the server can monitor the target configuration file through the configuration file monitoring (goroutine). When the target configuration file is reloaded, the monitoring coroutine sends the time to the dynamic loading coroutine. The dynamic loading coroutine can determine the modification type of the target configuration file according to the time. If the modification type is a new plug-in type, the new dynamic plug-in, that is, the first dynamic plug-in, is loaded and saved in the memory (map); if the modification type is a deletion plug-in type, the dynamic plug-in to be deleted can be deleted from the loaded dynamic plug-ins, that is, the second dynamic plug-in is deleted.
[0076] In this way, dynamic plug-ins can be added and deleted dynamically without modifying the code, reducing the workload and improving the efficiency of version update iteration.
[0077] Optionally, the dynamic plug-in resource reporting method may further include: in response to a file rollback operation by a user, rolling back a configuration version of the target configuration file to obtain a historical configuration version of the target configuration file.
[0078] In an embodiment of the present disclosure, the server may roll back the configuration version of the target configuration file in response to a file rollback operation by the user, and obtain a historical configuration version of the target configuration file.
[0079] Optionally, the file rollback operation may be an operation of rolling back a configuration version of the configuration file.
[0080] Specifically, the server can save the historical configuration version of the target configuration file. When the user wants to restore the target configuration file to the historical configuration version, the user can perform a file rollback operation on the target configuration file. The server can respond to the file rollback operation and roll back the configuration version of the target configuration file to obtain the historical configuration version of the target configuration file.
[0081] This can provide better configuration management and troubleshooting capabilities.
[0082] Optionally, the dynamic plug-in resource reporting method may further include: in response to a file configuration operation of a user, grouping and inheriting the target configuration files to obtain a new target configuration file.
[0083] In the embodiment of the present disclosure, the server may group and inherit the target configuration files in response to the file configuration operation of the user to obtain a new target configuration file.
[0084] Optionally, the file configuration operation may be an operation for configuring a file, for example, a grouping and inheritance operation.
[0085] Specifically, the server may group configuration files according to different functions or environments in response to the file configuration operation of the user, and allow inheritance and overwriting between configuration files to obtain a new target configuration file.
[0086] This can improve the readability and maintainability of the configuration file.
[0087] Optionally, S120 may specifically include: determining corresponding target hardware based on the dynamic plug-in; and timing executing the dynamic plug-in based on a first preset time, so that the dynamic plug-in obtains target resource information corresponding to the target hardware.
[0088] In an embodiment of the present disclosure, the server may determine the corresponding target hardware based on the dynamic plug-in.
[0089] Optionally, the target hardware may be physical hardware whose resource information is to be obtained. For example, the target hardware may be a CPU, a memory, a disk, a network card, etc., which is not limited here.
[0090] Specifically, the server may determine the corresponding target hardware according to the dynamic plug-in, for example, determining that the dynamic plug-in is used to collect resource information of memory hardware.
[0091] Furthermore, the server may periodically execute the dynamic plug-in based on the first preset time, so that the dynamic plug-in obtains target resource information corresponding to the target hardware.
[0092] Specifically, the server can execute the dynamic plug-in regularly based on the first preset time, such as executing the dynamic plug-in regularly every 5 seconds, so that the dynamic plug-in obtains the target resource information corresponding to the target hardware, such as collecting the target resource information corresponding to the memory hardware through the dynamic plug-in, and the target resource information can be in json format. The dynamic plug-in mainly collects the local physical resource information of the computing node, and there is no increase in network load and no situation of obtaining remote network data, thereby optimizing the performance of the dynamic plug-in and reducing the occupation of system resources. The response speed and efficiency of the dynamic plug-in can also be improved through code optimization, asynchronous loading, caching and other technologies.
[0093] Optionally, the dynamic plug-in resource reporting method may further include: based on a preset plug-in rule, performing a security review on the dynamic plug-in to determine the plug-in type of the dynamic plug-in; and deleting the dynamic plug-in when the plug-in type is a preset type.
[0094] In the embodiment of the present disclosure, the server may perform a security review on the dynamic plug-in based on a preset plug-in rule to determine the plug-in type of the dynamic plug-in.
[0095] Optionally, the preset plug-in rule may be a pre-set plug-in rule. For example, the preset plug-in rule may be a plug-in signature, permission control, sandbox environment, etc., which are not limited here.
[0096] Optionally, the plug-in type may be used to characterize the security of the dynamic plug-in. For example, the plug-in type may include a malicious plug-in, an invalid plug-in, a normal plug-in, etc., which are not limited here.
[0097] Specifically, the server may perform a security review on the dynamic plug-in according to a preset plug-in rule, thereby determining the plug-in type of the dynamic plug-in.
[0098] Furthermore, when the plug-in type is a preset type, the server may delete the dynamic plug-in.
[0099] Optionally, the preset type may be a pre-set type, for example, a malicious plug-in, an invalid plug-in, etc., which is not limited here.
[0100] Specifically, after the server determines the plug-in type of the dynamic plug-in, if the plug-in type is a preset type, such as a malicious plug-in, an invalid plug-in, etc., the server may delete the dynamic plug-in.
[0101] This ensures the security of dynamic plug-ins and prevents malicious plug-ins from causing damage to the system.
[0102] Figure 4 A schematic diagram of the structure of a dynamic plug-in resource reporting device provided in an embodiment of the present disclosure is shown.
[0103] like Figure 4 As shown, the dynamic plug-in-based resource reporting device 400 may include a first loading module 410 , a plug-in execution module 420 and a resource reporting module 430 .
[0104] The first loading module 410 may be used to load a dynamic plug-in in a target configuration file.
[0105] The plug-in execution module 420 can be used to execute the dynamic plug-in based on a first preset time to obtain target resource information.
[0106] The resource reporting module 430 may be used to report target resource information to a central database.
[0107] Therefore, in the disclosed embodiment, the dynamic plug-in in the target configuration file can be loaded, and then the dynamic plug-in is executed based on the first preset time to obtain the target resource information, and finally the target resource information is reported to the central database. Thus, the target resource information can be obtained by means of the dynamic plug-in. When adding new resource information, only the corresponding dynamic plug-in needs to be added without modifying the code, thereby reducing the workload and improving the efficiency of version update iteration.
[0108] In some embodiments of the present disclosure, the dynamic plug-in-based resource reporting device 400 may further include a file reading module and a second loading module.
[0109] The file reading module can be used to read the target configuration file based on a second preset time period before loading the dynamic plug-in in the target configuration file, and save it in the memory.
[0110] The second loading module can be used to reload the target configuration file stored in the memory when it is detected that the modification time of the target configuration file has changed.
[0111] In some embodiments of the present disclosure, the dynamic plug-in resource reporting device 400 may further include a first judgment module, a plug-in loading module and a first deletion module.
[0112] The first determination module may be used to determine the modification type of the target configuration file when the target configuration file is reloaded after the dynamic plug-in in the target configuration file is loaded.
[0113] The plug-in loading module may be used to load a first dynamic plug-in when the modification type is a first modification type.
[0114] The first deletion module can be used to delete the second dynamic plug-in when the modification type is the second modification type.
[0115] In some embodiments of the present disclosure, the dynamic plug-in-based resource reporting device 400 may further include a first processing module.
[0116] The first processing module may be configured to roll back the configuration version of the target configuration file in response to a file rollback operation by the user, and obtain a target configuration file of a historical configuration version.
[0117] In some embodiments of the present disclosure, the dynamic plug-in-based resource reporting device 400 may further include a second processing module.
[0118] The second processing module may be used to group and inherit the target configuration files in response to the user's file configuration operation to obtain a new target configuration file.
[0119] In some embodiments of the present disclosure, the plug-in execution module 420 may specifically include a hardware determination unit and a plug-in execution unit.
[0120] The hardware determination unit may be configured to determine corresponding target hardware based on the dynamic plug-in.
[0121] The plug-in execution unit can be used to execute the dynamic plug-in regularly based on a first preset time, so that the dynamic plug-in obtains target resource information corresponding to the target hardware.
[0122] In some embodiments of the present disclosure, the dynamic plug-in resource reporting device 400 may further include a second judgment module and a second deletion module.
[0123] The second determination module may be used to perform a security review on the dynamic plug-in based on a preset plug-in rule and determine the plug-in type of the dynamic plug-in.
[0124] The second deletion module can be used to delete the dynamic plug-in when the plug-in type is a preset type.
[0125] It should be noted that Figure 4 The dynamic plug-in resource reporting device 400 shown can execute Figures 1 to 3 The various steps in the method embodiment shown in the figure are implemented Figures 1 to 3 The various processes and effects in the method embodiment shown are not described in detail here.
[0126] Figure 5 A structural schematic diagram of a dynamic plug-in resource reporting device provided in an embodiment of the present disclosure is shown.
[0127] In some embodiments of the present disclosure, Figure 5 The dynamic plug-in resource reporting device shown may be a server device. Specifically, the server may include but is not limited to servers such as a cloud server or a cloud server cluster.
[0128] like Figure 5 As shown, the dynamic plug-in-based resource reporting device may include a processor 501 and a memory 502 storing computer program instructions.
[0129] Specifically, the processor 501 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0130] The memory 502 may include a large capacity memory for information or instructions. By way of example and not limitation, the memory 502 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a tape, or a universal serial bus (USB) drive or a combination of two or more of these. Where appropriate, the memory 502 may include a removable or non-removable (or fixed) medium. Where appropriate, the memory 502 may be inside or outside the integrated gateway device. In a particular embodiment, the memory 502 is a non-volatile solid-state memory. In a particular embodiment, the memory 502 includes a read-only memory (ROM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (Electrically Erasable Programmable ROM, EEPROM), an electrically rewritable ROM (EAROM) or a flash memory, or a combination of two or more of these.
[0131] The processor 501 reads and executes the computer program instructions stored in the memory 502 to perform the steps of the dynamic plug-in resource reporting method provided in the embodiment of the present disclosure.
[0132] In one example, the dynamic plug-in resource reporting device may further include a transceiver 503 and a bus 504. Figure 5 As shown, the processor 501, the memory 502 and the transceiver 503 are connected via a bus 504 and communicate with each other.
[0133] The bus 504 includes hardware, software, or both. For example, but not limitation, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industrial Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a memory bus, a MicroChannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus, or other suitable buses or a combination of two or more of these. Where appropriate, the bus 504 may include one or more buses. Although embodiments of the present application describe and illustrate a particular bus, the present application contemplates any suitable bus or interconnect.
[0134] The embodiment of the present disclosure further provides a computer-readable storage medium, which may store a computer program. When the computer program is executed by a processor, the processor implements the dynamic plug-in resource reporting method provided by the embodiment of the present disclosure.
[0135] The above-mentioned storage medium may, for example, include a memory 502 of computer program instructions, and the above-mentioned instructions may be executed by a processor 501 based on a dynamic plug-in resource reporting device to complete the dynamic plug-in resource reporting method provided by the embodiment of the present disclosure. Optionally, the storage medium may be a non-temporary computer-readable storage medium, for example, the non-temporary computer-readable storage medium may be a ROM, a random access memory (Random Access Memory, RAM), a compact disc read-only memory (Compact Disc ROM, CD-ROM), a magnetic tape, a floppy disk, and an optical data storage device, etc.
[0136] 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 term "comprising" is 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.
[0137] 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 method for reporting resources based on dynamic plug-ins, characterized in that: include: Load dynamic plugins in target configuration files; The dynamic plug-in is executed regularly based on a first preset time to obtain target resource information; Report the target resource information to a central database.
2. The method according to claim 1, characterized in that: Before loading the dynamic plug-in in the target configuration file, the method further includes: Reading the target configuration file regularly based on a second preset time and saving it in a memory; When it is detected that the modification time of the target configuration file is changed, the target configuration file stored in the memory is reloaded.
3. The method according to claim 2, characterized in that After the dynamic plug-in in the target configuration file is loaded, the method further includes: In the case where the target configuration file is reloaded, determining a modification type of the target configuration file; When the modification type is a first modification type, loading a first dynamic plug-in; In case the modification type is the second modification type, the second dynamic plug-in is deleted.
4. The method according to claim 1, characterized in that: The method further comprises: In response to the file rollback operation of the user, the configuration version of the target configuration file is rolled back to obtain a target configuration file of a historical configuration version.
5. The method according to claim 1, characterized in that The method further comprises: In response to the user's file configuration operation, the target configuration files are grouped and inherited to obtain a new target configuration file.
6. The method according to claim 1, characterized in that The step of executing the dynamic plug-in regularly based on the first preset time to obtain target resource information includes: Determining corresponding target hardware based on the dynamic plug-in; The dynamic plug-in is periodically executed based on the first preset time, so that the dynamic plug-in obtains the target resource information corresponding to the target hardware.
7. The method according to claim 1, characterized in that The method further comprises: Based on the preset plug-in rules, a security review is performed on the dynamic plug-in to determine the plug-in type of the dynamic plug-in; When the plug-in type is a preset type, the dynamic plug-in is deleted.
8. A dynamic plug-in resource reporting device, characterized in that: include: A first loading module, used to load a dynamic plug-in in a target configuration file; A plug-in execution module, used to execute the dynamic plug-in regularly based on a first preset time to obtain target resource information; The resource reporting module is used to report the target resource information to the central database.
9. A dynamic plug-in resource reporting device, characterized in that: include: processor; A memory for storing executable instructions; The processor is used to read the executable instructions from the memory and execute the executable instructions to implement the dynamic plug-in resource reporting method according to any one of claims 1 to 7.
10. A non-volatile computer-readable storage medium, characterized in that: The storage medium stores a computer program. When the computer program is executed by the processor, the processor implements the dynamic plug-in resource reporting method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Network data obtaining method, device and system
CN105847446A
Data monitoring method, device, electronic equipment and storage medium
CN112667474A
Loading control method and device
CN113064669A
Security protection method, device and equipment of intelligent gateway
CN114363083A
Plug-in resource loading method and device and electronic equipment
CN114764351A