Database construction method and device, electronic equipment and storage medium

By analyzing web page information files and routing files, and using non-relational databases to store page buttons and application programming interface information, the problem of low efficiency in building system page URL databases is solved, and efficient database construction is achieved and manage.

CN119293355APending Publication Date: 2025-01-10THREE GORGES GROUP IND DEVELOPMENT (BEIJING) CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411223530.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-02
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

The existing technology is difficult to effectively manage and build a system page URL database, resulting in low retrieval efficiency, poor user experience and insufficient security management.

Method used

By analyzing web page information files or routing files, a unified resource locator information is generated, and the page collection function of non-relational databases is used to store page buttons and application programming interface information, and a database is built to realize the distinction between pages, buttons and application programming interfaces. storage.

Benefits of technology

Without rewriting the enterprise information management system, the construction efficiency of the unified resource locator database of the system page is improved, and the management efficiency and user experience are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119293355A_ABST
    Figure CN119293355A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a database construction method and device, electronic equipment and a storage medium. According to the embodiment of the invention, uniform resource locator information for a system website is generated by analyzing a webpage information file or a routing file; scanning an application programming interface of a page button of a system website, storing uniform resource locator information through a page collection function of a non-relational database, and storing button information aiming at the page button through a button collection function of the non-relational database, and the application programming interface information aiming at the application programming interface is stored through an application programming interface collection function of the non-relational database so as to construct the database, so that the page, the button and the application programming interface are respectively stored; and the database is constructed without rewriting an enterprise information management system, so that the construction efficiency of the uniform resource locator database for the system page is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of database construction methods, and in particular to a database construction method, a database construction device, an electronic device and a computer-readable storage medium. Background Art

[0002] System page URL (Uniform Resource Locator) is an address used to locate resources on the Internet.

[0003] With the continuous expansion of information systems, the management of system page URLs has become increasingly important. In order to improve page retrieval efficiency, optimize user experience, and strengthen security management, how to improve the efficiency of building the system page URL database directly determines the management efficiency of the system page URL. Summary of the invention

[0004] The embodiments of the present invention provide a database construction method, device, electronic device and computer-readable storage medium to overcome the above problems or at least partially solve the above problems.

[0005] The embodiment of the present invention discloses a database construction method, comprising:

[0006] When it is determined that a web page information file or a routing file for the system website is obtained, the web page information file or the routing file is parsed to generate uniform resource locator information for the system website;

[0007] Scan the application programming interface of the page button of the system website, and when the application programming interface is monitored, store the uniform resource locator information through the page collection function of the non-relational database, store the button information for the page button through the button collection function of the non-relational database, and store the application programming interface information for the application programming interface through the application programming interface collection function of the non-relational database to build a database.

[0008] Optionally, it also includes:

[0009] When it is determined that the web page information file and the routing file for the system website are not obtained, then obtaining the system access log for the system website;

[0010] Generate uniform resource locator information for the system website based on the system access log by using a regular expression.

[0011] Optionally, it also includes:

[0012] When it is determined that the application programming interface is not monitored, the application programming interface is determined based on the system access log.

[0013] Optionally, the step of storing the uniform resource locator information through a page collection function of a non-relational database includes:

[0014] Importing a driver program, and building a connection relationship with the database based on the driver program;

[0015] Creating a page document for the uniform resource locator information;

[0016] A page collection is created, and the page document is stored in the page collection.

[0017] Optionally, the step of storing the button information for the page button through the button collection function of the non-relational database includes:

[0018] Creating a button document for the button information;

[0019] A button set is created, and the button document is stored in the button set.

[0020] Optionally, the step of storing application programming interface information for the application programming interface through the application programming interface collection function of the non-relational database includes:

[0021] Creating an application programming interface document for the application programming interface information;

[0022] An application programming interface set is created, and the application programming interface document is stored in the application programming interface set.

[0023] Optionally, it also includes:

[0024] When it is determined that the system website is invalid through the uniform resource locator information, or when it is determined that the application programming interface is invalid through the application programming interface information, the web page information file or routing file for the system website is re-acquired.

[0025] Optionally, it also includes:

[0026] When it is determined that the web page information file and the routing file for the system website are not obtained, the uniform resource locator information is captured from the system website.

[0027] Optionally, it also includes:

[0028] Determine the location and format of the system access log.

[0029] Optionally, it also includes:

[0030] When the data volume of the system access log is greater than a preset threshold, the system access log is split.

[0031] Optionally, it also includes:

[0032] When the format of the system access log is not a preset format, a format conversion operation is performed on the system access log.

[0033] Optionally, it also includes:

[0034] Characteristics of a request of the application programming interface are determined.

[0035] The embodiment of the present invention also discloses a database construction device, including:

[0036] A uniform resource locator information generation module, for parsing the web page information file or the routing file to generate uniform resource locator information for the system website when it is determined that a web page information file or a routing file for the system website is obtained;

