MongoDB-based information technology asset management method, apparatus and device, and medium
By adopting MongoDB database in the IT asset management system and using work order approval requests to determine the inbound mode and data model, the problems of inflexible and insufficient scalability of data storage in the existing IT asset management methods are solved, and flexible storage and efficient management of IT asset data are achieved.
Patent Information
- Application Number
- CN202510518976.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-24
- Publication Date
- 2025-07-25
AI Technical Summary
The existing IT asset management methods rely on relational databases, which are difficult to meet the flexible and changeable data storage needs, and are not scalable when processing large amounts of data, which cannot meet the growing IT asset management needs.
MongoDB is used as a non-relational database, and the database entry mode is determined through work order approval requests. MongoDB data model is used for data analysis and verification, ensuring the legality and integrity of the data, and storing data in the MongoDB database, regularly checking database exceptions, and supporting multiple query methods and data synchronization.
It realizes flexible storage of various types of IT asset data, meets the diversity needs of asset types, has good scalability, can scale horizontally and vertically according to the growth of asset quantity, and optimizes information technology asset management methods to meet the growing data processing needs.
Smart Images

Figure CN120371924A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of asset management, and particularly to an information technology asset management method, device, equipment and medium based on MongoDB. Background Art
[0002] With the rapid development of information technology, the management requirements for IT (i.e., Information Technology) assets of organizations such as enterprises, government agencies, and educational institutions are increasing day by day. As an important support for organizational operations, the management of IT assets involves multiple links. Existing IT asset management methods often rely on relational databases for management. However, since the table structure of relational databases needs to be determined at the time of design and the data storage structure is fixed, it is difficult to meet the flexible and changeable data storage requirements. At the same time, with the expansion of the organization's scale and the increase in the number of IT assets, traditional IT asset management systems often show insufficient scalability when dealing with large amounts of data, and the system performance cannot meet the growing data processing requirements, restricting the application scope of the system. That is to say, the current IT asset management methods cannot meet the growing IT asset management requirements.
[0003] In summary, it can be seen that how to optimize the information technology asset management method to meet the growing IT asset management requirements is an urgent problem to be solved at present. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to provide an information technology asset management method, device, equipment and medium based on MongoDB, which can optimize the information technology asset management method to meet the growing IT asset management requirements. The specific solutions are as follows:
[0005] In a first aspect, the present application provides an information technology asset management method based on MongoDB, which is applied to an information technology asset management system and includes:
[0006] After receiving a first work order approval request for a resource application, feedback the first work order approval request at the front end of the information technology asset management system, so as to receive an approval feedback for the first work order approval request through the front end;
[0007] If the approval feedback indicates that the approval of the current first work order approval request is passed, use the first work order approval request to determine the corresponding warehousing mode, obtain the corresponding instance data based on the warehousing mode and the preset MongoDB data model, and determine whether the instance data is the target data allowed to be warehoused;
[0008] If the instance data is the target data allowed to be stored in the warehouse, import the target data into the MongoDB database according to the MongoDB data model, and synchronize the work order status corresponding to the first work order approval request, so as to regularly check whether the MongoDB database is abnormal according to the work order status.
[0009] Optionally, obtaining the corresponding instance data based on the warehousing mode and the preset MongoDB data model includes:
[0010] If the warehousing mode is the mode based on calling a preset interface, extract the data to be stored in the warehouse in the first work order approval request, and determine the instance attributes in the preset MongoDB data model;
[0011] Parse the data to be stored in the warehouse, and verify the integrity and legality of the parsed data according to the MongoDB data model;
[0012] If the integrity and legality of the parsed data pass the verification, map the parsed data to the instance attributes to assemble an instance data object, and determine the instance data object as the corresponding instance data.
[0013] Optionally, obtaining the corresponding instance data based on the warehousing mode and the preset MongoDB data model includes:
[0014] If the warehousing mode is the mode based on importing in the format of a preset spreadsheet, determine the corresponding file to be stored in the warehouse according to the first work order approval request; the file to be stored in the warehouse is a file in the format of the preset spreadsheet;
[0015] Determine the data column names and order defined in the predefined spreadsheet template, and create a corresponding instance data object according to the preset MongoDB data model;
[0016] Parse the data in the file to be stored in the warehouse row by row according to the data column names and order, and map the obtained parsed data to the instance attributes of the instance data object to obtain the corresponding instance data.
[0017] Optionally, determining whether the instance data is the target data allowed to be stored in the warehouse includes:
[0018] Verify the attributes of the instance data according to the preset custom verification rules to obtain the corresponding verification result;
[0019] If the verification result indicates that the verification of the instance data fails, feedback the verification result to the front end;
[0020] If the verification result indicates that the verification of the instance data passes, then match a preset custom review rule with the instance data to obtain a corresponding matching result;
[0021] If the matching result indicates that the instance data matches the custom review rule, then save the instance data to a preset to-be-reviewed library, and feedback the instance data to the front end, so that after receiving the feedback indicating review approval, remove the instance data from the to-be-reviewed library, and determine the instance data as target data allowed to be stored in the library.
[0022] Optionally, after importing the target data into the MongoDB database according to the MongoDB data model and synchronizing the work order status corresponding to the first work order approval request, so as to regularly check whether the MongoDB database is abnormal according to the work order status, further include:
[0023] Create corresponding indexes for target fields in the MongoDB database based on a preset index policy, and manage the indexes according to the status of the target fields, so that after receiving a data retrieval instruction initiated according to the index, determine a corresponding query method according to the data retrieval instruction, and determine target query data from the MongoDB database according to the query method, and feedback the target query data to the front end.
[0024] Optionally, the information technology asset management method based on MongoDB further includes:
[0025] Automatically collect information technology asset information using a collection script based on a preset collection period, and use the collected information technology asset information as a data baseline, and record the collection timestamp of the data baseline;
[0026] Store the data baseline and the collection timestamp in a target collection in the MongoDB database, so that after receiving a data baseline query instruction, query a target data baseline corresponding to the collection timestamp from the target collection according to the collection timestamp, or determine a corresponding number of to-be-compared data baselines from the target collection based on a received data comparison instruction, and generate a corresponding difference report through the result of comparing the several to-be-compared data baselines.
[0027] Optionally, the information technology asset management method based on MongoDB further includes:
[0028] After receiving a second work order approval request for resource change, feedback the second work order approval request to the front end, so that after receiving an approval feedback indicating that the second work order approval request is approved through the front end, change the data to be changed in the MongoDB database through an automated change script, and synchronize the work order status corresponding to the second work order approval request;
[0029] Or, after receiving a third work order approval request for resource recovery, feedback the third work order approval request to the front end, so that after receiving an approval feedback indicating that the third work order approval request is approved through the front end, delete the data to be recovered in the MongoDB database through an automated recovery script, and synchronize the work order status corresponding to the third work order approval request.
[0030] In a second aspect, the present application provides an information technology asset management device based on MongoDB, which is applied to an information technology asset management system, and includes:
[0031] A request feedback module, configured to, after receiving a first work order approval request for resource application, feedback the first work order approval request at the front end of the information technology asset management system, so as to receive an approval feedback for the first work order approval request through the front end;
[0032] A data determination module, configured to, if the approval feedback indicates that the current first work order approval request is approved, use the first work order approval request to determine a corresponding warehousing mode, obtain corresponding instance data based on the warehousing mode and a preset MongoDB data model, and determine whether the instance data is target data allowed to be warehoused;
[0033] A status synchronization module, configured to, if the instance data is target data allowed to be warehoused, import the target data into the MongoDB database according to the MongoDB data model, and synchronize the work order status corresponding to the first work order approval request, so as to regularly check whether the MongoDB database is abnormal according to the work order status.
[0034] In a third aspect, the present application provides an electronic device, including:
[0035] A memory, configured to store a computer program;
[0036] A processor, configured to execute the computer program to implement the foregoing information technology asset management method based on MongoDB.
[0037] Fourthly, the present application provides a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the foregoing information technology asset management method based on MongoDB is implemented.
[0038] In this embodiment, after receiving the first work order approval request for a resource application, the first work order approval request is fed back at the front end of the information technology asset management system, so as to receive an approval feedback for the first work order approval request through the front end; if the approval feedback indicates that the current first work order approval request is approved, the corresponding warehousing mode is determined by using the first work order approval request, and corresponding instance data is obtained based on the warehousing mode and a preset MongoDB data model, and it is determined whether the instance data is target data allowed to be warehoused; if the instance data is target data allowed to be warehoused, the target data is imported into the MongoDB database according to the MongoDB data model, and the work order status corresponding to the first work order approval request is synchronized, so as to regularly check whether the MongoDB database is abnormal according to the work order status. As can be seen from the above, after receiving the first work order approval request for a resource application in the present application, the first work order approval request is fed back to the front end of the information technology asset management system, so as to receive an approval feedback for the first work order approval request through the front end. If the approval feedback indicates that the current first work order approval request is approved, the corresponding warehousing mode is determined by using the first work order approval request, and instance data is obtained by using the warehousing mode and a preset MongoDB data model, and it is determined whether the instance data is target data allowed to be warehoused. If so, the target data is imported into the MongoDB database according to the MongoDB data model, and the work order status corresponding to the first work order approval request is synchronized, so as to regularly check whether the MongoDB database is abnormal according to the work order status. In this way, through the above process of the present application, by using the non-relational database MongoDB as the data storage medium, various types of IT asset data can be stored flexibly, meeting the diversity requirements of asset types. At the same time, since MongoDB has good scalability, it can be horizontally and vertically expanded according to the growth of the asset quantity to meet the increasing data processing requirements. When asset data needs to be entered, the request is first approved, and the instance data to be entered is judged to improve the flexibility of data warehousing, and further optimize the information technology asset management method to meet the increasing IT asset management requirements. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the accompanying drawings required for the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only the embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on the provided drawings.
[0040] Figure 1 Flowchart of an information technology asset management method based on MongoDB disclosed in this application;
[0041] Figure 2 Schematic diagram of the overall architecture of an information technology asset management system disclosed in this application;
[0042] Figure 3 Schematic diagram of the framework process of an information technology asset management system disclosed in this application;
[0043] Figure 4 Schematic diagram of the structure of an information technology asset management device based on MongoDB disclosed in this application;
[0044] Figure 5 Schematic diagram of the structure of an electronic device disclosed in this application. Specific embodiments
[0045] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.
[0046] Existing IT asset management methods often rely on relational databases for management. However, since the table structure of the relational database needs to be determined during design, the data storage structure is fixed and it is difficult to meet the flexible and changeable data storage requirements. At the same time, with the expansion of the organization scale and the increase in the number of IT assets, traditional IT asset management systems often show insufficient scalability when dealing with a large amount of data, and the system performance cannot meet the growing data processing requirements, restricting the application scope of the system. That is, the current IT asset management methods cannot meet the growing IT asset management requirements.
[0047] To overcome the above technical problems, this application provides an information technology asset management method based on MongoDB, which can optimize the information technology asset management method to meet the growing IT asset management requirements.
[0048] See Figure 1As shown below, an embodiment of the present invention discloses an information technology asset management method based on MongoDB, which is applied to an information technology asset management system and includes:
[0049] Step S11: After receiving a first work order approval request for a resource application, feedback the first work order approval request at the front end of the information technology asset management system, so as to receive an approval feedback for the first work order approval request through the front end.
[0050] In this embodiment, after the information technology (i.e., Information Technology, IT) asset management system receives a first work order approval request for a resource application, the first work order approval request is fed back to the front end of the information technology asset management system, so that relevant approval responsible persons can review the first work order approval request and give feedback through the front end. Furthermore, the information technology asset management system can receive the approval feedback from the relevant approval responsible persons for the first work order approval request through the front end. That is, in order to ensure the compliance and accuracy of the resource information stored in the warehouse, this embodiment can approve the operation after receiving a resource application to determine whether to allow it to be stored in the warehouse.
[0051] It can be understood that, as Figure 2 shown is a schematic diagram of the overall architecture of an information technology asset management system provided by this application. Among them, the information technology asset management system includes a work order system and a model warehouse, that is, a MongoDB (a distributed document storage database) database. The work order approval request is managed by the work order system integrated into the information technology asset management system. In addition to the resource application, the work order types in the work order system also include resource change and resource recovery. This embodiment can set corresponding fields for each work order type, such as resource type, configuration information, applicant, etc. At the same time, when establishing the work order system, clarify the design of each work order approval process, including links such as submission, approval, execution, and review, and determine the approval authority and responsible persons for each link, that is, relevant approval responsible persons. Specifically, this embodiment can control the query and operation of data by users by defining partitions, authorizing partitions to users, and dividing them into manual association instance data and automatic association instance data.
[0052] It should be noted that, in order to support work order status synchronization and data transmission, this embodiment can provide an integration interface between the work order system and the MongoDB database, and configure an automated workflow in the work order system to automatically trigger the API (i.e., Application Programming Interface) of the MongoDB database operation after the work order is approved, and then use XxlJob (an open-source distributed task scheduling platform) to automatically execute subsequent operations through the API. As Figure 3 shown is a schematic diagram of the framework process of an information technology asset management system provided by the present application. Among them, after the approval of the first work order approval request for the resource application, the corresponding data is stored in the data warehouse, that is, the MongoDB database, through the API. At the same time, due to the different docking methods of each platform, data is collected through methods such as docking with the SDK (i.e., Software Development Kit), API, SNMP (i.e., Simple Network Management Protocol), and SSH (i.e., Secure Shell). The data transmission between the collection tool and the MongoDB database is realized through the preset interface, and the data in the database is updated in real time. At the same time, OAuth (an open standard protocol) is used for authentication to ensure the security of the interface. In addition, this embodiment can also continuously monitor the execution status of the collection task to send an alarm notification in a timely manner when an abnormality occurs. Specifically, in this embodiment, the user fills in a resource application work order, which includes detailed information about the required resources. After the user submits it, a corresponding first work order approval request is initiated to the information technology asset management system according to the resource application work order. The information technology asset management system feeds back the received first work order approval request to its front end, so that the relevant approval responsible person can approve according to the work order content in the first work order approval request. If the approval is passed, the work order system automatically enters the corresponding resource information into the MongoDB database through the integration interface to generate corresponding resource records.
[0053] It should be noted that, in order to automatically execute corresponding operations after the approval is passed, corresponding automation scripts can be developed in this embodiment, such as automation warehousing scripts, automation recycling scripts, automation change scripts, etc., to implement operations such as data warehousing, recycling, and change. Among them, the automation script can include error handling and logging functions, so that when an exception occurs during the execution of the automation script, the error handling function can be used to restore the automation script to normal, and it is convenient for relevant personnel to use the logging function for auditing and tracing. In this way, after receiving the first work order approval request for resource application, this embodiment approves the first work order approval request through the front end to determine whether it allows warehousing, which can ensure the compliance and accuracy of the warehoused resource information; provide an integration interface between the work order system and the MongoDB database to ensure the accuracy and timeliness of work order status synchronization and data transfer through the integration interface.
[0054] Step S12: If the approval feedback indicates that the current first work order approval request is approved, use the first work order approval request to determine the corresponding warehousing mode, obtain the corresponding instance data based on the warehousing mode and the preset MongoDB data model, and determine whether the instance data is the target data allowed to be warehoused.
[0055] In this embodiment, if the obtained approval feedback indicates that the current first work order approval request is approved, it means that the resource information corresponding to the first work order approval request is allowed to be warehoused. Therefore, the corresponding warehousing mode can be determined using the first work order approval request, and the data parser corresponding to the warehousing mode and the preset MongoDB data model can be parsed into standard pre-warehousing data, and then the corresponding instance data can be obtained, and it can be determined whether the instance data is the target data allowed to be warehoused. Among them, the warehousing mode includes a mode based on calling a preset interface and a mode based on importing in the format of a preset spreadsheet; the preset spreadsheet can be excel (a format of a spreadsheet).
[0056] It can be understood that in this embodiment, the MongoDB data model can be flexibly constructed by utilizing the multi-modal characteristics of MongoDB. Among them, the constituent elements of the MongoDB data model include, but are not limited to, classification, name, icon, CODE (the unique identifier of the model), attribute, unique constraint, relationship, etc.; the type design of the attributes includes, but is not limited to, single-line text, multi-line text, multi-select button, single-select button, drop-down single-select, drop-down multi-select, numeric type, date type, file type, boolean type, personnel type, reference type, auto-calculated attribute type, auto-assembled type, grouped type; the data permission design of the attributes can be controlled by adding visible or invisible roles in groups, so as to restrict the input, output, and display of data by determining the role to which the user belongs; the design of the relationship can define the display dictionaries of positive and negative relationships, and the models can be arbitrarily associated, supporting four modes: one-to-many, one-to-one, many-to-many, and many-to-one; the unique constraint can be achieved by setting the combined uniqueness of the attribute list or setting the uniqueness of a single attribute. In addition, this embodiment can also configure the functions of logging and auditing in the MongoDB data model, record the operations of the model in the full-scale log for auditing operations.
[0057] It should be noted that based on the ORM (i.e., Object Relational Mapping) concept, a single piece of data needs to be organized into a data object for the warehousing operation. Among them, the operation of organizing a single piece of data into a data object, that is, the instantiation construction operation, is carried out according to the warehousing mode. For example, the CODE of the dictionary can be converted into the database object of the dictionary, and the ID (i.e., Identity Document, identity identification number) of the reference can be converted into the actual data object of the reference, etc., to prepare for warehousing. Since the warehousing mode includes two modes, there are two processing flows for obtaining the corresponding instance data based on the warehousing mode and the preset MongoDB data model.
[0058] In a specific implementation, if the warehousing mode is a mode based on calling a preset interface, the data to be warehoused in the first work order approval request is extracted, and the instance attributes in the preset MongoDB data model are determined; the data to be warehoused is parsed, and the integrity and legality of the obtained parsed data are verified according to the MongoDB data model; if the integrity and legality of the parsed data pass the verification, the parsed data is mapped to the instance attributes to assemble an instance data object, and the instance data object is determined as the corresponding instance data. That is, if the first work order approval request is initiated by the user in the way of directly creating an instance, it is determined that the warehousing mode is a mode based on calling a preset interface, the data to be warehoused in the first work order approval request is extracted, that is, the JSON (a lightweight text data exchange format) request data submitted by the user, and the instance attributes in the preset MongoDB data model are determined, the data to be warehoused is parsed, and the integrity and legality of the obtained parsed data are verified according to the MongoDB data model. If the parsed data passes the verification, the parsed data is mapped to the instance attributes to assemble an instance data object, and the instance data object is determined as the corresponding instance data.
[0059] In another specific implementation, if the warehousing mode is a mode based on importing in the format of a preset spreadsheet, the corresponding file to be warehoused is determined according to the first work order approval request; the file to be warehoused is a file in the format of the preset spreadsheet; the data column names and orders defined in the predefined spreadsheet template are determined, and a corresponding instance data object is created according to the preset MongoDB data model; the data in the file to be warehoused is parsed row by row according to the data column names and orders, and the obtained parsed data is mapped to the instance attributes of the instance data object to obtain the corresponding instance data. That is, if the first work order approval request is initiated by the user in the way of batch importing instances through excel, it is determined that the warehousing mode is a mode based on importing in the format of a preset spreadsheet, and the corresponding file to be warehoused, as well as the data column names and orders defined in the predefined spreadsheet template, are determined according to the first work order approval request, and a corresponding instance data object is created according to the preset MongoDB data model. Asynchronously, the data in the file to be warehoused is parsed row by row according to the data column names and orders, and the obtained parsed data is mapped to the instance attributes of the instance data object to obtain the corresponding instance data.
[0060] Correspondingly, in addition to adapting to two storage modes, this embodiment also adapts to two outbound modes, including the mode based on calling the preset interface and the mode based on the format output of the preset spreadsheet, corresponding to different outputters respectively to organize the data to be output. Specifically, for the mode based on the format output of the preset spreadsheet, if the format of the spreadsheet is excel, after receiving the data export instruction, the excel template filling technology can be adopted. First, generate the corresponding excel template through the MongoDB data model, then convert the object data to be exported into a single-line text and fill it into the excel template, and finally write the files included in the file type defined in the model attributes into excel for output to the user, adapting to synchronous output and asynchronous download.
[0061] It should be further pointed out that the processing flow for determining whether the instance data is the target data allowed to be stored in the library is as follows: verify the attributes of the instance data according to the preset custom verification rules to obtain the corresponding verification result; if the verification result indicates that the verification of the instance data fails, feedback the verification result to the front end; if the verification result indicates that the verification of the instance data passes, match the preset custom review rules with the instance data to obtain the corresponding matching result; if the matching result indicates that the instance data matches the custom review rules, save the instance data to the preset pending review library and feedback the instance data to the front end, so that after receiving the feedback indicating approval, remove the instance data from the pending review library and determine the instance data as the target data allowed to be stored in the library. Among them, the custom verification rules are the rules built in the MongoDB data model for performing overall and full-field verification on the instance attributes; the verification result includes the reason for verification failure and the content of the verification that fails. That is to say, determining whether the instance data is the target data allowed to be stored in the library includes two steps: verification and review. First, perform unique full-volume verification on the attributes of the instance data according to the preset custom verification rules. If the obtained verification result indicates that the verification of the instance data fails, return the verification result to the front end. If the verification result indicates that the verification passes, it is necessary to further determine whether the instance data needs to be reviewed and stored. That is, match the preset custom review rules with the instance data. If the match is successful, first save the instance data to the preset pending review library as temporary data and feedback it to the front end for the approver to approve. If a feedback indicating approval is received, remove the instance data from the pending review library and determine it as the target data allowed to be stored in the library. If a feedback indicating disapproval is received, reject the modification.
[0062] It should be noted that, in order to ensure the smooth storage of data, in this embodiment, before storing the data into the database, preprocessing operations can be performed on the data. For example, the data can be cleaned to remove invalid, incorrect, and duplicate data, and the data can also be converted into a format that can be recognized by the MongoDB database, etc., to ensure the quality of the stored data. In this way, in this embodiment, the MongoDB data model is flexibly constructed using the multi-modal characteristics of MongoDB to store data flexibly according to the data model; before storing the data into the database, the data is instantiated and constructed using the storage mode to convert the data into a format adapted to the database for easy storage; at the same time, the data is verified, audited, and preprocessed according to custom rules to ensure the quality of the data and the accuracy of asset management; user permission management and system log management functions are provided to ensure that only authorized users can access and operate asset data, and at the same time, all user operation behaviors are recorded, providing guarantee for data security.
[0063] Step S13: If the instance data is the target data allowed to be stored in the database, import the target data into the MongoDB database according to the MongoDB data model, and synchronize the work order status corresponding to the first work order approval request, so as to regularly check whether the MongoDB database is abnormal according to the work order status.
[0064] In this embodiment, if it is determined that the instance data is the target data allowed to be stored in the database, import the target data into the MongoDB database according to the MongoDB data model, and synchronize the work order status corresponding to the first work order approval request, that is, mark its status as "in use", so as to regularly check whether the MongoDB database is abnormal according to the work order status. It can be understood that, in order to be able to detect the abnormal situation of the MongoDB database in time to avoid system errors, in this embodiment, a scheduled task can be configured to monitor the operations of the work order and the MongoDB database in real time, regularly check the consistency between the work order status and the data in the MongoDB database, and if an abnormality is found, send an alarm notification to relevant personnel. At the same time, an audit log can be configured to record all work order operations and data changes in the MongoDB database, so as to perform audits regularly based on the audit log, thereby ensuring the compliance of the process and the accuracy of the data.
[0065] It should be noted that a unified query language is also defined in the MongoDB data model of this embodiment. It can organize query statements by adapting and parsing query parameters to perform MongoDB query operations. The processing flow is as follows: Create corresponding indexes for target fields in the MongoDB database based on a preset index strategy, and manage the indexes according to the status of the target fields. So that after receiving a data retrieval instruction initiated according to the index, determine the corresponding query method according to the data retrieval instruction, and determine target query data from the MongoDB database according to the query method, and feedback the target query data to the front end. Among them, the target fields can be common query fields, such as asset ID, name, type, etc.; the query methods include basic query method, fuzzy query method, range query method, multi-condition combination query method, paging query method; the basic query method refers to the method of performing exact match queries through keywords such as asset ID and name; the fuzzy query method refers to the method of using the regular expression function of MongoDB to achieve fuzzy matching; the range query method refers to the method of performing range filtering according to fields such as date and value; the multi-condition combination query method refers to the method of combining multiple query conditions through logical operators, such as AND (and), OR (or), etc.; the paging query method refers to the method of realizing paged display of data through the limit (a method for realizing paging function) and skip (a method for realizing paging function) methods. That is, determine a reasonable preset index strategy to optimize query performance, create corresponding indexes for target fields in the MongoDB database based on the index strategy, and dynamically manage the indexes according to the status of the target fields, including index creation, deletion, and optimization. So that after receiving a data retrieval instruction initiated according to the index, determine the corresponding query method, and determine target query data from the MongoDB database according to the query method, and feedback it to the front end. It can be understood that this embodiment can design corresponding API interfaces for the front end or other systems to call for data retrieval, and can support various query parameters, including required parameters and optional parameters. In addition, this embodiment can introduce a query cache mechanism to cache the results of frequent queries to reduce latency, improve query performance, reduce database load. At the same time, the projection function can be used to only return necessary fields, reduce data transmission volume, and use index covering queries to reduce disk I / O operations and improve query efficiency.
[0066] It should be further noted that for the MongoDB-based information technology asset management method of this application, it is also necessary to regularly save data baselines for backup. The processing flow is as follows: Based on a preset collection period, use a collection script to automatically collect information technology asset information, and use the collected information technology asset information as a data baseline, and record the collection timestamp of the data baseline; Store the data baseline and the collection timestamp in a target collection in the MongoDB database, so that after receiving a data baseline query instruction, query the target data baseline corresponding to the collection timestamp from the target collection according to the collection timestamp, or, based on the received data comparison instruction, determine a corresponding number of data baselines to be compared from the target collection, and generate a corresponding difference report through the result obtained by comparing the several data baselines to be compared. Among them, the data baseline includes hardware asset information, software asset information, and configuration item information; the hardware asset information includes but is not limited to servers, network devices, storage devices, etc.; the software asset information includes but is not limited to operating systems, application programs, databases, etc.; the configuration item information includes but is not limited to network configurations, security policies, etc.; the target collection is an independent collection created for the data baseline, which is convenient for management and query; the difference report includes but is not limited to information such as newly added assets, changed assets, and retired assets. That is, according to a preset collection period, such as daily, weekly, or monthly, use a collection script to automatically collect information technology asset information, and use the collected information technology asset information as a data baseline, record the collection timestamp of the data baseline, and store the data baseline and the collection timestamp in JSON format in a target collection in the MongoDB database to ensure the structuring and scalability of the data, form a baseline record, so that after receiving a data baseline query instruction through a preset data query interface, query the data baseline at a specific time point from the target collection according to the collection timestamp, and after receiving a data comparison instruction, determine a corresponding number of data baselines to be compared according to the data comparison instruction, and compare them to generate a corresponding difference report.
[0067] Further, to facilitate the management and maintenance of the data baseline, in this embodiment, a version number can be created for each data baseline for easy tracking and management. Meanwhile, the change history of the data baseline is recorded, including the change time, change content, and change operator, so as to allow users to roll back to a specified historical baseline version. At the same time, this embodiment can regularly maintain the data baseline to ensure the accuracy and integrity of the data, and update the data baseline in a timely manner when major changes occur to IT assets to reflect the latest asset status. In addition, to ensure the security of the data baseline, this embodiment can set permission control for data baseline management to ensure that only authorized users can access and operate the baseline data. Meanwhile, data encryption storage is implemented to protect sensitive information from unauthorized access, and all data baseline operation logs are recorded for auditing and traceability.
[0068] It should be noted that since the work order types in the work order system include, in addition to the resource application, two types: resource change and resource recovery. After receiving the corresponding work order approval request, the corresponding processing flow of the information technology asset management system is as follows: When receiving the second work order approval request for resource change, the second work order approval request is fed back to the front end, so that after receiving the approval feedback indicating that the second work order approval request is approved through the front end, the data to be changed in the MongoDB database is changed through an automated change script, and the work order status corresponding to the second work order approval request is synchronized; or, when receiving the third work order approval request for resource recovery, the third work order approval request is fed back to the front end, so that after receiving the approval feedback indicating that the third work order approval request is approved through the front end, the data to be recovered in the MongoDB database is deleted through an automated recovery script, and the work order status corresponding to the third work order approval request is synchronized. That is to say, the user fills in a resource change work order, describes the change content and reasons and submits it to initiate the second work order approval request for the corresponding resource change to the information technology asset management system. After receiving the second work order approval request, the information technology asset management system feeds it back to the front end for relevant approval responsible persons to approve. After receiving the corresponding approval feedback through the front end, if the approval feedback indicates approval, then through the integration interface, the data to be changed in the MongoDB database is automatically changed using an automated change script, and the work order status corresponding to the second work order approval request is synchronized. That is to say, the status of the resource record corresponding to the data to be changed is marked as "changing", and updated to "in use" after the change is completed; similarly, the user fills in a resource recovery work order, specifies the resources to be recovered, to initiate the third work order approval request for the corresponding resource recovery to the information technology asset management system. After receiving the third work order approval request, the information technology asset management system feeds it back to the front end for relevant approval responsible persons to approve. After receiving the corresponding approval feedback through the front end, if the approval feedback indicates approval, then through the integration interface, the data to be recovered in the MongoDB database is automatically deleted using an automated recovery script, and the work order status corresponding to the third work order approval request is synchronized. That is to say, the status of the resource record corresponding to the data to be recovered is updated to "recovered".In this way, according to the MongoDB data model, the target data is imported into the MongoDB database in this embodiment. By using the document-based storage structure of MongoDB, various types of IT asset information can be stored flexibly without the need to pre-define a fixed data table structure, thus adapting to the diversity of IT asset types and attributes; the work order status corresponding to the work order approval request is synchronized in a timely manner, and the consistency between the work order status and the data is checked regularly to ensure data synchronization; by using the high-performance indexing and aggregation query functions of MongoDB, rapid retrieval and analysis of IT asset information are realized, greatly improving the query efficiency and meeting the organization's requirements for real-time monitoring and rapid response of IT assets.
[0069] As can be seen from the above, after receiving the first work order approval request for resource application in the embodiment of the present application, the first work order approval request is fed back to the front end of the information technology asset management system, so that the approval feedback for the first work order approval request can be received through the front end. If the approval feedback indicates that the current first work order approval request is approved, the corresponding warehousing mode is determined through the first work order approval request, and instance data is obtained by using the warehousing mode and the preset MongoDB data model. It is determined whether the instance data is the target data allowed to be warehoused. If so, the target data is imported into the MongoDB database according to the MongoDB data model, and the work order status corresponding to the first work order approval request is synchronized, so as to regularly check whether the MongoDB database is abnormal according to the work order status. In this way, through the above process of the embodiment of the present application, on the one hand, after receiving the first work order approval request for resource application, the first work order approval request is approved through the front end to determine whether it is allowed to be warehoused, which can ensure the compliance and accuracy of the warehoused resource information; on the one hand, an integration interface is provided between the work order system and the MongoDB database to ensure the accuracy and timeliness of work order status synchronization and data transmission through the integration interface; on the one hand, the MongoDB data model is flexibly constructed by using the multi-mode characteristics of MongoDB to flexibly store data according to the data model; on the one hand, before storing the data in the database, the data is instantiated and constructed by using the warehousing mode to convert the data into a format adapted to the database for easy storage; at the same time, the data is verified, audited and preprocessed according to custom rules to ensure the quality of the data and the accuracy of asset management; on the one hand, user permission management and system log management functions are provided to ensure that only authorized users can access and operate asset data, and at the same time record the operation behaviors of all users, providing guarantee for data security; on the one hand, the target data is imported into the MongoDB database according to the MongoDB data model, and the document-based storage structure of MongoDB can flexibly store various IT asset information without pre-defining a fixed data table structure, thus adapting to the diversity of IT asset types and attributes; on the one hand, the work order status corresponding to the work order approval request is synchronized in time, and the consistency between the work order status and the data is regularly checked to ensure data synchronization; on the one hand, the high-performance index and aggregation query functions of MongoDB are used to realize the rapid retrieval and analysis of IT asset information, greatly improving the query efficiency and meeting the organization's requirements for real-time monitoring and rapid response of IT assets; on the other hand, because MongoDB has good scalability, it can be horizontally and vertically extended according to the growth of asset quantity to meet the growing data processing requirements, and then optimize the information technology asset management method to meet the growing IT asset management requirements.
[0070] Correspondingly, refer to Figure 4 As shown, an information technology asset management device based on MongoDB is further provided in an embodiment of the present application, which is applied to an information technology asset management system and includes:
[0071] A request feedback module 11, configured to, when receiving a first work order approval request for a resource application, feedback the first work order approval request at the front end of the information technology asset management system, so as to receive an approval feedback for the first work order approval request through the front end;
[0072] A data determination module 12, configured to, if the approval feedback indicates that the current first work order approval request is approved, use the first work order approval request to determine a corresponding warehousing mode, obtain corresponding instance data based on the warehousing mode and a preset MongoDB data model, and determine whether the instance data is target data allowed to be warehoused;
[0073] A status synchronization module 13, configured to, if the instance data is target data allowed to be warehoused, import the target data into the MongoDB database according to the MongoDB data model, and synchronize the work order status corresponding to the first work order approval request, so as to regularly check whether the MongoDB database is abnormal according to the work order status.
[0074] As can be seen from the above, after receiving the first work order approval request for a resource application in an embodiment of the present application, the first work order approval request is fed back to the front end of the information technology asset management system, so as to receive an approval feedback for the first work order approval request through the front end. If the approval feedback indicates that the current first work order approval request is approved, a corresponding warehousing mode is determined through the first work order approval request, instance data is obtained by using the warehousing mode and a preset MongoDB data model, and it is determined whether the instance data is target data allowed to be warehoused. If so, the target data is imported into the MongoDB database according to the MongoDB data model, and the work order status corresponding to the first work order approval request is synchronized, so as to regularly check whether the MongoDB database is abnormal according to the work order status. In this way, through the above process of the embodiment of the present application, using a non-relational database such as MongoDB as the data storage medium, various types of IT asset data can be stored flexibly, meeting the diversity requirements of asset types. At the same time, because MongoDB has good scalability, it can be horizontally and vertically extended according to the growth of the asset quantity to meet the increasing data processing requirements. When asset data needs to be entered, the request is first approved, and the instance data to be entered is judged to improve the flexibility of data warehousing, and then the information technology asset management method is optimized to meet the increasing IT asset management requirements.
[0075] In some specific embodiments, the data determination module 12 may specifically include:
[0076] An attribute determination unit, configured to extract the data to be warehoused in the first work order approval request and determine the instance attributes in the preset MongoDB data model if the warehousing mode is a mode based on calling a preset interface;
[0077] A data verification unit, configured to parse the data to be warehoused and verify the integrity and legality of the parsed data according to the MongoDB data model;
[0078] A data determination unit, configured to map the parsed data to the instance attributes to assemble an instance data object and determine the instance data object as the corresponding instance data if the integrity and legality of the parsed data pass the verification.
[0079] In some specific embodiments, the data determination module 12 may specifically include:
[0080] A file determination unit, configured to determine the corresponding file to be warehoused according to the first work order approval request if the warehousing mode is a mode of importing based on the format of a preset spreadsheet; the file to be warehoused is a file in the format of the preset spreadsheet;
[0081] An object creation unit, configured to determine the data column names and orders defined in a predefined spreadsheet template and create a corresponding instance data object according to the preset MongoDB data model;
[0082] A data mapping unit, configured to parse the data in the file to be warehoused row by row according to the data column names and orders and map the obtained parsed data to the instance attributes of the instance data object to obtain the corresponding instance data.
[0083] In some specific embodiments, the data determination module 12 may specifically include:
[0084] An attribute verification unit, configured to verify the attributes of the instance data according to a preset custom verification rule to obtain a corresponding verification result;
[0085] A result feedback unit, configured to feedback the verification result to the front end if the verification result indicates that the verification of the instance data fails;
[0086] A data matching unit, configured to match a preset custom review rule with the instance data to obtain a corresponding matching result if the verification result indicates that the verification of the instance data passes;
[0087] A data feedback unit, which is configured to save the instance data to a preset to-be-reviewed library and feedback the instance data to the front end if the matching result indicates that the instance data matches the custom review rule, so that after receiving a feedback indicating approval, the instance data is removed from the to-be-reviewed library, and the instance data is determined as target data allowed to be stored in the library.
[0088] In some specific embodiments, the MongoDB-based information technology asset management device may further include:
[0089] An index management unit, which is configured to create corresponding indexes for target fields in the MongoDB database based on a preset index policy, and manage the indexes according to the status of the target fields, so that after receiving a data retrieval instruction initiated based on the index, a corresponding query method is determined according to the data retrieval instruction, and target query data is determined from the MongoDB database according to the query method, and the target query data is fed back to the front end.
[0090] In some specific embodiments, the MongoDB-based information technology asset management device may further include:
[0091] A timestamp recording unit, which is configured to automatically collect information technology asset information based on a preset collection period by using a collection script, and use the collected information technology asset information as a data baseline, and record the collection timestamp of the data baseline;
[0092] A collection storage unit, which is configured to store the data baseline and the collection timestamp in a target collection in the MongoDB database, so that after receiving a data baseline query instruction, target data baseline corresponding to the collection timestamp is queried from the target collection according to the collection timestamp, or, a corresponding number of to-be-compared data baselines are determined from the target collection based on a received data comparison instruction, and a corresponding difference report is generated through the result of comparing the number of to-be-compared data baselines.
[0093] In some specific embodiments, the MongoDB-based information technology asset management device may further include:
[0094] A first request feedback unit, which is configured to feedback the second work order approval request to the front end when receiving a second work order approval request for resource change, so that after receiving an approval feedback indicating that the second work order approval request is approved through the front end, the to-be-changed data in the MongoDB database is changed through an automated change script, and the work order status corresponding to the second work order approval request is synchronized.
[0095] Or, a second request feedback unit, configured to, after receiving a third work order approval request for resource recovery, feedback the third work order approval request to the front end, so that after receiving, through the front end, an approval feedback indicating that the third work order approval request is approved, delete the data to be recovered in the MongoDB database through an automated recovery script, and synchronize the work order status corresponding to the third work order approval request.
[0096] Furthermore, an embodiment of the present application also discloses an electronic device. Figure 5 It is a structural diagram of an electronic device 20 shown according to an exemplary embodiment, and the content in the figure should not be considered as any limitation on the scope of use of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. Among them, the memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the information technology asset management method based on MongoDB disclosed in any of the foregoing embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0097] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows is any communication protocol applicable to the technical solution of the present application, and specific limitations are not imposed on it here; the input / output interface 25 is used to obtain external input data or output data to the outside, and its specific interface type can be selected according to specific application needs, and no specific limitations are made here.
[0098] In addition, as a carrier for resource storage, the memory 22 may be a read-only memory, a random access memory, a magnetic disk, or an optical disc, etc., and the resources stored thereon may include an operating system 221, a computer program 222, etc., and the storage method may be short-term storage or permanent storage.
[0099] Among them, the operating system 221 is used to manage and control each hardware device and the computer program 222 on the electronic device 20, and it may be Windows Server, Netware, Unix, Linux, etc. In addition to the computer program that can be used to complete the information technology asset management method based on MongoDB executed by the electronic device 20 disclosed in any of the foregoing embodiments, the computer program 222 may further include a computer program that can be used to complete other specific tasks.
[0100] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned information technology asset management method based on MongoDB. For the specific steps of this method, reference can be made to the corresponding content disclosed in the foregoing embodiments, and details will not be elaborated herein.
[0101] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the same or similar parts among the embodiments, reference can be made to each other. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple. For related parts, reference can be made to the description in the method section.
[0102] Those skilled in the art can further realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed in this article can be implemented by electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the composition and steps of the examples have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.
[0103] The steps of the method or algorithm described in combination with the embodiments disclosed in this article can be directly implemented by hardware, a software module executed by a processor, or a combination of both. The software module can be placed in a random access memory (RAM), memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM, or any other form of storage medium well-known in the technical field.
[0104] Finally, 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 actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the existence of additional identical elements in the process, method, article or device comprising the element.
[0105] The above has introduced the technical solution provided by this application in detail. Specific examples are used in this article to elaborate on the principle and implementation manner of this application. The description of the above embodiments is only used to help understand the method and its core idea of this application; at the same time, for those of ordinary skill in the art, according to the idea of this application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to this application.
Claims
1. An information technology asset management method based on MongoDB, characterized in that, Applied to an information technology asset management system, including: After receiving a first work order approval request for a resource application, feedback the first work order approval request at the front end of the information technology asset management system, so as to receive an approval feedback for the first work order approval request through the front end; If the approval feedback indicates that the approval of the current first work order approval request is passed, use the first work order approval request to determine the corresponding warehousing mode, and obtain the corresponding instance data based on the warehousing mode and a preset MongoDB data model, and determine whether the instance data is target data allowed to be warehoused; If the instance data is target data allowed to be warehoused, import the target data into the MongoDB database according to the MongoDB data model, and synchronize the work order status corresponding to the first work order approval request, so as to regularly check whether the MongoDB database is abnormal according to the work order status.
2. The information technology asset management method based on MongoDB according to claim 1, wherein, The obtaining the corresponding instance data based on the warehousing mode and a preset MongoDB data model includes: If the warehousing mode is a mode based on calling a preset interface, extract the data to be warehoused in the first work order approval request, and determine the instance attributes in the preset MongoDB data model; Parse the data to be warehoused, and verify the integrity and legality of the parsed data according to the MongoDB data model; If the integrity and legality of the parsed data pass the verification, map the parsed data to the instance attributes to assemble an instance data object, and determine the instance data object as the corresponding instance data.
3. The information technology asset management method based on MongoDB according to claim 1, characterized in that The obtaining the corresponding instance data based on the warehousing mode and a preset MongoDB data model includes: If the warehousing mode is a mode based on importing in the format of a preset spreadsheet, determine the corresponding file to be warehoused according to the first work order approval request; the file to be warehoused is a file in the format of the preset spreadsheet; Determine the data column names and orders defined in a predefined spreadsheet template, and create a corresponding instance data object according to the preset MongoDB data model; Parse the data in the file to be warehoused row by row according to the data column names and orders, and map the obtained parsed data to the instance attributes of the instance data object to obtain the corresponding instance data.
4. The information technology asset management method based on MongoDB according to claim 1, wherein The determining whether the instance data is target data allowed to be warehoused includes: Verify the attributes of the instance data according to a preset custom verification rule to obtain a corresponding verification result; If the verification result indicates that the verification of the instance data fails, feedback the verification result to the front end; If the verification result indicates that the verification of the instance data passes, match a preset custom approval rule with the instance data to obtain a corresponding matching result; If the matching result indicates that the instance data matches the custom audit rule, save the instance data to a preset to-be-audited library, and feedback the instance data to the front end, so that after receiving the feedback indicating audit approval, remove the instance data from the to-be-audited library and determine the instance data as the target data allowed to be stored in the library.
5. The information technology asset management method based on MongoDB according to claim 1, characterized in that After importing the target data into the MongoDB database according to the MongoDB data model and synchronizing the work order status corresponding to the first work order approval request, so as to regularly check whether the MongoDB database is abnormal according to the work order status, it further includes: Create corresponding indexes for the target fields in the MongoDB database based on a preset index policy, and manage the indexes according to the status of the target fields, so that after receiving a data retrieval instruction triggered by the index, determine the corresponding query method according to the data retrieval instruction, and determine target query data from the MongoDB database according to the query method, and feedback the target query data to the front end.
6. The information technology asset management method based on MongoDB according to claim 1, characterized in that It further includes: Based on a preset collection period, automatically collect information technology asset information using a collection script, and use the collected information technology asset information as a data baseline, and record the collection timestamp of the data baseline; Store the data baseline and the collection timestamp in a target collection in the MongoDB database, so that after receiving a data baseline query instruction, query the target data baseline corresponding to the collection timestamp from the target collection according to the collection timestamp, or, based on a received data comparison instruction, determine corresponding several to-be-compared data baselines from the target collection, and generate a corresponding difference report through the result of comparing the several to-be-compared data baselines.
7. The method for information technology asset management based on MongoDB according to any one of claims 1 to 6, characterized in that, It further includes: When receiving a second work order approval request for resource change, feedback the second work order approval request to the front end, so that after receiving, through the front end, an approval feedback indicating that the second work order approval request is approved, change the data to be changed in the MongoDB database through an automated change script, and synchronize the work order status corresponding to the second work order approval request; Or, when receiving a third work order approval request for resource recovery, feedback the third work order approval request to the front end, so that after receiving, through the front end, an approval feedback indicating that the third work order approval request is approved, delete the data to be recovered in the MongoDB database through an automated recovery script, and synchronize the work order status corresponding to the third work order approval request.
8. An information technology asset management device based on MongoDB, characterized in that, Applied to an information technology asset management system, it includes: A request feedback module, configured to, when receiving a first work order approval request for resource application, feedback the first work order approval request at the front end of the information technology asset management system, so as to receive, through the front end, an approval feedback for the first work order approval request; A data determination module, configured to, if the approval feedback indicates that the approval of the current first work order approval request is passed, use the first work order approval request to determine the corresponding warehousing mode, obtain the corresponding instance data based on the warehousing mode and a preset MongoDB data model, and determine whether the instance data is target data allowed to be warehoused; A status synchronization module, configured to, if the instance data is target data allowed to be warehoused, import the target data into a MongoDB database according to the MongoDB data model, and synchronize the work order status corresponding to the first work order approval request, so as to regularly check whether the MongoDB database is abnormal according to the work order status.
9. An electronic device, characterized in that, Comprising: A memory, configured to store a computer program; A processor, configured to execute the computer program to implement the MongoDB-based information technology asset management method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, For storing a computer program; wherein, when the computer program is executed by the processor, the MongoDB-based information technology asset management method according to any one of claims 1 to 7 is implemented.