Middleware management method, device, computing equipment and storage medium
Through the middleware management method executed in the computing device, parsing the configuration files in the project and retrieving middleware features, the problem of not being able to quickly and accurately understand the use of middleware in the project is solved, and information analysis efficiency and developer work efficiency are improved.
Patent Information
- Application Number
- CN202111197999.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-14
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2041-10-14
AI Technical Summary
When facing a large number of projects, it is impossible to quickly and accurately understand which projects use specific middleware, which makes it impossible to notify relevant business parties in a timely manner. After R&D personnel modify the middleware information, it is difficult for other relevant personnel to understand in a timely manner, which affects the correctness of the assessment.
Through the middleware management method executed in the computing device, the file category is determined based on the configuration file file name in the project, the corresponding parser is called to parse the configuration file, the configuration information is obtained, and the configuration information is retrieved according to the middleware feature set to determine the middleware used in the project.
It realizes the rapid and accurate acquisition of middleware information used in the project, improves the analysis efficiency of middleware-related information, and facilitates developers to grasp the middleware situation of the project in a timely manner.
Smart Images

Figure CN113918208B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of software development, and in particular to a middleware management method, device, computing equipment and storage medium. Background Art
[0002] With the continuous development of computer technology, more and more applications have been developed. Correspondingly, there are more and more middleware working between applications and operating systems. Middleware is an independent system software service program. Distributed application software uses this software to share resources between different technologies. Middleware is located on the operating system and manages computing resources and network communications. In the daily R&D process, when there is a plan to adjust or upgrade a certain middleware, facing hundreds of projects, the operation and maintenance personnel cannot know exactly which projects use this middleware, resulting in the inability to accurately notify all affected business parties. The team also cannot clearly understand the overall situation of the use of middleware in all projects. Sometimes a developer modifies the information of a certain middleware in the project, and other relevant personnel in the project may not be able to know the change information in time to evaluate the correctness of the change. How to timely and accurately grasp the middleware information used in each project is the key to solving the above problems.
[0003] In the prior art, developers use the query function to search for the existence of a certain middleware in the project based on the IP or domain name of a given middleware. However, this method is very time-consuming. When there are a large number of projects, it takes a lot of time and energy to open each project and search each project one by one, and it is easy to miss something. In the face of a large number of projects, it is impossible to accurately and quickly know the situation of calling the middleware, and it is impossible to grasp the middleware information in real time and perform relevant processing based on the middleware information.
[0004] Therefore, a new middleware management method and device are needed. Summary of the invention
[0005] To this end, the present invention provides a middleware management method to try to solve or at least alleviate the above problems.
[0006] According to one aspect of the present invention, there is provided a middleware management method, which is suitable for execution in a computing device so as to manage middleware associated with a project, wherein the project includes a plurality of configuration files, and the computing device also stores a set of middleware features, and the method includes the steps of: determining the file category of each configuration file according to the file name of the configuration file; calling a corresponding parser according to the file category of the configuration file to parse the configuration file to obtain configuration information of each configuration file; retrieving the configuration information of the configuration file according to each middleware feature in the middleware feature set to determine the middleware defined in each configuration file; and collecting the middleware defined in each configuration file in the project to obtain a set of middleware associated with the project.
[0007] Optionally, in the method according to the present invention, the file category includes an object model file, and the configuration file is parsed according to the file category of the configuration file to obtain the configuration information of each configuration file, including the following steps: if the file category of the configuration file is an object model file, calling the object model file parser to parse the object model file to obtain the file structure; and determining the configuration information of the configuration file according to the file structure.
[0008] Optionally, in the method according to the present invention, determining the configuration information of the configuration file according to the file architecture includes the steps of: determining one or more operating environments included in the configuration file according to the file architecture; and using the operating environments included in the configuration file and the configuration items under each operating environment as configuration information.
[0009] Optionally, in the method according to the present invention, the file category also includes a serialized format file, and the method also includes the steps of: if the configuration file is a serialized format file, calling a serialized format file parser to parse the configuration file to obtain configuration items of the serialized format file; determining the operating environment of the configuration file based on the file name of the configuration file; and using the operating environment of the configuration file and its configuration items as configuration information of the configuration file.
[0010] Optionally, in the method according to the present invention, the file category also includes text files, and the method also includes the steps of: if the configuration file is a text file, calling a text file parser to parse the text file to obtain the operating environment and configuration items of the configuration file; and using the operating environment and configuration items of the configuration file as the configuration information of the configuration file.
[0011] Optionally, in the method according to the present invention, retrieving the configuration information of the configuration file according to each middleware feature in the middleware feature set includes the steps of: retrieving the middleware feature in the configuration item of the configuration information to determine whether the configuration item contains the middleware feature; if the configuration item contains the middleware feature, using the middleware corresponding to the middleware feature as the middleware constructed by the configuration file; if the configuration item does not contain the middleware feature, retrieving the next middleware feature.
[0012] Optionally, in the method according to the present invention, a plurality of exclusion features are also stored in the middleware feature set, each exclusion feature corresponds to a middleware and a middleware feature, and the method further comprises the step of retrieving configuration information in the configuration file according to each exclusion feature in the middleware feature set.
[0013] Optionally, in the method according to the present invention, retrieving the configuration information in the configuration file according to each exclusion feature in the middleware feature set includes the steps of: retrieving the exclusion feature in the configuration item of the configuration information to determine whether the configuration item contains the exclusion feature; if the configuration item contains the exclusion feature, the middleware corresponding to the exclusion feature is not used as the middleware constructed by the configuration file; if the configuration item does not contain the exclusion feature, retrieving the next exclusion feature.
[0014] Optionally, the method according to the present invention further includes the steps of: determining the operating environment of the middleware constructed by the configuration file according to the operating environment in the configuration information of the configuration file; and determining the middleware set under each operating environment in the project according to the operating environment of the middleware.
[0015] Optionally, in the method according to the present invention, the computing device also stores multiple versions of historical middleware sets for each operating environment, and the historical middleware set is a middleware set of historical versions of the project. The method also includes the steps of: comparing the middleware set in each operating environment with the previous version of the historical middleware set in the operating environment; if the middleware set is changed compared to the historical middleware set, a change prompt is issued to the developer of the project so that the developer can confirm the changed middleware.
[0016] Optionally, the method according to the present invention further includes the following steps: if a middleware is canceled, determining whether the project is configured with the canceled middleware based on the project's middleware set; if the project is configured with the canceled middleware, issuing a modification prompt to the project's developer so that the developer can determine whether to modify the configuration file configured with the canceled middleware.
[0017] Optionally, in the method according to the present invention, multiple projects are also stored in the computing device, and the method also includes the steps of: determining a middleware set for each project; determining one or more projects containing the target middleware based on each middleware set; and drawing a middleware topology map based on the one or more projects containing the target middleware.
[0018] Optionally, in the method according to the present invention, the method further includes the steps of: receiving a user's query request for the target middleware calling relationship; determining one or more projects of the calling target middleware based on the middleware set query of each project; and returning the calling target middleware one or more projects as query results to the user.
[0019] According to another aspect of the present invention, a middleware management device is provided, which includes a file parsing module and an information extraction module. The file parsing module is suitable for traversing the file names of multiple configuration files contained in the project, determining the file category of each configuration file, calling the corresponding parser according to the file category of the configuration file to parse the configuration file, and obtaining the configuration information of each configuration file; the information extraction module is suitable for retrieving the configuration information of the configuration file according to each middleware feature in the middleware feature set, thereby determining the middleware constructed by each configuration file, taking the middleware constructed by each configuration file in the project as the middleware constructed by the project, and obtaining the middleware set of the project.
[0020] Optionally, the device according to the present invention also includes a configuration verification module, which is suitable for determining whether the project is configured with the middleware whose call has been canceled based on the middleware set of the project when a middleware is canceled; if the project is configured with the middleware whose call has been canceled, a modification prompt is issued to the developer of the project so that the developer can determine whether to modify the configuration file configured with the middleware whose call has been canceled.
[0021] Optionally, the device according to the present invention also includes an information query module, which is suitable for determining the middleware set of each project; determining one or more projects containing the target middleware based on each middleware set; drawing a middleware topology map based on the one or more projects containing the target middleware; receiving a user's query request for the call relationship of the target middleware, and determining one or more projects to call the target middleware based on the middleware topology map; and returning the one or more projects calling the target middleware as the query result to the user.
[0022] According to another aspect of the present invention, a computing device is provided, comprising: one or more processors; a memory; and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include instructions for executing the middleware management method according to the present invention.
[0023] According to another aspect of the present invention, a computer-readable storage medium storing one or more programs is provided. The one or more programs include instructions that, when executed by a computing device, cause the computing device to perform the middleware management method according to the present invention.
[0024] The middleware management method in the present invention is suitable for execution in a computing device, wherein the computing device stores a project and a middleware feature set, and the project includes a plurality of configuration files. First, according to the file name of the configuration file, the file category of each configuration file is determined, so that the corresponding parser is called according to the file category of the configuration file to parse the configuration file and obtain the configuration information of each configuration file. Thus, the configuration information of the configuration files of different file categories can be extracted. Subsequently, according to each middleware feature in the middleware feature set, the configuration information of the configuration file is retrieved to determine the middleware defined by each configuration file. Finally, the middleware defined in each configuration file in the project is collected to obtain the middleware set associated with the project. By calling different parsers according to different configuration files to obtain the configuration information, the constructed middleware can be obtained by searching in the configuration information. The present invention can be compatible with multiple configuration files under the project, realize automatic analysis and acquisition of configuration information, and thus obtain the constructed middleware, which greatly improves the analysis efficiency of the middleware related information and facilitates developers to master the middleware situation of the project. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to achieve the above and related purposes, certain illustrative aspects are described herein in conjunction with the following description and accompanying drawings, which indicate various ways in which the principles disclosed herein can be practiced, and all aspects and their equivalents are intended to fall within the scope of the claimed subject matter. By reading the following detailed description in conjunction with the accompanying drawings, the above and other purposes, features and advantages disclosed by the present invention will become more apparent. Throughout the present disclosure, the same reference numerals generally refer to the same parts or elements.
[0026] Figure 1 A schematic diagram showing the structure of a middleware management device 100 according to an exemplary embodiment of the present invention is shown;
[0027] Figure 2 shows a block diagram of a computing device 200 according to an exemplary embodiment of the present invention;
[0028] Figure 3 A schematic diagram of a flow chart of a middleware management method 300 according to an exemplary embodiment of the present invention is shown;
[0029] Figure 4 A schematic diagram showing a file architecture according to an exemplary embodiment of the present invention; and
[0030] Figure 5 A schematic diagram of a middleware topology diagram according to an exemplary embodiment of the present invention is shown. DETAILED DESCRIPTION
[0031] Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary 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 limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present disclosure and to enable the scope of the present disclosure to be fully conveyed to those skilled in the art. The same reference numerals generally refer to the same components or elements.
[0032] Figure 1 FIG. 1 is a schematic diagram showing the structure of a middleware management device 100 according to an exemplary embodiment of the present invention. Figure 1 As shown, the middleware management device 100 includes a file parsing module 110 , an information extraction module 120 , a configuration verification module 130 and an information query module 140 .
[0033] Among them, the file parsing module 110 traverses the file names of multiple configuration files contained in the project, determines the file category of each configuration file, calls the corresponding parser according to the file category of the configuration file to parse the configuration file, and obtains the configuration information of each configuration file. The project includes multiple configuration files, and the file name naming format of each configuration file is different. The configuration files of different file categories can be distinguished by the file name of the configuration file, so that different parsers can be called according to the file category of the configuration file to parse it and obtain the file information of the configuration file. When determining the file category of each configuration file, all configuration files of the project are traversed in the order from the root directory to the lowest sub-file. Specifically, starting from the set root directory, all sub-directories under the project and all files under the sub-directories are traversed.
[0034] The information extraction module 120 retrieves the configuration information of the configuration file according to each middleware feature in the middleware feature set, thereby determining the middleware constructed by each configuration file, and taking the middleware constructed by each configuration file in the project as the middleware constructed by the project, thereby obtaining the middleware set of the project. When retrieving the configuration information of the configuration file according to the middleware feature, the middleware feature is retrieved in the configuration item of the configuration information to determine whether the middleware feature is included in the configuration item. If the middleware feature is included in the configuration item, the middleware corresponding to the middleware feature is taken as the middleware constructed by the configuration file. If the middleware feature is not included in the configuration item, the next middleware feature is retrieved until all the middleware features in the configuration item are retrieved. If all the middleware features are retrieved and no middleware features are retrieved from the configuration item after all the middleware features are retrieved, it is determined that the configuration file does not include any middleware.
[0035] The information extraction module 120 also manages the middleware feature set. The middleware features and exclusion features in the middleware feature set can be adjusted and modified dynamically. When the middleware features or exclusion features are modified, the configuration items of the configuration information are automatically searched according to the modified middleware features or exclusion features, and the middleware constructed by the configuration file is re-determined, so that the middleware of the project can be parsed in real time according to the middleware features.
[0036] When a middleware is canceled, the configuration verification module 130 determines whether the project is configured with the canceled middleware based on the project's middleware set; if the project is configured with the canceled middleware, a modification prompt is issued to the project developer so that the developer can determine whether to modify the configuration file configured with the canceled middleware. If the middleware configured in the project and configuration file is canceled due to version or compatibility reasons, the canceled middleware in these projects will be marked as invalid. Subsequently, the relevant developers of the projects and corresponding configuration files marked with invalid middleware are determined, and modification prompts are issued to the relevant developers. The hasty deletion of the middleware code in the configuration file in the project may cause the configuration file to not be used normally. Therefore, it is necessary for the developer to determine whether to modify the middleware-related code and how to modify it, so as to improve the standardization and security of project modifications.
[0037] The information query module 140 determines the middleware set of each project, determines one or more projects including the target middleware according to each middleware set, and draws a middleware topology map according to the one or more projects including the target middleware. The information query module 140 also receives a user's query request for the target middleware call relationship, determines one or more projects to call the target middleware according to the middleware topology map, and returns the one or more projects to call the target middleware as a query result to the user.
[0038] In some cases, a certain middleware is changed. In order to accurately notify the relevant personnel of all affected projects, the information query module 140 provides the user with the function of querying the situation of all projects calling a certain target middleware. The user's query request includes the name of the target middleware. After receiving the query request, the name of the middleware is queried from the middleware set of each project, and the middleware with the queried middleware name is used as the project calling the target middleware. Finally, all projects calling the target middleware are returned to the user, so that notification information can be sent to all relevant personnel of these projects to ensure that all project personnel are aware of the middleware change information in a timely manner and evaluate the impact of the change.
[0039] Figure 1 The middleware management device 100 is suitable for residing in Figure 2 In the computing device shown. Figure 2 FIG. 2 shows a block diagram of a computing device 200 according to an exemplary embodiment of the present invention. Figure 2 As shown, in a basic configuration 202, computing device 200 typically includes a system memory 206 and one or more processors 204. A memory bus 208 may be used for communication between processor 204 and system memory 206.
[0040] Depending on the desired configuration, the processor 204 can be any type of processor, including but not limited to: a microprocessor (μP), a microcontroller (μC), a digital information processor (DSP), or any combination thereof. The processor 204 can include one or more levels of cache such as a primary cache 210 and a secondary cache 212, a processor core 214, and registers 216. An example processor core 214 can include an arithmetic logic unit (ALU), a floating point unit (FPU), a digital signal processing core (DSP core), or any combination thereof. An example memory controller 218 can be used with the processor 204, or in some implementations, the memory controller 218 can be an internal part of the processor 204.
[0041] Depending on the desired configuration, the system memory 206 may be any type of memory, including but not limited to: volatile memory (such as RAM), non-volatile memory (such as ROM, flash memory, etc.), or any combination thereof. The system memory 206 may include an operating system 220, one or more programs 222, and program data 228. In some embodiments, the program 222 may be arranged to be executed by one or more processors 204 on the operating system using the program data 228 to execute the instructions 223 of the method 300 according to the present invention.
[0042] The computing device 200 may also include a storage interface bus 234. The storage interface bus 234 enables communication from storage devices 232 (e.g., removable storage 236 and non-removable storage 238) to the basic configuration 202 via the bus / interface controller 230. At least a portion of the operating system 220, the program 222, and the data 224 may be stored on the removable storage 236 and / or the non-removable storage 238, and when the computing device 200 is powered on or the program 222 is to be executed, it is loaded into the system memory 206 via the storage interface bus 234 and executed by the one or more processors 204.
[0043] The computing device 200 may also include an interface bus 240 that facilitates communication from various interface devices (e.g., output devices 242, peripheral interfaces 244, and communication devices 246) to the basic configuration 202 via the bus / interface controller 230. Example output devices 242 include a graphics processing unit 248 and an audio processing unit 250. They can be configured to facilitate communication with various external devices such as a display or speakers via one or more A / V ports 252. Example peripheral interfaces 244 may include a serial interface controller 254 and a parallel interface controller 256, which may be configured to facilitate communication with external devices such as input devices (e.g., keyboards, mice, pens, voice input devices, touch input devices) or other peripherals (e.g., printers, scanners, etc.) via one or more I / O ports 258. Example communication devices 246 may include a network controller 260, which may be arranged to communicate with one or more other computing devices 262 via a network communication link via one or more communication ports 264.
[0044] A network communication link can be an example of a communication medium. Communication media can generally be embodied as computer-readable instructions, data structures, program modules in a modulated data signal such as a carrier wave or other transmission mechanism, and can include any information delivery medium. A "modulated data signal" can be a signal in which one or more of its data sets or its changes can be carried out in a manner that encodes information in the signal. As non-limiting examples, communication media can include wired media such as a wired network or a dedicated line network, and various wireless media such as sound, radio frequency (RF), microwave, infrared (IR) or other wireless media. The term computer-readable medium used herein can include both storage media and communication media.
[0045] In the computing device 200 according to the present invention, the program 222 includes multiple program instructions of the middleware management method 300, which can instruct the processor 204 to execute some steps of the middleware management method 300 running in the computing device 200 of the present invention, so that each part in the computing device 200 runs the application by executing the middleware management method 300 of the present invention.
[0046] The computing device 200 can be implemented as a server, such as a file server, a database, a server, an application server, etc. These electronic devices can be such as personal digital assistants (PDAs), wireless network browsing devices, application-specific devices, or hybrid devices that can include any of the above functions. It can be implemented as a personal computer including desktop computers and notebook computer configurations. In some embodiments, the computing device 200 is also configured as the middleware management method 300.
[0047] Figure 3 FIG. 3 is a flow chart of a middleware management method 300 according to an exemplary embodiment of the present invention. The middleware management method 300 of the present invention is suitable for being executed in a computing device, and is further suitable for being executed in a computing device such as Figure 2 The process is executed in the computing device 200 shown. The computing device stores a project and a middleware feature set, and the project includes a plurality of configuration files.
[0048] A project is a project file used by developers to implement certain functions and requirements. Multiple projects can be stored in a computing device, and the present invention does not limit the number of projects. In addition, the computing device can be connected to a code server, which stores multiple project groups, each of which includes multiple projects. All projects of a development team can be centrally stored in a project group or distributed in multiple specified projects. The computing device can download all projects that need to be managed by middleware under a specified project group from the code server. The computing device can download multiple projects from the code server in batches to implement full coverage of middleware management for all project groups built in the code server.
[0049] After completing the middleware management of all downloaded projects and uploading the parsing results to the code server, delete the locally stored projects to save storage space. In order to improve the efficiency of middleware management of projects, a specific root directory is set locally and all downloaded projects are stored in the root directory. According to one embodiment of the present invention, the naming rule of the project folder directory is root directory + path separator + project name + path separator + date.
[0050] According to one embodiment of the present invention, the project can be implemented as a SpringBoot framework project. SpringBoot is an open source application framework on the Java platform, which provides a container with inversion of control characteristics.
[0051] Each project includes multiple and various configuration files, and the configuration files implement the configuration function of the project. The present invention does not limit the number and types of configuration files included in the project. According to an embodiment of the present invention, the project includes an object model file, a serialization format file and a text file.
[0052] like Figure 3 As shown, the instruction execution method 300 starts from step S310, and the file category of each configuration file is determined according to the file name of the configuration file. The project includes multiple configuration files, and the file name naming format of each configuration file is different. The configuration files of different file categories can be distinguished by the file name of the configuration file, so that different parsers are called according to the file category of the configuration file to align and parse, and obtain the file information of the configuration file. When determining the file category of each configuration file, all configuration files of the project are traversed in the order from the root directory to the lowest sub-file. Specifically, starting from the set root directory, all sub-directories under the project and all files under the sub-directories are traversed.
[0053] According to one embodiment of the present invention, the file categories of the configuration file include object model files, serialization format files, and text files. When determining the file category of the configuration file, when the file name of the configuration file includes .xml, it is determined to be an object model file; when the file name of the configuration file includes .yml, it is determined to be a serialization format file; when the file name of the configuration file includes .properties, it is determined to be a text file.
[0054] Subsequently, step S320 is executed to call the corresponding parser according to the file category of the configuration file to parse the configuration file and obtain the configuration information of each configuration file. When the file category of the project is determined, a category data table is generated. The category data table includes multiple rows of category data, and each row of category data records the file name, file category and file address of the configuration file. When determining the configuration information of the configuration file, the corresponding parser is called according to the file category recorded in each row of category data in the category data table; and then the parser is used to parse the configuration file according to the file address and file name recorded in each row of category data.
[0055] According to one embodiment of the present invention, when parsing the configuration information of the configuration file, if the file category of the configuration file is an object model file, the object model file parser is called to parse the object model file to obtain the file structure, and then the configuration information of the configuration file is determined according to the file structure.
[0056] According to one embodiment of the present invention, when the project is a SpringBoot project, the object model file can be implemented as a pom.xml file. pom.xml is a project configuration file managed by Maven, which is used to manage: source code, configuration files, developer information and roles, issue tracking system, organization information, project authorization, project URL, project dependencies, etc. The object model file parser is pre-set in the computing device for parsing the object model file, and can be implemented as MavenXpp3Reader.
[0057] Figure 4 FIG. 1 is a schematic diagram showing a file architecture according to an exemplary embodiment of the present invention. Figure 4 As shown, the object model file includes multiple operating environments, and each operating environment includes multiple middlewares.
[0058] When determining the configuration information of the configuration file according to the file architecture, one or more operating environments included in the configuration file are determined according to the file architecture, and the operating environment included in the configuration file and the configuration items under each operating environment are used as configuration information. For the sake of project operation safety, the middleware of each configuration file is divided into working in a certain operating environment. The operating environment includes the local development and test operating environment (local), the test operating environment (test) and the production operating environment (online). The configuration items under each operating environment record all the middleware constructed in the configuration file, and the configuration items can be determined according to the file architecture. Configuration information includes configuration items and operating environment.
[0059] If the configuration file is a serialized format file, the serialized format file parser is called to parse the configuration file to obtain the configuration items of the serialized format file, and the operating environment of the configuration file is determined according to the file name of the configuration file; finally, the operating environment of the configuration file and its configuration items are used as the configuration information of the configuration file.
[0060] According to one embodiment of the present invention, when the project is a SpringBoot project, the serialization format file can be implemented as a YML file. The YML file is a file format written in YAML (YAML AintMarkup Language). YAML is an intuitive data serialization format that can be recognized by a computer. It is saved in the form of key-value pairs, and the storage and reading speed is faster than XML. The serialization format file parser is pre-set in the computing device for parsing the serialization format file, and can be implemented as a YAMLParser.
[0061] The serialization format file stores information in the form of key-value pairs. The serialization format file parser reads each key-value pair, extracts the configuration items of the serialization format file, and determines the running environment of the serialization format file based on the file name. If the file name is application-local.yml, then the running environment is the local development and test running environment based on the word "local" in it; if the file name is application-test.yml, then the running environment is the test running environment based on the word "test" in it; if the file name is application-online.yml, then the running environment is the production running environment based on the word "online" in it.
[0062] If the configuration file is a text file, the text file parser is called to parse the text file to obtain the operating environment and configuration items of the configuration file. The text file stores information in the form of key-value pairs. The text file parser reads each key-value pair, extracts the configuration items of the text file, and determines the operating environment of the text file based on the file name. Finally, the operating environment and configuration items of the configuration file are used as the configuration information of the configuration file.
[0063] According to one embodiment of the present invention, when the project is a SpringBoot project, the text file can be implemented as a properties file. A properties file is a commonly used configuration file in Java, with a file suffix of ".properties", a text file, and a content format of the file is a key-value pair. A text file parser is pre-set in a computing device for parsing text files, and can be implemented as Properties.load.
[0064] Then, step S330 is executed to retrieve the configuration information of the configuration file according to each middleware feature in the middleware feature set, so as to determine the middleware defined by each configuration file. When determining the configuration information of the configuration file, the configuration information of all configuration files is generated into a configuration information set. Each configuration information in the configuration information set includes a configuration item and a running environment. The configuration item stores the middleware features constructed in the configuration file in the form of a key-value pair.
[0065] The middleware feature set includes multiple middleware features, each of which represents specific information contained in the configuration file when the middleware is constructed. The middleware feature set is set in advance by the developer, and records the middleware features of all the middleware that need to be parsed. Each middleware includes one or more middleware features. When a middleware includes multiple middleware features, as long as the configuration information includes one of these middleware features, it is considered that the corresponding middleware is constructed in the configuration file.
[0066] Table 1 shows an example of a middleware feature set and according to an exemplary embodiment of the present invention.
[0067]
[0068]
[0069] As shown in Table 1, the types of middleware include MQ message queue, MySQL database, SQLSERVER database, CODIS, Kafka, SOLR, ES, S3, etc. The present invention does not limit the types of middleware included in the middleware feature set. Developers can dynamically adjust the types of middleware included in the middleware feature set according to actual needs, so as to monitor the middleware constructed in the configuration file and the project in real time.
[0070] As shown in Table 1, 5672 of the MQ message queue and 3306 of MySQL in Table 1 all represent the corresponding middleware port numbers. nfiles3.in.autohome.com.cn of S3 represents the specific domain name used by the middleware.
[0071] When retrieving the configuration information of the configuration file based on the middleware feature, the middleware feature is retrieved in the configuration item of the configuration information to determine whether the configuration item contains the middleware feature. If the configuration item contains the middleware feature, the middleware corresponding to the middleware feature is used as the middleware constructed by the configuration file. If the configuration item does not contain the middleware feature, the next middleware feature is retrieved until all the middleware features in the configuration item are retrieved. If all the middleware features are retrieved and no middleware features are retrieved from the configuration item, it is determined that the configuration file does not include any middleware.
[0072] According to one embodiment of the present invention, when retrieving the configuration information of a configuration file, first retrieve the port number 5672 of the MQ message queue in its configuration information; if the port number is not retrieved, retrieve the port number 3306 of MySQL; if the port number is retrieved, it is determined that MySQL middleware is constructed in the configuration file; then retrieve the middleware features of other middlewares until the retrieval of all middleware features in the middleware feature set is completed.
[0073] The middleware feature set also stores multiple exclusion features, each of which corresponds to a middleware and middleware feature. When searching for middleware features, the configuration information in the configuration file is also searched according to each exclusion feature in the middleware feature set. Exclusion features represent that when developers are parsing the middleware of a project or configuration file, if they need to ignore the call to the middleware in some cases, they can set the exclusion feature so that it is not considered as the middleware constructed by the project or configuration file, thereby improving the flexibility of analyzing the middleware.
[0074] As shown in Table 1, the middleware feature set includes many exclusion features, such as Solr’s http: / / xxx.xxx.cn .
[0075] When searching the configuration information of the configuration file according to the exclusion feature, the exclusion feature is searched in the configuration item of the configuration information to determine whether the configuration item contains the exclusion feature. If the configuration item contains the exclusion feature, the middleware corresponding to the exclusion feature is not used as the middleware constructed by the configuration file. If the configuration item does not contain the exclusion feature, the next exclusion feature is searched.
[0076] According to an embodiment of the present invention, when a middleware of a configuration file is parsed, by retrieving the solr keyword in its configuration information, it is determined that the configuration file calls the Solr middleware, and whether the specific domain name used by the middleware is http: / / xxx.xxx.cn If the specific domain name used by the Solr middleware in this configuration file is http: / / xxx.xxx.cn , the Solr middleware is not used as the middleware for this configuration file, and the next exclusion feature is retrieved.
[0077] If a configuration file is determined not to include any middleware, then the exclusion feature will not be retrieved for it.
[0078] According to an embodiment of the present invention, the middleware features and exclusion features in the middleware feature set can be dynamically adjusted and modified by the developer. When the middleware features or exclusion features are modified, the configuration items of the configuration information are automatically searched according to the modified middleware features or exclusion features, and the middleware constructed by the configuration file is re-determined, so that the middleware of the project can be parsed in real time according to the middleware features.
[0079] Subsequently, step S340 is executed to collect the middleware defined in each configuration file in the project as the middleware constructed by the project to obtain a set of middleware associated with the project. The project includes multiple configuration files. After the middleware constructed by each configuration file in the project is parsed, the middleware constructed by all configuration files in the project are taken as the middleware constructed by the project, thereby obtaining a set of middleware constructed by the project. According to the above steps S310 to S340, the middleware set of the project can be quickly parsed in real time, and the above steps S310 to S340 are repeated for each project to quickly and accurately parse and obtain the middleware constructed by a large number of projects.
[0080] According to one embodiment of the present invention, the operating environment of the middleware constructed by the configuration file is determined according to the operating environment in the configuration information of the configuration file, and then the set of middleware under each operating environment of the project is determined according to the operating environment of the middleware. When the configuration information of each configuration file is obtained again, the operating environment of the configuration file is determined. The middleware of the configuration file can be set to run under different operating environments. Therefore, in order to determine the situation of the configuration files and the middleware constructed by the project under different operating environments, the middleware is classified according to the operating environment in the configuration information, so as to determine the construction situation of the middleware under each operating environment.
[0081] The computing device also stores a historical middleware set of multiple versions in each operating environment, which is a middleware set of historical versions of projects. The historical middleware set stores all middleware built in the corresponding operating environment for each historical version of the project.
[0082] After determining the construction status of the middleware in each operating environment, the middleware set in each operating environment is compared with the historical middleware set of the previous version in the operating environment. If the middleware set is changed compared to the historical middleware set, a change prompt is issued to the project developer so that the developer can confirm the changed middleware. When the middleware in the operating environment changes, the developer can determine whether the change is normal and whether the configuration file has been modified incorrectly. Changes in the middleware set include increases and decreases in the middleware built compared to the historical middleware set. When a change occurs, the person responsible for the project or the person who submitted the configuration file, etc., can be automatically queried, and a change prompt can be issued to the relevant developers.
[0083] According to one embodiment of the present invention, if a middleware is canceled, it is determined whether the project is configured with the canceled middleware based on the middleware set of the project; if the project is configured with the canceled middleware, a modification prompt is issued to the developer of the project so that the developer can determine whether to modify the configuration file configured with the canceled middleware. If the middleware configured in the project and the configuration file is canceled due to version or compatibility reasons, the canceled middleware in these projects will be marked as invalid. Subsequently, the relevant developers of the projects and corresponding configuration files marked with invalid middleware are determined, and modification prompts are issued to the relevant developers. The rash deletion of the middleware code in the configuration file in the project may cause the configuration file to not be used normally. Therefore, it is necessary for the developer to judge whether to modify the middleware-related code and how to modify it, so as to improve the standardization and security of project modifications.
[0084] After determining whether a project has been configured with canceled middleware and whether the middleware set in each operating environment has changed, mark the project as traversed and continue to process other projects that have not been managed by middleware according to the above steps. When the middleware management work is completed for all projects with the latest version, the processing of global projects is completed.
[0085] According to one embodiment of the present invention, the method further includes determining the middleware set of each project according to the above steps, determining one or more projects containing the target middleware according to each middleware set, and drawing a middleware topology map according to the one or more projects containing the target middleware. In order to more intuitively understand the calling situation of multiple projects on a certain target middleware, a middleware topology map of the target middleware is also provided. When drawing the middleware topology map, first build the target middleware node; if a certain project has built the target middleware, build the project node, and draw the connection between the project node and the target middleware node, which represents that the project has called the target middleware. If the project indirectly calls the middleware through other projects, build the connection between the project and other projects, as well as the connection between other projects and the middleware. After traversing the middleware sets of all projects, the middleware topology map is obtained.
[0086] Figure 5 FIG. 1 is a schematic diagram of a middleware topology diagram according to an exemplary embodiment of the present invention. Figure 5 As shown, the project csh.dn calls the middleware repo, and other projects such as api.cps and dealer.api indirectly call the middleware repo through the project csh.dn.
[0087] According to one embodiment of the present invention, the method of the present invention further includes receiving a user's query request for the target middleware call relationship, determining one or more projects that call the target middleware according to the middleware set query of each project, and returning the one or more projects that call the target middleware as the query result to the user. In some cases, a certain middleware is changed. In order to accurately notify the relevant personnel of all affected projects, the present invention also provides the user with the function of querying the situation of all projects calling a certain target middleware. The user's query request includes the name of the target middleware. After receiving the query request, the name of the middleware is queried from the middleware set of each project, and the middleware with the queried middleware name is used as the project that calls the target middleware. Finally, all projects that call the target middleware are returned to the user so that notification information can be sent to all relevant personnel of these projects to ensure that all project personnel are aware of the middleware change information in a timely manner and evaluate the impact of the change.
[0088] According to one embodiment of the present invention, the method of the present invention further includes generating ledger information including various middleware. The ledger information includes all middleware and the projects associated with each middleware. When generating the ledger information, the middleware set of each project is first determined, and then the projects associated with each middleware are extracted from the middleware set of each project. The projects associated with the middleware are the projects configured with the middleware.
[0089] The middleware management method in the present invention is suitable for execution in a computing device, wherein the computing device stores a project and a middleware feature set, and the project includes a plurality of configuration files. First, according to the file name of the configuration file, the file category of each configuration file is determined, so that the corresponding parser is called according to the file category of the configuration file to parse the configuration file and obtain the configuration information of each configuration file. Thus, the configuration information of the configuration files of different file categories can be extracted. Then, according to each middleware feature in the middleware feature set, the configuration information of the configuration file is retrieved to determine the middleware constructed by each configuration file. Finally, the middleware constructed by each configuration file in the project is used as the middleware constructed by the project to obtain the middleware set of the project. By calling different parsers according to different configuration files to obtain the configuration information, the constructed middleware can be obtained by searching in the configuration information. The present invention can be compatible with multiple configuration files under the project, realize automatic analysis and acquisition of configuration information, and thus obtain the constructed middleware, which greatly improves the analysis efficiency of the middleware related information and facilitates developers to master the middleware situation of the project.
[0090] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0091] A6. The method as described in A5, wherein the retrieving the configuration information of the configuration file according to each middleware feature in the middleware feature set comprises the steps of:
[0092] Retrieving the middleware feature in the configuration item of the configuration information to determine whether the configuration item contains the middleware feature;
[0093] If the configuration item includes the middleware feature, the middleware corresponding to the middleware feature is used as the middleware constructed by the configuration file;
[0094] If the configuration item does not contain the middleware feature, the next middleware feature is retrieved.
[0095] A7. The method as described in A6, wherein the middleware feature set further stores a plurality of exclusion features, each exclusion feature corresponds to a middleware and a middleware feature, and the method further comprises the steps of:
[0096] According to each exclusion feature in the middleware feature set, configuration information in the configuration file is retrieved.
[0097] A8. The method as described in A7, wherein the retrieving the configuration information in the configuration file according to each exclusion feature in the middleware feature set comprises the steps of:
[0098] Searching for an exclusion feature in the configuration item of the configuration information to determine whether the configuration item contains the exclusion feature;
[0099] If the configuration item includes the exclusion feature, the middleware corresponding to the exclusion feature is not used as the middleware constructed by the configuration file;
[0100] If the configuration item does not contain the exclusion feature, the next exclusion feature is retrieved.
[0101] A9. The method as described in A8, wherein the method further comprises the steps of:
[0102] Determining the operating environment of the middleware constructed by the configuration file according to the operating environment in the configuration information of the configuration file;
[0103] According to the operating environment of the middleware, a set of middleware in each operating environment of the project is determined.
[0104] A10. The method as described in A9, wherein the computing device further stores a historical middleware set of multiple versions in each operating environment, the historical middleware set being a middleware set of historical versions of the project, and the method further comprises the steps of:
[0105] Compare the middleware set in each running environment with the historical middleware set of the previous version in the running environment;
[0106] If the middleware set is changed compared to the historical middleware set, a change prompt is sent to the developer of the project so that the developer can confirm the changed middleware.
[0107] A11. The method as described in A9 or A10, further comprising the steps of:
[0108] If a middleware is canceled, determining whether the project is configured with the canceled middleware according to the middleware set of the project;
[0109] If the project is configured with the middleware whose call is cancelled, a modification prompt is sent to the developer of the project so that the developer can determine whether to modify the configuration file configured with the middleware whose call is cancelled.
[0110] A12. The method as described in A11, wherein the computing device further stores a plurality of items, and the method further comprises the steps of:
[0111] Determine the set of middleware for each project;
[0112] Determine one or more projects containing target middleware according to each middleware set;
[0113] Draw a middleware topology diagram based on one or more projects that contain the target middleware.
[0114] A13. The method as described in A12, wherein the method further comprises the steps of:
[0115] Receive a user's query request for the target middleware call relationship;
[0116] Determine one or more projects of calling the target middleware according to the middleware set query of each project;
[0117] One or more items of calling the target middleware are returned to the user as query results.
[0118] Similarly, it should be understood that in order to streamline the present disclosure and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this method of disclosure should not be interpreted as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim.
[0119] Those skilled in the art will appreciate that the modules or units or groups of the devices in the examples disclosed herein may be arranged in the device as described in the embodiment, or alternatively may be located in one or more devices different from the devices in the example. The modules in the foregoing examples may be combined into one module or may be divided into multiple submodules.
[0120] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or groups in the embodiments may be combined into one module or unit or group, and further may be divided into a plurality of submodules or subunits or subgroups. All features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device so disclosed may be combined in any combination, except that at least some of such features and / or processes or units are mutually exclusive. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.
[0121] Furthermore, those skilled in the art will appreciate that although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features from different embodiments is meant to be within the scope of the present invention and to form different embodiments.
[0122] In addition, some of the embodiments are described herein as methods or combinations of method elements that can be implemented by a processor of a computer system or by other devices that perform the functions. Therefore, a processor with necessary instructions for implementing the method or method elements forms a device for implementing the method or method elements. In addition, the elements described herein of the device embodiments are examples of devices for implementing the functions performed by the elements for the purpose of implementing the invention.
[0123] The various techniques described herein may be implemented in combination with hardware or software, or a combination thereof. Thus, the method and apparatus of the present invention, or some aspects or portions of the method and apparatus of the present invention may be in the form of program codes (i.e., instructions) embedded in a tangible medium, such as a floppy disk, a CD-ROM, a hard disk drive, or any other machine-readable storage medium, wherein when the program is loaded into a machine such as a computer and executed by the machine, the machine becomes a device for practicing the present invention.
[0124] In the case where the program code is executed on a programmable computer, the computing device generally includes a processor, a storage medium readable by the processor (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device. The memory is configured to store the program code; the processor is configured to execute the middleware management method of the present invention according to the instructions in the program code stored in the memory.
[0125] By way of example and not limitation, computer readable media include computer storage media and communication media. Computer readable media include computer storage media and communication media. Computer storage media stores information such as computer readable instructions, data structures, program modules or other data. Communication media generally embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and includes any information delivery medium. Any combination of the above is also included within the scope of computer readable media.
[0126] As used herein, unless otherwise specified, the use of ordinal numbers "first," "second," "third," etc. to describe common objects merely indicates that different instances of similar objects are involved, and is not intended to imply that the objects so described must have a given order in time, space, order, or in any other manner.
[0127] Although the present invention has been described according to a limited number of embodiments, it will be apparent to those skilled in the art, with the benefit of the above description, that other embodiments may be envisioned within the scope of the invention thus described. In addition, it should be noted that the language used in this specification is selected primarily for readability and teaching purposes, rather than for explaining or defining the subject matter of the present invention. Therefore, many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the appended claims. The disclosure of the present invention is illustrative, not restrictive, with respect to the scope of the present invention, which is defined by the appended claims.
Claims
1. A middleware management method, adapted to be executed in a computing device, so as to manage middleware associated with a project, wherein the project includes a plurality of configuration files, and the computing device also stores a set of middleware features, the method comprising the steps of: Determine the file category of each configuration file according to the file name of the configuration file; Calling a corresponding parser according to the file category of the configuration file to parse the configuration file to obtain configuration information of each configuration file; According to each middleware feature in the middleware feature set, the configuration information of the configuration file is retrieved, so as to determine the middleware defined by each configuration file; Gather the middleware defined in each configuration file in the project to obtain a middleware set associated with the project; The retrieving the configuration information of the configuration file according to each middleware feature in the middleware feature set comprises the steps of: Retrieving middleware features in the configuration items of the configuration information to determine whether the configuration items include the middleware features, wherein the middleware features represent specific information included in the configuration file when the middleware is constructed, and each middleware item includes one or more middleware features; If the configuration item includes the middleware feature, the middleware corresponding to the middleware feature is used as the middleware constructed by the configuration file; If the configuration item does not contain the middleware feature, then the next middleware feature is retrieved; The middleware feature set further stores a plurality of exclusion features, each exclusion feature corresponding to a middleware and a middleware feature, and the method further comprises the steps of: According to each exclusion feature in the middleware feature set, the configuration information in the configuration file is retrieved, including: Searching for an exclusion feature in the configuration item of the configuration information to determine whether the configuration item contains the exclusion feature; If the configuration item includes the exclusion feature, the middleware corresponding to the exclusion feature is not used as the middleware constructed by the configuration file; If the configuration item does not contain the exclusion feature, searching for the next exclusion feature; The method further comprises the steps of: If a middleware is canceled, determining whether the project is configured with the canceled middleware according to the middleware set of the project; If the project is configured with the middleware whose call is cancelled, a modification prompt is sent to the developer of the project so that the developer can determine whether to modify the configuration file configured with the middleware whose call is cancelled.
2. The method of claim 1, wherein: The file category includes an object model file, and the calling of a corresponding parser according to the file category of the configuration file to parse the configuration file to obtain the configuration information of each configuration file includes the following steps: If the file type of the configuration file is an object model file, calling an object model file parser to parse the object model file to obtain a file structure; Configuration information of the configuration file is determined according to the file architecture.
3. The method of claim 2, wherein determining the configuration information of the configuration file according to the file architecture comprises the steps of: Determining one or more operating environments included in the configuration file according to the file architecture; The operating environment included in the configuration file and the configuration items under each operating environment are used as configuration information.
4. The method of claim 3, wherein: The file category also includes a serialized format file, and the method further includes the steps of: If the configuration file is a serialized format file, calling a serialized format file parser to parse the configuration file to obtain configuration items of the serialized format file; Determining the operating environment of the configuration file according to the file name of the configuration file; The operating environment and configuration items of the configuration file are used as configuration information of the configuration file.
5. The method according to any one of claims 1 to 4, wherein: The file category also includes text files, and the method further includes the steps of: If the configuration file is a text file, a text file parser is called to parse the text file to obtain the operating environment and configuration items of the configuration file; The operating environment and configuration items of the configuration file are used as configuration information of the configuration file.
6. The method of claim 1, wherein: The method further comprises the steps of: Determining the operating environment of the middleware constructed by the configuration file according to the operating environment in the configuration information of the configuration file; According to the operating environment of the middleware, a set of middleware in each operating environment of the project is determined.
7. The method of claim 6, wherein: The computing device also stores a historical middleware set of multiple versions in each operating environment, wherein the historical middleware set is a middleware set of a project of a historical version. The method further includes the steps of: Compare the middleware set in each running environment with the historical middleware set of the previous version in the running environment; If the middleware set is changed compared to the historical middleware set, a change prompt is sent to the developer of the project so that the developer can confirm the changed middleware.
8. The method of claim 1, wherein the computing device further stores a plurality of items, the method further comprising the steps of: Determine the set of middleware for each project; Determine one or more projects containing target middleware according to each middleware set; Draw a middleware topology diagram based on one or more projects that contain the target middleware.
9. The method of claim 8, wherein: The method further comprises the steps of: Receive a user's query request for the target middleware call relationship; Determine one or more projects of calling the target middleware according to the middleware set query of each project; One or more items of calling the target middleware are returned to the user as query results.
10. A middleware management device, comprising a file parsing module and an information extraction module, adapted to reside in a computing device, and to manage middleware associated with a project in the computing device, wherein the project comprises a plurality of configuration files, and the computing device further stores a set of middleware features, wherein the file parsing module is adapted to traverse the file names of the plurality of configuration files included in the project, determine the file category of each configuration file, call a corresponding parser according to the file category of the configuration file to parse the configuration file, and obtain configuration information of each configuration file, wherein the configuration file implements a configuration function for the project; The information extraction module is adapted to retrieve the configuration information of the configuration file according to each middleware feature in the middleware feature set, thereby determining the middleware defined by each configuration file, and collecting the middleware defined by each configuration file in the project to obtain a middleware set associated with the project; The middleware feature set further stores a plurality of exclusion features, each of which corresponds to a middleware and a middleware feature, and the information extraction module is further adapted to: retrieve the configuration information in the configuration file according to each exclusion feature in the middleware feature set, including: Searching for an exclusion feature in the configuration item of the configuration information to determine whether the configuration item contains the exclusion feature; If the configuration item includes the exclusion feature, the middleware corresponding to the exclusion feature is not used as the middleware constructed by the configuration file; if the configuration item does not include the exclusion feature, the next exclusion feature is retrieved; The device further comprises a configuration checking module, wherein the configuration checking module is adapted to determine whether the project is configured with the canceled middleware according to the middleware set of the project when the call of the middleware is canceled; If the project is configured with the middleware whose call is cancelled, a modification prompt is sent to the developer of the project so that the developer can determine whether to modify the configuration file configured with the middleware whose call is cancelled.
11. The device of claim 10, wherein: The apparatus further comprises an information query module adapted to determine a set of middleware for each project; Determine one or more projects containing target middleware according to each middleware set; Draw a middleware topology diagram based on one or more projects containing target middleware; Receiving a query request from a user on a target middleware calling relationship, and determining to call one or more items of the target middleware according to the middleware topology map; One or more items of calling the target middleware are returned to the user as query results.
12. A computing device comprising: one or more processors; Memory; as well as One or more devices comprising instructions for executing the method according to any one of claims 1-9.
13. A computer-readable storage medium storing one or more programs, the one or more programs comprising instructions which, when executed by a computing device, cause the computing device to perform the method according to any one of claims 1-9.
Citation Information
Patent Citations
Method and device for detecting website existing in server and device
CN104793957A
Data monitoring method and device, computer equipment and storage medium
CN108829560A