[0037] A database construction module is used to scan the application programming interface of the page button of the system website, and when the application programming interface is monitored, the uniform resource locator information is stored through the page collection function of the non-relational database, and the button information for the page button is stored through the button collection function of the non-relational database, and the application programming interface information for the application programming interface is stored through the application programming interface collection function of the non-relational database to construct a database.

[0038] The embodiment of the present invention further discloses an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0039] The memory is used to store computer programs;

[0040] The processor is used to implement the method described in the embodiment of the present invention when executing the program stored in the memory.

[0041] The embodiment of the present invention further discloses a computer-readable storage medium having instructions stored thereon, which, when executed by one or more processors, enables the processors to execute the method described in the embodiment of the present invention.

[0042] The embodiments of the present invention include the following advantages:

[0043] The embodiment of the present invention, when it is determined that a web page information file or a routing file for a system website is obtained, parses the web page information file or the routing file to generate uniform resource locator information for the system website; scans the application programming interface of the page button of the system website, and when the application programming interface is monitored, stores the uniform resource locator information through the page collection function of the non-relational database, and stores the button information for the page button through the button collection function of the non-relational database, and stores the application programming interface information for the application programming interface through the application programming interface collection function of the non-relational database, so as to construct a database, realize the storage of pages, buttons and application programming interfaces separately, and realize the construction of the database without rewriting the enterprise information management system, thereby improving the construction efficiency of the uniform resource locator database for the system page. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 is a flowchart of the steps of a database construction method provided in an embodiment of the present invention;

[0045] Figure 2 is a flowchart of another method for building a database provided in an embodiment of the present invention;

[0046] Figure 3 is a flowchart of the steps of another database construction method provided in an embodiment of the present invention;

[0047] Figure 4 is a structural block diagram of a database construction device provided in an embodiment of the present invention;

[0048] Figure 5 is a hardware structure block diagram of an electronic device provided in an embodiment of the present invention;

[0049] Figure 6 is a schematic diagram of a computer-readable medium provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0050] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0051] Reference Figure 1 , shows a flowchart of a method for building a database provided in an embodiment of the present invention, which may specifically include the following steps:

[0052] Step 101, when it is determined that a web page information file or a routing file for a system website is obtained, the web page information file or the routing file is parsed to generate uniform resource locator information for the system website;

[0053] Step 102, scans the application programming interface of the page button of the system website, and when the application programming interface is monitored, stores the uniform resource locator information through the page collection function of the non-relational database, stores the button information for the page button through the button collection function of the non-relational database, and stores the application programming interface information for the application programming interface through the application programming interface collection function of the non-relational database to build a database.

[0054] The method of the embodiment of the present invention may be directed to an enterprise information management system, and the system website may be the system website of the enterprise information management system.

[0055] refer to Figure 2 , Figure 2 It is a flowchart of the steps of another database construction method provided in an embodiment of the present invention.

[0056] In a specific implementation, the embodiment of the present invention mainly realizes the automatic storage of the URL of the information website page and the API of the page button operation, including the automatic construction of the entire process from data collection, preprocessing, storage, and maintenance.

[0057] In practical applications, the system page URL (Uniform Resource Locator) is an address used to locate resources on the Internet. It consists of the following parts:

[0058] Protocol: Specifies the protocol used to access the resource, such as HTTP, HTTPS, FTP, etc.

[0059] Domain name: The name used to identify the server where the resource is located.

[0060] Port number: Used to identify a specific service on the server where the resource is located.

[0061] Path: Used to identify the location of a resource on the server.

[0062] Query parameters: Used to pass additional information to the server.

[0063] A Sitemap file is an XML file that lists all the pages of a website along with information about them, such as when they were last updated, how often they change, and their importance.

[0064] Sitemap files help search engines discover and crawl website content more efficiently, thereby improving your website's ranking in search results.

[0065] The Router.js file is a JavaScript file that defines routing rules in a single-page application (SPA).

[0066] Routing rules specify the mapping between URLs and application components.

[0067] When a user visits a URL, the router navigates the user to the corresponding application component based on the routing rules.

[0068] Sitemap files and router.js files are both important components in the URL field, and they play an important role in improving website performance and user experience.

[0069] Sitemap files can help search engines discover and crawl website content more efficiently, thereby improving the website's ranking in search results.

[0070] This is crucial for the SEO (search engine optimization) of your website.

[0071] The Router.js file can make navigation in a single-page application (SPA) smoother and more efficient, which can improve the user experience and make the website easier to use.

[0072] URL information typically includes:

[0073] Protocol: A protocol specifies the type of resource and how to access it. Common protocols include HTTP (for web pages), HTTPS (for secure web pages), FTP (for file transfers), and SMTP (for sending email).

[0074] Hostname: The hostname is the domain name of the server hosting the resource. It can be an IP address or a readable name, such as www.example.com.

[0075] Port: Port is an optional number that specifies which port to connect to on the server. The default port for HTTP is 80 and the default port for HTTPS is 443.

[0076] Path: A path specifies the location of a resource on a server. It is usually a hierarchy of folders and files.

[0077] Query: The query string contains parameters that can be passed to the resource. It begins with a question mark (?) and consists of name-value pairs separated by hyphens (&).

[0078] Fragment: A fragment identifies a specific part of a resource, such as an anchor in a web page. It begins with a hash sign (#).

[0079] When the database is being built, it can first be determined whether the web page information file sitemap or the routing file router.js for the system website can be obtained. If the sitemap file or router.js file of the system website can be obtained, the system's sitemap or router.js file information data can be extracted based on the currently running information system, and the uniform resource locator information of the system website, that is, the URL information, can be captured. Optionally, the page description and page function information of the system website can also be captured through the sitemap file or router.js file.

[0080] Application Programming Interface (API) is a set of predefined functions that aims to provide applications and developers with the ability to access a set of routines based on certain software or hardware without having to access the source code or understand the details of the internal working mechanism. Application Programming Interface information can be information that describes the application programming interface.

[0081] The page button of the system website can be a virtual button in the web page, which is used to receive the user's click command, and the button information is the information used to describe the page button.

[0082] In a specific implementation, the embodiment of the present invention can scan the application programming interface of the page button of the system website, and determine whether the application programming interface is monitored.

[0083] Optionally, you can obtain the page button API as follows:

[0084] Using a Sitemap File:

[0085] Although Sitemap files do not usually contain API information about page buttons. Sitemap files are designed to list the pages on a website and information about them, such as when they were last updated, how often they change, and how important they are. However, if you are using a custom Sitemap format, you may be able to extract information about page buttons from it.

[0086] Using router.js file:

[0087] The Router.js file usually contains API information about page buttons. The Router.js file is used to define routing rules in a single-page application (SPA). These routing rules specify the mapping between URLs and application components. Application components can contain API information about page buttons.

[0088] Use the page parsing tool:

[0089] You can use page parsing tools to analyze web pages and extract information about page buttons. Page parsing tools can usually identify button elements on a page and extract their properties, such as the button's ID, name, and text. You can then use this information to build an API for page buttons.

[0090] Use your browser developer tools:

[0091] You can use the browser developer tools to inspect a web page and view information about the page's buttons. For example, you can use the Elements panel to view the button element on the page and use the Network panel to view the API request sent to the server.

[0092] Here are some specific examples:

[0093] Using JavaScript:

[0094]

[0095]

[0096] Using jQuery:

[0097]

[0098]

[0099] Using Python and Beautiful Soup:

[0100]

[0101]

[0102] In addition to the above examples, you can also obtain the API of the page button by writing a static analysis script to scan all button elements in the code (such as <button>, , <input> Event listeners (such as onclick, onchange, etc.) of the event handler (such as onclick, onchange, etc.) are used to obtain the API.

[0103] When an application programming interface is monitored, the uniform resource locator information is stored through the page collection function of the non-relational database, and the button information for the page button is stored through the button collection function of the non-relational database, and the application programming interface information for the application programming interface is stored through the application programming interface collection function of the non-relational database to build a database.

[0104] The embodiment of the present invention, when it is determined that a web page information file or a routing file for a system website is obtained, parses the web page information file or the routing file to generate uniform resource locator information for the system website; scans the application programming interface of the page button of the system website, and when the application programming interface is monitored, stores the uniform resource locator information through the page collection function of the non-relational database, and stores the button information for the page button through the button collection function of the non-relational database, and stores the application programming interface information for the application programming interface through the application programming interface collection function of the non-relational database, so as to construct a database, realize the storage of pages, buttons and application programming interfaces separately, and realize the construction of the database without rewriting the enterprise information management system, thereby improving the construction efficiency of the uniform resource locator database for the system page.

[0105] Based on the above embodiment, a variant embodiment of the above embodiment is proposed. It should be noted that in order to make the description concise, only the differences from the above embodiment are described in the variant embodiment.

[0106] In an optional embodiment of the present invention, it also includes:

[0107] When it is determined that the web page information file and the routing file for the system website are not obtained, then obtaining the system access log for the system website;

[0108] Generate uniform resource locator information for the system website based on the system access log by using a regular expression;

[0109] Or, grab the uniform resource locator information from the system website.

[0110] refer to Figure 3 , Figure 3 It is a flowchart of the steps of another database construction method provided in an embodiment of the present invention.

[0111] In a specific implementation, if the web page information file or routing file cannot be obtained, the uniform resource locator information, i.e., URL information, is captured from the system website; or the system access log of the server is analyzed to extract the uniform resource locator information, i.e., URL information, and then a database is constructed based on the URL information content.

[0112] Exemplarily, the process of extracting URL information from analyzing system access logs may be implemented through regular expression matching.

[0113] System access logs usually contain a lot of information about users visiting the website, including the URLs of the pages visited. You can use regular expressions to extract these URLs from the log files.

[0114] Regular expressions are a powerful tool for matching patterns in text.

[0115] Here are some examples of regular expressions for extracting URLs from access logs:

[0116] (?i)(GET|POST) / \S+HTTP / \d+\.\d+: matches requests that start with GET or POST, followed by the URL and HTTP protocol version.

[0117] (?i)\"GET / \S+HTTP / \d+\.\d+.*Referer:.*\": matches GET requests that contain a Referer header containing the referrer URL.

[0118] Web Scraping refers to the process of extracting uniform resource locator information from the system website. You can use the requests library (a hypertext transfer protocol library) to send HTTP requests to obtain the page content corresponding to each URL; use BeautifulSoup (BeautifulSoup is a Python library that can extract data from HTML or XML files) to parse HTML and extract the title or its function button text for the "Page Function" field. Page descriptions can be extracted from elements such as meta tags and specific paragraphs in the body of the page. At the same time, natural language processing technology NLP can be used to further extract and process page descriptions.

[0119] Python is an interpreted, high-level, and general-purpose programming language. It was originally used as the successor of the ABC language. Python's syntax is concise and easy to understand, similar to English, so it is very easy to learn. It has the following features:

[0120] Python is an interpreted language, which means that the code is executed directly without being compiled. This makes Python code easier to write and debug.

[0121] Python is a high-level language, which means that it shields many of the intricate details of computer hardware, allowing programmers to focus on solving problems rather than dealing with the underlying hardware.

[0122] Python is a general-purpose language, which means it can be used for various types of programming tasks, including web development, data science, machine learning, system administration, and more.

[0123] Using Python can achieve the following benefits:

[0124] Easy to learn and use: Python syntax is concise and easy to understand, similar to English, so it is very easy to learn.

[0125] Powerful: Python has a rich standard library and third-party libraries to meet various programming needs.

[0126] Cross-platform: Python can run on a variety of operating systems, including Windows, Linux, and macOS.

[0127] Active Community: Python has a large and active community that provides support and help to developers.

[0128] The Requests library is one of the most popular HTTP libraries in Python, used to send HTTP requests and get response results. It is known for its ease of use and powerful functions, and has become an indispensable tool for many web developers and data scientists.

[0129] The main features of the Requests library are:

[0130] Send various types of HTTP requests, including GET, POST, PUT, DELETE, etc.

[0131] Add request headers, parameters, cookies and other information.

[0132] Process the response results, including status code, response header, and response content.

[0133] Supports advanced features such as redirection, authentication, and proxy.

[0134] The benefits of using the Requests library include:

[0135] Easy to use: The API design of the Requests library is very concise and easy to understand and use. With just a few lines of code, you can send HTTP requests and get response results.

[0136] Powerful: The Requests library supports various types of HTTP requests and responses, and provides many convenient functions, such as adding request headers, parameters, cookies and other information, and processing response results.

[0137] Strong extensibility: The Requests library supports a variety of third-party libraries and tools, which can easily extend its functionality.

[0138] Following are the steps of Web Scraping process:

[0139] Use the requests library to send HTTP requests to obtain web page content.

[0140] Use BeautifulSoup to parse the HTML document.

[0141] Extract information such as page title, function button text, page description, etc.

[0142] Store the extracted information into a database.

[0143] Page descriptions can be extracted from the following places:

[0144] Meta tags: Some meta tags contain page description information, such as the meta description tag.

[0145] Specific paragraphs within the body of the page: Some pages may contain a paragraph dedicated to describing the content of the page.

[0146] NLP technology: Natural language processing (NLP) technology can be used to extract and process page descriptions from the page body.

[0147] The following are some specific implementation code examples:

[0148]

[0149]

[0150]

[0151] In an optional embodiment of the present invention, it also includes:

[0152] When it is determined that the application programming interface is not monitored, the application programming interface is determined based on the system access log.

[0153] refer to Figure 3 , Figure 3 It is a flowchart of the steps of another database construction method provided in an embodiment of the present invention.

[0154] Exemplarily, the application programming interface may be determined based on the system access log in the following manner:

[0155] 1. Collect and prepare system access logs:

[0156] Determine the location and format of system access logs. Common formats include Apache logs, Nginx logs, IIS logs, etc.

[0157] Collect and save the log files. If the log file is large, consider splitting it into multiple smaller files.

[0158] If the log format is not standard, preprocessing may be required, such as converting the format, extracting key fields, etc.

[0159] 2. Analyze the log files:

[0160] Determine the characteristics of the API request, such as the request method (GET, POST, etc.), request URL, request headers, etc.

[0161] Use regular expressions or other text processing tools to extract records related to API requests from log files.

[0162] Analyze the extracted records to determine the specific ways in which the API was not snooped.

[0163] 3. Determine the specific method of the API that is not monitored:

[0164] Based on the extracted log records, analyze the details of the API request, such as request parameters, request body, etc.

[0165] Try to simulate unobserved API requests to determine their exact format and parameters.

[0166] Analyze the server's response to determine whether the API successfully processed the request.

[0167] 4. Supplementary API monitoring:

[0168] Supplement API monitoring rules based on the discovered APIs that are not monitored.

[0169] API traffic is continuously monitored to ensure that all API requests are properly logged and monitored.

[0170] The following are some specific analysis methods and tools:

[0171] Use regular expressions: Regular expressions are a powerful text matching tool that can be used to extract records related to API requests from log files.

[0172] Use log analysis tools: There are many tools for analyzing log files, such as Logstash, ELKStack, etc. These tools can help you analyze and process log data more easily.

[0173] Use machine learning: Machine learning techniques can be used to automatically identify anomalies and patterns in log files.

[0174] Optionally, when determining the application programming interface based on the system access log, API traffic is continuously monitored and monitoring rules are supplemented in a timely manner to ensure that all API requests are correctly recorded and monitored.

[0175] In an optional embodiment of the present invention, the step of storing the uniform resource locator information through the page collection function of the non-relational database includes:

[0176] Importing a driver program, and building a connection relationship with the database based on the driver program;

[0177] Creating a page document for the uniform resource locator information;

[0178] A page collection is created, and the page document is stored in the page collection.

[0179] In the specific implementation, the page URL and the structure of the button API corresponding to the page button are considered, and the NoSQL solution is selected for storage.

[0180] The data model design is divided into three parts: Page Collection stores the URL information of the page, ButtonCollection stores the button information in the page, and API Collection stores the API information corresponding to the button.

[0181] Page Collection is a page collection function of non-relational database.

[0182] Exemplarily, the uniform resource locator information may be stored through the page collection function of a non-relational database in the following manner.

[0183] The first step is to import the driver, import the MongoDB driver, which is used to connect and interact with the MongoDB database. The following code imports the MongoDB driver for Node.js:

[0184] JavaScript

[0185] const MongoClient=require('mongodb').MongoClient;

[0186] The second step is to build a connection relationship with the database based on the driver.

[0187] The second step is to establish a connection to the MongoDB database.

[0188] The following code establishes a connection to a MongoDB database named mydatabase running on your local machine:

[0189] JavaScript

[0190] const client=new MongoClient('mongodb: / / localhost:27017 / mydatabase');

[0191] The third step is to get the page collection. The following code gets the page collection named pages:

[0192] JavaScript

[0193] const db = client.db();

[0194] const pagesCollection=db.collection('pages');

[0195] The fourth step is to create a new page document. The following code creates a new page document, which contains the following information:

[0196]

[0197]

[0198] Please use the code with caution.

[0199] Insert a new page document into the page collection

[0200] The fifth step is to insert the new page document into the page collection. The following code inserts the new page document into the page collection:

[0201]

[0202] The above code will create a new page document in the pages collection, containing the following information:

[0203]

[0204]

[0205] The _id field is the unique identifier of the page document. The url field stores the URL of the page. The title field stores the title of the page. The description field stores the description of the page. The buttons field stores an array of buttons on the page.

[0206] This is just one example of creating a collection of MongoDB pages. There are many other ways to do this depending on your specific needs.

[0207] Terminology explanation:

[0208] NoSQL: non-relational database;

[0209] MongoDB: A NoSQL database.

[0210] Driver: software used to connect to and interact with the database;

[0211] Database: Software used to store and manage data;

[0212] Collection: A container for storing data in MongoDB;

[0213] Document: The unit of data storage in MongoDB;

[0214] Field: an attribute in a document that stores data;

[0215] Insert: add data to the database;

[0216] Unique Identifier: A field used to identify a unique record in a database;

[0217] MongoDB is a NoSQL database that stores data differently from traditional relational databases. Therefore, when using MongoDB, you need to understand its specific data model and operation methods.

[0218] In an optional embodiment of the present invention, the step of storing the button information for the page button through the button collection function of the non-relational database includes:

[0219] Creating a button document for the button information;

[0220] A button set is created, and the button document is stored in the button set.

[0221] Exemplarily, storing the button information for the page button through the button collection function of the non-relational database may be implemented in the following manner.

[0222] The first step is to import the MongoDB driver to connect to and interact with the MongoDB database. The following code imports the MongoDB driver for Node.js:

[0223] JavaScript

[0224] const MongoClient=require('mongodb').MongoClient;

[0225] The second step is to establish a connection to the MongoDB database. The following code establishes a connection to a MongoDB database named mydatabase running on the local machine:

[0226] JavaScript

[0227] const client=new MongoClient('mongodb: / / localhost:27017 / mydatabase');

[0228] The third step is to get the button collection. The following code gets the button collection named buttons:

[0229] JavaScript

[0230] const db = client.db();

[0231] const buttonsCollection=db.collection('buttons');

[0232] The fourth step is to create a new button document. The following code creates a new button document, which contains the following information:

[0233] page_id: The ID of the page to which the button belongs

[0234] button_id: The unique identifier of the button

[0235] name: button name

[0236] description: Button description

[0237] apis: array of APIs triggered by the button

[0238]

[0239] The fifth step is to insert the new button document into the button collection. The following code inserts the new button document into the button collection:

[0240]

[0241]

[0242] The above code will create a new button document in the Buttons collection, containing the following information:

[0243]

[0244] The _id field is a unique identifier for the button document. The page_id field stores the ID of the page to which the button belongs. The button_id field stores the unique identifier for the button. The name field stores the button name. The description field stores the button description. The apis field stores an array of APIs that the button triggers.

[0245] This is just one example of creating a MongoDB button collection. There are many other ways to do this depending on your specific needs.

[0246] Terminology explanation:

[0247] NoSQL: non-relational database;

[0248] MongoDB: A NoSQL database.

[0249] Driver: software used to connect to and interact with the database;

[0250] Database: Software used to store and manage data;

[0251] Collection: A container for storing data in MongoDB;

[0252] Document: The unit of data storage in MongoDB;

[0253] Field: an attribute in a document that stores data;

[0254] Insert: add data to the database;

[0255] Unique Identifier: A field used to identify a unique record in a database.

[0256] In an optional embodiment of the present invention, the step of storing application programming interface information for the application programming interface through the application programming interface collection function of the non-relational database includes:

[0257] Creating an application programming interface document for the application programming interface information;

[0258] An application programming interface set is created, and the application programming interface document is stored in the application programming interface set.

[0259] Exemplarily, storing the button information for the page button through the button collection function of the non-relational database may be implemented in the following manner.

[0260] The first step is to import the MongoDB driver

[0261] JavaScript

[0262] const MongoClient=require('mongodb').MongoClient;

[0263] This code imports the MongoDB driver for Node.js to connect to and interact with the MongoDB database.

[0264] The second step is to establish a connection with the MongoDB database

[0265] JavaScript

[0266] const client=new MongoClient('mongodb: / / localhost:27017 / mydatabase');

[0267] This code establishes a connection to a MongoDB database named mydatabase running on your local machine.

[0268] Step 3: Get the API set

[0269] JavaScript

[0270] const db = client.db();

[0271] const apisCollection=db.collection('apis');

[0272] This code gets the API collection named apis. The API collection is used to store API documentation.

[0273] Step 4: Create a new API document

[0274]

[0275] This code creates a new API document with the following information:

[0276] page_id: The ID of the page to which the button belongs

[0277] button_id: The button ID that triggers the API

[0278] api_id: unique identifier of the API

[0279] url: URL of the API

[0280] method: HTTP method of the API (e.g. GET, POST, PUT, DELETE)

[0281] description: description of the API

[0282] Step 5: Insert the new API document into the API collection

[0283]

[0284] This code inserts the new API documentation into the API collection.

[0285] To insert API documentation into the API collection, you can use the following code:

[0286]

[0287]

[0288] It should be noted that the above examples are only examples. Those skilled in the art may use other codes to implement the storage of button information for the page buttons through the button collection function of the non-relational database, and the storage of application programming interface information for the application programming interface through the application programming interface collection function of the non-relational database to construct a database. This is not limited to the embodiments of the present invention.

[0289] The embodiment of the present invention uses MongoDB's flexible data model to design three collections for pages, buttons, and APIs, respectively, to meet the complex hierarchical structure and relationship. Through nested documents and references, data consistency and query efficiency are guaranteed. Not only can the API information of pages and their buttons be efficiently managed and retrieved, but also good scalability and flexibility can be provided to adapt to possible changes in future needs.

[0290] In an optional embodiment of the present invention, it also includes:

[0291] When it is determined that the system website is invalid through the uniform resource locator information, or when it is determined that the application programming interface is invalid through the application programming interface information, the web page information file or routing file for the system website is re-acquired.

[0292] In a specific implementation, the embodiment of the present invention can be applied to a data block construction system for an enterprise information management system. The data block construction system includes an automatic detection module. The automatic detection module can simulate the access situation after each access to the data in the database. If the uniform resource locator information source code of the page of the system website cannot be obtained, the page is considered invalid. If the API return status code in the application programming interface information is inconsistent with the data in the database when submitting data, the API is considered invalid. The invalid data is re-acquired, that is, the web page information file or routing file for the system website is re-acquired, thereby realizing automatic detection and repair of the database.

[0293] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0294] Reference Figure 4 , shows a structural block diagram of a database construction device provided in an embodiment of the present invention, which may specifically include the following modules:

[0295] The uniform resource locator information generating module 401 is used for parsing the web page information file or the routing file to generate the uniform resource locator information for the system website when it is determined that the web page information file or the routing file for the system website is obtained;

[0296] The database construction module 402 is used to scan the application programming interface of the page button of the system website, and when the application programming interface is monitored, the uniform resource locator information is stored through the page collection function of the non-relational database, and the button information for the page button is stored through the button collection function of the non-relational database, and the application programming interface information for the application programming interface is stored through the application programming interface collection function of the non-relational database to build a database.

[0297] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0298] In addition, an embodiment of the present invention further provides an electronic device, including: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the various processes of the above-mentioned database construction method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0299] The embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, each process of the above-mentioned database construction method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0300] Figure 5 A schematic diagram of the hardware structure of an electronic device for implementing various embodiments of the present invention.

[0301] The electronic device 500 includes but is not limited to: a radio frequency unit 501, a network module 502, an audio output unit 503, an input unit 504, a sensor 505, a display unit 506, a user input unit 507, an interface unit 508, a memory 509, a processor 510, and a power supply 511. Those skilled in the art will appreciate that Figure 5 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and the electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. In the embodiments of the present invention, the electronic device includes but is not limited to a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted terminal, a wearable device, and a pedometer.

[0302] It should be understood that in the embodiment of the present invention, the radio frequency unit 501 can be used for receiving and sending signals during information transmission or communication. Specifically, after receiving downlink data from the base station, it is sent to the processor 510 for processing; in addition, uplink data is sent to the base station. Generally, the radio frequency unit 501 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, etc. In addition, the radio frequency unit 501 can also communicate with the network and other devices through a wireless communication system.

[0303] The electronic device provides users with wireless broadband Internet access through the network module 502, such as helping users to send and receive emails, browse web pages, and access streaming media.

[0304] The audio output unit 503 can convert the audio data received by the RF unit 501 or the network module 502 or stored in the memory 509 into an audio signal and output it as sound. Moreover, the audio output unit 503 can also provide audio output related to a specific function performed by the electronic device 500 (for example, a call signal reception sound, a message reception sound, etc.). The audio output unit 503 includes a speaker, a buzzer, a receiver, etc.

[0305] The input unit 504 is used to receive audio or video signals. The input unit 504 may include a graphics processor (GPU) 5041 and a microphone 5042. The graphics processor 5041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The processed image frame can be displayed on the display unit 506. The image frame processed by the graphics processor 5041 can be stored in the memory 509 (or other storage medium) or sent via the radio frequency unit 501 or the network module 502. The microphone 5042 can receive sound and can process such sound into audio data. The processed audio data can be converted into a format output that can be sent to a mobile communication base station via the radio frequency unit 501 in the case of a telephone call mode.

[0306] The electronic device 500 also includes at least one sensor 505, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel 5061 according to the brightness of the ambient light, and the proximity sensor can turn off the display panel 5061 and / or the backlight when the electronic device 500 is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), and can detect the magnitude and direction of gravity when stationary, which can be used to identify the posture of the electronic device (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; the sensor 505 can also include a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, etc., which will not be repeated here.

[0307] The display unit 506 is used to display information input by the user or information provided to the user. The display unit 506 may include a display panel 5061, which may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.

[0308] The user input unit 507 can be used to receive input digital or character information, and to generate key signal input related to user settings and function control of the electronic device. Specifically, the user input unit 507 includes a touch panel 5071 and other input devices 5072. The touch panel 5071, also known as a touch screen, can collect the user's touch operation on or near it (such as the user's operation on the touch panel 5071 or near the touch panel 5071 using any suitable object or accessory such as a finger, stylus, etc.). The touch panel 5071 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the contact point coordinates, and then sends it to the processor 510, receives the command sent by the processor 510 and executes it. In addition, the touch panel 5071 can be implemented using multiple types such as resistive, capacitive, infrared and surface acoustic waves. In addition to the touch panel 5071, the user input unit 507 may also include other input devices 5072. Specifically, other input devices 5072 may include but are not limited to a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in detail here.

[0309] Furthermore, the touch panel 5071 may be overlaid on the display panel 5061. When the touch panel 5071 detects a touch operation on or near it, it transmits the information to the processor 510 to determine the type of the touch event. Then, the processor 510 provides a corresponding visual output on the display panel 5061 according to the type of the touch event. Figure 5 In the figure, the touch panel 5071 and the display panel 5061 are used as two independent components to realize the input and output functions of the electronic device. However, in some embodiments, the touch panel 5071 and the display panel 5061 can be integrated to realize the input and output functions of the electronic device, which is not limited here.

[0310] The interface unit 508 is an interface for connecting an external device to the electronic device 500. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, an audio input / output (I / O) port, a video I / O port, a headphone port, etc. The interface unit 508 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the electronic device 500 or may be used to transmit data between the electronic device 500 and an external device.

[0311] The memory 509 can be used to store software programs and various data. The memory 509 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 509 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0312] The processor 510 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. By running or executing software programs and / or modules stored in the memory 509 and calling data stored in the memory 509, it performs various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole. The processor 510 may include one or more processing units; preferably, the processor 510 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 510.

[0313] The electronic device 500 may also include a power supply 511 (such as a battery) for supplying power to each component. Preferably, the power supply 511 may be logically connected to the processor 510 through a power management system, thereby implementing functions such as charging, discharging, and power consumption management through the power management system.

[0314] In addition, the electronic device 500 includes some functional modules not shown, which will not be described in detail here.

[0315] It should be noted that, in this article, the term "includes", "comprising" or any other variation thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0316] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0317] like Figure 6 As shown, in another embodiment provided by the present invention, a computer-readable storage medium 601 is also provided, in which instructions are stored. When the computer-readable storage medium is run on a computer, the computer executes the database construction method described in the above embodiment.

[0318] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation modes, which are merely illustrative rather than restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are within the protection of the present invention.

[0319] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the embodiments of the present invention can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0320] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0321] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0322] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0323] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0324] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, ROM, RAM, magnetic disks, or optical disks.

[0325] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.< / button>

Claims

1. A database construction method, characterized in that: include: When it is determined that a web page information file or a routing file for the system website is obtained, the web page information file or the routing file is parsed to generate uniform resource locator information for the system website; Scan the application programming interface of the page button of the system website, and when the application programming interface is monitored, store the uniform resource locator information through the page collection function of the non-relational database, store the button information for the page button through the button collection function of the non-relational database, and store the application programming interface information for the application programming interface through the application programming interface collection function of the non-relational database to build a database.

2. The method according to claim 1, characterized in that Also includes: When it is determined that the web page information file and the routing file for the system website are not obtained, then obtaining the system access log for the system website; Generate uniform resource locator information for the system website based on the system access log by using a regular expression.

3. The method according to claim 2, characterized in that Also includes: When it is determined that the application programming interface is not monitored, the application programming interface is determined based on the system access log.

4. The method according to claim 1, characterized in that: The step of storing the uniform resource locator information through the page collection function of the non-relational database includes: Importing a driver program, and building a connection relationship with the database based on the driver program; Creating a page document for the uniform resource locator information; A page collection is created, and the page document is stored in the page collection.

5. The method according to claim 4, characterized in that The step of storing the button information for the page button through the button collection function of the non-relational database includes: Creating a button document for the button information; A button set is created, and the button document is stored in the button set.

6. The method according to claim 5, characterized in that The step of storing the API information for the API through the API collection function of the non-relational database comprises: Creating an application programming interface document for the application programming interface information; An application programming interface set is created, and the application programming interface document is stored in the application programming interface set.

7. The method according to claim 1 or 5, characterized in that: Also includes: When it is determined that the system website is invalid through the uniform resource locator information, or when it is determined that the application programming interface is invalid through the application programming interface information, the web page information file or routing file for the system website is re-acquired.

8. The method according to claim 1, characterized in that Also includes: When it is determined that the web page information file and the routing file for the system website are not obtained, the uniform resource locator information is captured from the system website.

9. The method according to claim 3, characterized in that: Also includes: Determine the location and format of the system access log.

10. The method according to claim 3, characterized in that: Also includes: When the data volume of the system access log is greater than a preset threshold, the system access log is split.

11. The method according to claim 3, characterized in that Also includes: When the format of the system access log is not a preset format, a format conversion operation is performed on the system access log.

12. The method according to claim 3, characterized in that Also includes: Characteristics of a request of the application programming interface are determined.

13. A database construction device, characterized in that: include: A uniform resource locator information generation module, for parsing the web page information file or the routing file to generate uniform resource locator information for the system website when it is determined that a web page information file or a routing file for the system website is obtained; A database construction module is used to scan the application programming interface of the page button of the system website, and when the application programming interface is monitored, the uniform resource locator information is stored through the page collection function of the non-relational database, and the button information for the page button is stored through the button collection function of the non-relational database, and the application programming interface information for the application programming interface is stored through the application programming interface collection function of the non-relational database to construct a database.

14. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; The memory is used to store computer programs; The processor is used to implement the method according to any one of claims 1 to 12 when executing the program stored in the memory.

15. A computer-readable storage medium having instructions stored thereon, which, when executed by one or more processors, cause the processors to perform the method according to any one of claims 1 to 12.