API business automatic classification method, system and electronic device

By analyzing and converting API interface message data, and using keyword recognition and business semantic conversion technologies, automatic classification and recognition of API service categories is realized, the problem of inefficiency in the existing technology is solved, and efficient and accurate API classification is achieved.

CN117992833BActive Publication Date: 2025-03-18北京安胜华信科技有限公司
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410255899.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-06
Publication Date
2025-03-18
Estimated Expiration
2044-03-06

AI Technical Summary

Technical Problem

The existing technology is difficult to quickly identify the business categories and attributes of large-scale APIs, resulting in inefficiency and inability to meet the needs of large-scale automation.

Method used

By analyzing and converting the acquired API interface message data, using preset structure and vocabulary, keyword recognition, weight calculation and business semantic conversion are realized, and the API service type is automatically determined.

Benefits of technology

It realizes automatic classification and identification of API business categories, significantly improves classification efficiency, ensures the accuracy and efficiency of classification, and is suitable for large-scale API classification application scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117992833B_ABST
    Figure CN117992833B_ABST
Patent Text Reader

Abstract

The present application provides an API service automatic classification method, system, electronic device and readable storage medium, which relates to the field of data security. The technical solution parses the message data of the API interface to obtain parsed data, and converts the parsed data into target parsed data of a preset structure; then the target parsed data is subjected to keyword recognition and matching, the keywords in the target parsed data are determined, and the weights of each keyword are determined according to a preset weight word library, and the N keywords arranged in front of the weights of the keywords are marked to obtain the marked target keywords, where N is an integer greater than or equal to 2; finally, the target keywords are converted into corresponding business semantics, and the API business type corresponding to the message data is determined according to the business semantics, which can realize the rapid and accurate classification of a large number of API interfaces and meet the requirements of classification efficiency and quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data security, specifically to an API business automatic classification method, system, and electronic device. Background Technology

[0002] With the rapid development of internet technology, the number of Application Programming Interfaces (APIs) is increasing rapidly. APIs enable different applications and services to communicate and interact with each other, playing a vital role in building digital services. However, for large-scale APIs, quickly identifying their business categories and attributes remains a challenge. Currently, identifying API business categories mainly relies on manually reading the interface documentation, a method that is inefficient and cannot meet the needs of large-scale automation. Summary of the Invention

[0003] This application provides a method, system, and electronic device for automatic API business classification, which can achieve efficient API business classification.

[0004] The technical solution of this application embodiment is as follows:

[0005] In a first aspect, embodiments of this application provide an automatic API service classification method, the method comprising:

[0006] The message data obtained from the API interface is parsed to obtain parsed data, and the parsed data is converted into target parsed data with a preset structure.

[0007] The target parsing data is subjected to keyword identification and matching to determine the keywords in the target parsing data. The weight of each keyword is determined according to a preset weighted word library. The top N keywords in terms of their weights are marked to obtain the marked target keywords, where N is an integer greater than or equal to 2.

[0008] The target keywords are converted into corresponding business semantics, and the API business type corresponding to the message data is determined based on the business semantics.

[0009] In the above technical solution, this application achieves automatic identification by parsing the acquired API interface message data, converting it into data with a preset structure, and then using the parsed data with the preset structure for identification. This technical solution realizes automatic classification and identification of API business categories.

[0010] Compared to existing manual classification methods, the technical solution of this application can significantly improve the efficiency of API business category classification. Specifically, the automatic parsing of message data ensures the neatness and uniformity of structured data, which is beneficial for subsequent technical processing. After being converted into a preset structure, targeted techniques such as keyword recognition can be applied. Automatic keyword recognition and weight calculation assign different importance to different keywords, marking key keywords and reducing the difficulty of subsequent matching. The marked target keywords are then converted into standard business semantics through matching, which reduces ambiguity and improves matching accuracy, achieving automatic, efficient, and accurate API business category classification.

[0011] In some embodiments of this application, parsing the message data of the API interface to obtain parsed data includes:

[0012] Use the preset network packet capture tool to capture the request messages of the API interface;

[0013] The request message is parsed to obtain parsed data.

[0014] In the above technical solution, a pre-set network packet capture tool is used to capture API interface messages. This dynamically obtains the original request messages of the interface during actual operation, containing key information for classification, such as business parameters, reflecting the actual business attributes of the interface. After obtaining the original messages, the messages are parsed, key information is located using pre-set message extraction rules, and the data is converted into a structured format. Message parsing preprocessing filters redundant information and outputs data in the format required for automatic classification. Because message parsing standardizes the expression of key information, it facilitates the processing of application automation technologies. This message capture and parsing technique can obtain a large number of real interface business messages as samples, and by parsing and outputting standardized data structures, it provides effective input for subsequent keyword recognition and business matching technologies. Based on actual messages, it supports subsequent technologies to automatically determine message categories, achieving accurate mapping from messages to categories and improving classification accuracy.

[0015] In some embodiments of this application, before performing keyword identification and matching on the target parsing data to determine the keywords in the target parsing data, the method further includes: constructing an AC automaton based on a preset thesaurus.

[0016] In the above technical solution, an AC automaton is first constructed based on a preset business thesaurus to convert words into state transition machines. Then, the parsed data is matched using the AC automaton. Constructing the AC automaton significantly reduces unnecessary comparisons in subsequent matching queries, directly locking matching terms through transition paths, achieving efficient keyword searching for massive amounts of data. Compared to traversal queries, applying the AC automaton can quickly lock keywords in the target parsed data, thereby greatly shortening matching time and improving keyword recognition efficiency. Efficient keyword recognition provides effective input for subsequent word weight determination and business semantic transformation, ensuring a rapid response in the overall classification process. The step of constructing the AC automaton to achieve rapid matching reduces time consumption by shortening matching time, effectively improving the efficiency of keyword recognition and further classification analysis, and enhancing the real-time performance of the overall solution.

[0017] In some embodiments of this application, the step of performing keyword identification and matching on the target parsed data to determine the keywords in the target parsed data includes:

[0018] The keywords in the target parsed data are extracted using the AC automaton to determine the keywords in the target parsed data.

[0019] In the above technical solution, an AC automaton is used to extract keywords from the parsed data. The AC automaton can directly match keywords through state transition paths, eliminating the need for word-by-word traversal and querying, thus achieving efficient keyword recognition for large-scale parsed data. Applying the AC automaton to quickly extract keywords skips complex data processing and unnecessary string comparisons, directly outputting key information from the target parsed data. This shortens matching time and accelerates keyword acquisition. The rapid and efficient determination of keywords provides effective input for subsequent word weight analysis and business semantic conversion, reducing overall classification time and ensuring real-time classification response. It can be seen that using the AC automaton to achieve rapid keyword extraction, by accelerating matching to obtain key information, effectively optimizes the keyword recognition process and improves the time efficiency of the entire classification scheme.

[0020] In some embodiments of this application, converting the target keyword into corresponding business semantics includes:

[0021] The target keywords are matched using a pre-defined business dictionary to obtain the business semantics corresponding to the target keywords.

[0022] In the above technical solution, a business dictionary matching method is used to convert target keywords into business semantics. Using a predefined business dictionary, abstract keywords can be directly matched to specific business meanings based on the mapping relationships within the dictionary. This bypasses business judgments based on subjective experience and directly obtains the standard business semantics corresponding to the target keywords, achieving automatic conversion from target keywords to business semantics. Obtaining clear business semantics provides a business-oriented basis for subsequent message classification. It can be seen that applying a business dictionary for automatic conversion of target keywords, achieving efficient mapping from target keywords to standard business semantics through direct dictionary matching, standardizes the expression of business semantics, avoids subjective guesswork, and enhances the business conformity of message classification.

[0023] In some embodiments of this application, before matching the target keyword using a preset business dictionary to obtain the business semantics corresponding to the target keyword, the method further includes: selecting the preset business dictionary according to the API business scenario.

[0024] In the above technical solution, before converting the target keywords, a business dictionary corresponding to the business scenario of the API message is selected. Because different business scenarios involve different business semantics, building independent business dictionaries for different domains ensures that the dictionary covers the complete business semantics of that scenario. Using a business dictionary that matches the message scenario for conversion minimizes the possibility of introducing irrelevant semantics, ensuring that keywords are completely mapped to the correct business semantic space and improving the accuracy of the conversion. It can be seen that scenario-oriented selection of a business dictionary for keyword conversion, by constructing an independent semantic space to avoid confusion, enhances the correctness of keyword-to-business semantic conversion, providing a clear and accurate basis for subsequent message classification.

[0025] In some embodiments of this application, after determining the API service type corresponding to the message data based on the business semantics, the method further includes: storing the business semantics and the API service type corresponding to the message data in the ClickHouse library, and using a preset ClickHouse monitoring tool to track the storage process of the ClickHouse library.

[0026] In the above technical solution, after message classification is completed, the classification results, i.e., the business semantics and corresponding business types, are stored in the ClickHouse database. Simultaneously, ClickHouse's built-in monitoring tools are configured to track the storage process. The stored results provide a classification basis for subsequent applications, and monitoring the storage process allows for timely understanding of the database's operational status. ClickHouse supports high-speed writing, enabling rapid persistence of large amounts of classification results; while the built-in monitoring tools can monitor key indicators in real time, quickly detecting and responding to anomalies. The combination of storage and monitoring ensures efficient writing of result data while tracking the database's operational status. It can be seen that this technical approach, through the combination of efficient storage and intelligent monitoring in the ClickHouse database, achieves rapid persistent storage of classification results and tracking of the operational process, satisfying the requirements for result data writing speed while ensuring controllable database status, thus enhancing the data support capabilities of the classification scheme.

[0027] Secondly, embodiments of this application provide an API business automatic classification system, the system comprising:

[0028] The traffic conversion module is used to parse the message data obtained from the API interface to obtain parsed data, and convert the parsed data into target parsed data with a preset structure;

[0029] The keyword tagging module is used to perform keyword recognition and matching on the target parsing data, determine the keywords in the target parsing data, determine the weight of each keyword according to a preset weighted word library, and tag the top N keywords in terms of their weights to obtain the tagged target keywords, where N is an integer greater than or equal to 2.

[0030] The storage module is used to convert the target keywords into corresponding business semantics, and determine the API business type corresponding to the message data based on the business semantics.

[0031] Thirdly, embodiments of this application provide an electronic device, including a processor, a memory, a user interface, and a network interface. The memory is used to store instructions, the user interface and the network interface are used to communicate with other devices, and the processor is used to execute the instructions stored in the memory to cause the electronic device to perform any of the methods provided in the first aspect above.

[0032] Fourthly, embodiments of this application provide a computer-readable storage medium storing instructions that, when executed, perform any of the methods provided in the first aspect above.

[0033] In summary, one or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages:

[0034] 1. This application parses the obtained API interface message data and converts it into data with a preset structure. Then, it uses automated keyword recognition and weight calculation techniques to determine and mark the keywords in the parsed data. Finally, it converts the marked target keywords into standard business semantics, and can automatically determine the API business category corresponding to the message data. This technical solution realizes the automatic classification and recognition of API business categories.

[0035] Compared to existing manual classification methods, the technical solution of this application can significantly improve the efficiency of API business category classification. Specifically, the automatic parsing of message data ensures the neatness and uniformity of structured data, which is beneficial for subsequent technical processing. After being converted into a preset structure, targeted techniques such as keyword recognition can be applied. Automatic keyword recognition and weight calculation assign different importance to different keywords, marking key keywords and reducing the difficulty of subsequent matching. The marked target keywords are then converted into standard business semantics through matching, which reduces ambiguity and improves matching accuracy. Therefore, the technical means of this application are reasonable and appropriate, contributing to the automatic, efficient, and accurate classification of API business categories.

[0036] In large-scale API classification application scenarios, the technical solution of this application can play an important role. Its standardized and automated technical process can achieve rapid and accurate classification of a large number of API interfaces, meeting the requirements for classification efficiency and quality. The automatic API business classification technology of this application can solve the problems of low efficiency and inconsistent classification quality in existing manual classification, and has significant technological advancements.

[0037] 2. This application utilizes a network packet capture tool to capture API interface request messages, and then parses these messages to obtain the target parsed data. This technique enables automatic acquisition and structured conversion of API interface messages. By capturing real-time network messages using a packet capture tool and dynamically monitoring the interface, the technique applies message parsing technology to standardize the message information, extracting key content and structure, and achieving automatic conversion of message data into structured parsed data.

[0038] Compared to traditional manual methods of acquiring and parsing messages, the technical approach of this application can automatically and efficiently acquire dynamic interface messages and parse them into structured data, providing standardized data input for subsequent keyword recognition and business classification. It avoids the complexity and slowness of manual acquisition and parsing, and also improves the standardization of data processing.

[0039] 3. This application employs an AC automaton to extract keywords from target parsed data with a pre-defined structure. Leveraging the AC automaton's efficient keyword matching capabilities, keywords representing business semantics can be quickly and accurately identified from the parsed and normalized data. Specifically, the AC automaton constructs a keyword recognition state machine using a keyword dictionary, performing streaming matching on the parsed data. When the parsed data perfectly matches a keyword in the automaton, the matching word can be quickly determined. Compared to traversal searching, this technique significantly reduces the number of matching queries, thereby greatly improving keyword recognition efficiency. Attached Figure Description

[0040] Figure 1 This is one of the flowcharts illustrating an API business automatic classification method provided in an embodiment of this application;

[0041] Figure 2 This is a second flowchart illustrating an API business automatic classification method provided in one embodiment of this application;

[0042] Figure 3 This is a schematic diagram of the structure of an API business automatic classification system provided in one embodiment of this application;

[0043] Figure 4 This is a schematic diagram of the structure of an electronic device provided in one embodiment of this application. Detailed Implementation

[0044] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments.

[0045] In the description of the embodiments of this application, the words "for example" or "for instance" are used to indicate examples, illustrations, or explanations. Any embodiment or design that is described as "for example" or "for instance" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design options. Rather, the use of the words "for example" or "for instance" is intended to present the relevant concepts in a specific manner.

[0046] In the description of the embodiments of this application, the term "multiple" means two or more. For example, multiple systems means two or more systems, and multiple screen terminals means two or more screen terminals. Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the indicated technical features. Thus, a feature defined with "first" or "second" may explicitly or implicitly include one or more of that feature. The terms "comprising," "including," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.

[0047] With the rapid development of internet technology, application programming interfaces (APIs) are becoming increasingly numerous and complex. APIs allow different applications and services to interact and integrate, playing a crucial role in building the current digital service system. However, when faced with a massive number of APIs of diverse types, how to quickly and accurately identify the business category and attributes corresponding to each API has always been a challenging problem for R&D and operations personnel.

[0048] Currently, API business categories are primarily identified manually by engineers. This typically requires developers to read through the detailed documentation of each API, guessing based on the interface name, parameter settings, and other information to determine the business type the API represents. This manual identification method is inefficient and prone to misjudgments due to personal experience, making it difficult to adapt to the needs of classifying and managing massive amounts of APIs.

[0049] With the accelerated digital transformation of enterprise applications, the number of APIs is exploding. Manual classification has become a serious bottleneck in application development and integration. How to achieve automated and rapid identification of API business categories has become an urgent problem to be solved. This requires the use of automated and intelligent technologies to replace inefficient and unreliable manual judgment and meet the needs of large-scale API classification.

[0050] This application provides an automatic API service classification method, system, electronic device, and readable storage medium. The application parses and converts acquired API interface message data into data with a preset structure, then applies automated keyword recognition and weight calculation techniques to determine and mark keywords in the parsed data. The marked target keywords are then converted into standard business semantics, ultimately automatically determining the API service category corresponding to the message data. This technical solution achieves automatic classification and recognition of API service categories.

[0051] Compared to existing manual classification methods, the technical solution of this application can significantly improve the efficiency of API business category classification. Specifically, the automatic parsing of message data ensures the neatness and uniformity of structured data, which is beneficial for subsequent technical processing. After being converted into a preset structure, targeted techniques such as keyword recognition can be applied. Automatic keyword recognition and weight calculation assign different importance to different keywords, marking key keywords and reducing the difficulty of subsequent matching. The marked target keywords are then converted into standard business semantics through matching, which reduces ambiguity and improves matching accuracy. Therefore, the technical means of this application are reasonable and appropriate, contributing to the automatic, efficient, and accurate classification of API business categories.

[0052] In large-scale API classification application scenarios, the technical solution of this application can play an important role. Its standardized and automated technical process can achieve rapid and accurate classification of a large number of API interfaces, meeting the requirements for classification efficiency and quality. The automatic API business classification technology of this application can solve the problems of low efficiency and inconsistent classification quality in existing manual classification, and has significant technological advancements.

[0053] It's important to note that with the widespread adoption of microservice architectures, enterprise application systems contain a large number of APIs with diverse business functions. The sheer number and complexity of these APIs create a pressing need for automated classification and identification by enterprise API management platforms, development and testing teams, and operations departments. This technical solution enables intelligent and automated classification of large-scale, heterogeneous APIs. It can be widely applied to various scenarios, including enterprise-level API management platforms, development and testing platforms, and API monitoring systems, helping to improve the efficiency of API management, development, and testing, achieving refined monitoring, and supporting API system architecture optimization. This solution addresses the inefficiency of manually classifying APIs one by one in these scenarios, achieving intelligent and efficient API classification and automatically determining the business type and attributes of each API. This is of great significance for building an efficient and reliable enterprise-level API system.

[0054] The technical solutions provided in the embodiments of this application will be further described below with reference to the accompanying drawings.

[0055] Reference Figure 1 , Figure 1 This is one of the flowcharts illustrating an API service automatic classification method provided in an embodiment of this application. The API service automatic classification method is applied to an API service automatic classification system and is executed by a processor in an electronic device or a readable storage medium. The API service automatic classification method includes steps S100, S200, and S300.

[0056] Step S100: Parse the message data of the API interface to obtain parsed data, and convert the parsed data into target parsed data with a preset structure;

[0057] Specifically, message data refers to the request messages generated by the API interface during its operation, which contain the interface's key business information parameters. A request message is a data packet sent to the server when the interface is invoked, carrying the business input parameters required for the interface's operation. The approach proposed in this technical solution—parsing the acquired API interface message data and converting it into a preset structure—aims to achieve standardized processing of message information. Message parsing achieves message standardization by extracting key content from the message data and organizing it into structured data. Key information such as business parameters and interface names contained in the message constitutes the key content of the message data. Formatted data such as JSON and XML constitutes structured data. This systematizes and structures the originally unstructured and scattered message information, facilitating subsequent processing using automated techniques.

[0058] The preset data structure further formats the parsed message data, transforming it into a customized, unified format to meet the input requirements of the automatic classification technology solution. Predefined structured formats such as JSONschema constitute this customized, unified format. This process transforms message information from unstructured to structured and then to the preset format, ensuring that the key content of the message data is presented in a standardized structure, laying the foundation for subsequent core technologies such as keyword extraction and business matching. This message parsing and conversion technology plays a crucial role in effectively acquiring key information from message data and achieving automatic message processing and parsing.

[0059] Based on the above embodiments, as an optional embodiment, please refer to... Figure 2 , Figure 2 This is a second flowchart illustrating an API service automatic classification method provided in one embodiment of this application. The method involves parsing the message data from the obtained API interface to obtain parsed data, including but not limited to the following steps:

[0060] Step 110: Use a preset network packet capture tool to capture the request messages of the API interface;

[0061] Specifically, message data refers to the request messages generated by the API interface during its operation, which contain the interface's key business information parameters. A request message is a data packet sent to the server when the interface is invoked, carrying the business input parameter information required for the interface to run. The approach proposed in this technical solution—parsing the acquired API interface message data and converting it into a preset structure—is to achieve standardized processing of message information.

[0062] The message parsing process extracts key information from message data, such as business parameters and interface names, and organizes it into structured data, such as JSON or XML, thus standardizing the message. This transforms the originally unstructured and scattered message information into a systematic and structured format, facilitating subsequent processing using automated technologies. The preset data structure further formats the parsed message data into a customized, unified format, such as JSONschema, to meet the input requirements of automatic classification solutions. This process transforms message information from unstructured to structured and then to a preset format, presenting key information in a standardized structure, laying the foundation for subsequent core technologies such as keyword extraction and business matching. This message parsing and conversion technology plays a crucial role in effectively acquiring key information from message data and achieving automated message processing and parsing.

[0063] Step 120: Parse the request message to obtain parsed data.

[0064] Specifically, in this technical solution, the obtained request message is parsed to obtain parsed data. This is to transform the complex raw message into a structured format and extract key information for classification. The raw message refers to the complete request message generated by the interface at runtime. Message parsing, by defining message extraction rules, locates key information such as business parameters and interface names in the message and organizes it into a structured data format, such as XML or JSON. Message extraction rules are the parsing rules used to extract key data from the message. Business parameters refer to the business data contained in the message. Interface names refer to the interface identifier corresponding to the message. XML or JSON are structured text formats with hierarchical structure and semantic tags. This filters redundant information in the message and extracts key content that is meaningful for determining the business category. After obtaining the standardized parsed data, it can be input into the subsequent keyword recognition and business matching technology modules. This message parsing step realizes the transformation from complex raw messages to concise parsed data, preprocesses the interface message, and outputs data in a format that meets the input requirements of the automatic classification scheme, providing support for the subsequent implementation of key technologies.

[0065] Based on the above embodiments, as an optional embodiment, before performing keyword identification and matching on the target parsing data to determine the keywords in the target parsing data, the method further includes constructing an AC automaton based on a preset thesaurus.

[0066] Specifically, before keyword recognition and matching, an AC automaton is first constructed based on a pre-set thesaurus. The purpose is to leverage the efficient matching capabilities of the AC automaton to quickly find keywords in the parsed data. The pre-set thesaurus contains a set of words related to the business domain. Based on the word content, an AC state transition machine is constructed, transforming it into a tree structure containing various possible matching paths. During keyword recognition, the AC automaton is directly used to perform a streaming scan of the parsed data, searching for matching items through state transitions. When the state transition path perfectly matches, the matching keyword is locked. Compared to traversal searching, the AC automaton can significantly reduce unnecessary queries. Applying the AC automaton to quickly match keywords in the parsed data improves the efficiency of subsequent keyword recognition and meets the needs of efficient processing of massive amounts of data. This step of constructing the AC automaton to prepare for keyword matching lays the foundation for the smooth progress of subsequent recognition and matching.

[0067] Based on the above embodiments, as an optional embodiment, the step of performing keyword identification and matching on the target parsed data to determine the keywords in the target parsed data includes:

[0068] The keywords in the target parsed data are extracted using the AC automaton to determine the keywords in the target parsed data.

[0069] Specifically, this technical solution employs an AC automaton to extract keywords from target parsed data with a pre-defined structure, aiming to achieve efficient keyword matching and recognition of the parsed data. Using the constructed AC automaton, the parsed data is input in a streaming manner, and the AC automaton begins matching according to the state transition path. When the path matches perfectly, the matching keyword is obtained. Compared to word-by-word traversal and querying, this method eliminates a large amount of unnecessary query and comparison work, directly and quickly locking in matching terms through the state transition path. Applying the AC automaton to efficiently extract keywords from massive amounts of parsed data improves the overall efficiency of the keyword recognition process. After obtaining the keywords from the parsed data, subsequent word weight annotation and business conversion analysis can be performed. This AC automaton accelerates the keyword extraction step, playing a key role in improving the speed of keyword recognition.

[0070] Step 200: Perform keyword identification and matching on the target parsing data to determine the keywords in the target parsing data, determine the weight of each keyword according to the preset weight word library, and mark the N keywords with the highest weights to obtain the marked target keywords, where N is an integer greater than or equal to 2.

[0071] Specifically, this technical solution requires keyword identification and tagging of the target parsed data. The target parsed data refers to the structured data obtained after parsing the original message information in the preceding steps. Keyword identification and matching involves using pre-built AC automata and other methods to efficiently match and query keywords in the target parsed data, accurately identifying the keywords needed for business classification. Determining keyword weights is to evaluate the impact of different keywords on the final classification result. The weight values ​​are set based on a pre-built weighted vocabulary, which stores keywords and their corresponding weight values. Tagging keywords involves selecting the top N keywords with higher weights based on their weight ranking and performing special processing, such as adding tags, for subsequent focused citation. This entire process extracts effective keyword information for classification from massive amounts of parsed data, providing input for subsequent semantic transformation and final classification judgment.

[0072] For example, keyword identification and matching are performed on the target parsed data to determine the keywords in the target parsed data. The weight of each keyword is determined according to a preset weighted vocabulary. The top N keywords with the highest weights are then marked to obtain the marked target keywords, where N is an integer greater than or equal to 2.

[0073] Based on the above embodiments, as an optional embodiment, the step of converting the target keyword into corresponding business semantics includes:

[0074] The target keywords are matched using a pre-defined business dictionary to obtain the business semantics corresponding to the target keywords.

[0075] Specifically, this technical solution uses a business dictionary to match and convert tagged target keywords into corresponding business semantics, aiming to transform abstract keywords into concrete business meanings. The business dictionary predefines the correspondence between keywords and standard business semantics. By inputting tagged target keywords and matching them against the dictionary, the corresponding standard business semantics can be found. This assigns a clear business meaning to each keyword, completing the semantic transformation from abstract to concrete. The keywords corresponding to the business semantics provide a basis for subsequent determination of the message's business type. This technique of using a business dictionary to match and transform keywords achieves the transformation from ambiguous keywords to clear business semantics, giving classification judgments a clear business orientation and playing a crucial role in connecting keywords with classified business.

[0076] Based on the above embodiments, as an optional embodiment, before matching the target keyword using a preset business dictionary to obtain the business semantics corresponding to the target keyword, the method further includes: selecting the preset business dictionary according to the API business scenario.

[0077] Specifically, before performing keyword conversion by matching with a business dictionary, this technical solution first selects the corresponding business dictionary based on the API business scenario. This is because the business semantics involved in different business scenarios vary. A business scenario refers to different business application domains. Different business dictionaries are pre-built for different business domains, and the business semantic identifiers between dictionaries are mutually exclusive. The business dictionary contains a vocabulary of mapping relationships between business keywords and standard business semantics. Business semantic identifiers are words or codes used to represent business meanings. During keyword conversion, the corresponding business dictionary is selected for matching based on the business scenario to which the message belongs, thus ensuring that keywords are mapped to accurate business semantics. If the business dictionary is too general, it may introduce irrelevant semantic interference. Applying a targeted business dictionary can improve the accuracy of keyword-to-business semantic conversion. This scenario-oriented business dictionary selection step lays the foundation for accurate keyword conversion by ensuring the uniformity of the semantic space.

[0078] Step 300: Convert the target keywords into corresponding business semantics, and determine the API business type corresponding to the message data based on the business semantics.

[0079] Specifically, this technical solution converts the tagged target keywords into corresponding business semantics, and then determines the API business corresponding to the message based on the business semantics. This is to achieve a classification judgment from abstract keywords to specific business categories. The tagged target keywords are the business keywords obtained through keyword recognition and weight labeling. Business semantics refers to the business meaning represented by the keywords. The correspondence between keywords and business semantics is established through a business dictionary. The business dictionary consists of predefined keywords and a standard business semantic vocabulary. Building a business dictionary first requires collecting keywords in the business domain, which can come from business documents, historical data, domain experts, etc. Simultaneously, it is necessary to determine all standard business semantic vocabularies for the domain. Then, the collected keywords are processed, including synonym merging and word standardization, to form a standardized keyword library.

[0080] The correspondence between keywords and business semantics requires professional personnel to annotate and determine the keywords. This involves manually judging the standard business semantics represented by each keyword, forming a mapping from keywords to business semantics. The compiled annotated mappings form a business dictionary, serving as a bridge between keywords and semantics, supporting subsequent automatic conversion. If new keywords or business semantics emerge, the business dictionary needs to be updated promptly to ensure the completeness and accuracy of the mapping. The marked target keywords are matched to the semantics in the business dictionary, completing the conversion from abstract words to specific business meanings. In this way, the business semantics clearly points to a domain, providing a basis for determining the business category of a message. Based on the business semantics, the API business type corresponding to the message can be determined. The API business type is the specific business category represented by the message. Thus, from keyword extraction to business semantic conversion and final classification, a process of progressive semantic abstraction of messages is achieved. This technique can automate the business classification of a large number of messages, improving classification accuracy through semantic conversion and matching, playing a key role in achieving the classification task.

[0081] Based on the above embodiments, as an optional embodiment, after determining the API service type corresponding to the message data according to the business semantics, the method further includes: storing the business semantics and the API service type corresponding to the message data in the ClickHouse library, and using a preset ClickHouse monitoring tool to track the storage process of the ClickHouse library.

[0082] Specifically, this technical solution uses ClickHouse's monitoring tools to track the storage status of the ClickHouse database. The aim is to understand the real-time storage status of the ClickHouse database and provide a basis for subsequent optimization. ClickHouse is a columnar database management system for online analytical processing (OLAP). It uses columnar storage, storing the contents of the same field together. During queries, only the columns needed for the query are accessed, effectively compressing data and accelerating searches. Furthermore, ClickHouse supports building distributed database clusters, and storage capacity and computing power can be linearly increased by expanding server nodes. ClickHouse has a built-in system monitoring tool that can view information such as storage usage and write speed of each partition table in the database. Using this monitoring tool, regular data collection is configured to track statistical data of key indicators. When storage capacity approaches a threshold or write speed decreases, an alert is issued. Database administrators can then optimize queries on problematic tables or add more storage resources. This method of monitoring ClickHouse storage status ensures continuous monitoring of database performance indicators, timely detection and adjustment of existing problems, and guarantees the stable and efficient operation of ClickHouse.

[0083] like Figure 4 As shown in the figure, this application embodiment provides an API business automatic classification system 100. The API business automatic classification system 100 parses the message data of the API interface through the traffic conversion module 110 to obtain parsed data, and converts the parsed data into target parsed data with a preset structure; then, through the keyword tagging module 120, the target parsed data is identified and matched to determine the keywords in the target parsed data, and the weight of each keyword is determined according to the preset weight word library, and the top N keywords in the keyword weight are marked to obtain the marked target keywords, where N is an integer greater than or equal to 2; finally, through the storage module 130, the target keywords are converted into corresponding business semantics, and the API business type corresponding to the message data is determined according to the business semantics.

[0084] It should be noted that the traffic conversion module 110 is connected to the keyword tagging module 120, and the keyword tagging module 120 is connected to the storage module 130. The above-mentioned API business automatic classification method is applied to the API business automatic classification system 100. The API business automatic classification system 100 realizes the technical solution of automatically classifying API interface messages and storing the results in ClickHouse through three key modules: message parsing, keyword tagging, and business conversion.

[0085] It should also be noted that the system provided in the above embodiments is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the system and method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.

[0086] This application also discloses an electronic device. (See reference...) Figure 4 , Figure 4 This is a schematic diagram of the structure of an electronic device disclosed in an embodiment of this application. The electronic device 500 may include: at least one processor 501, at least one network interface 504, a user interface 503, a memory 505, and at least one communication bus 502.

[0087] The communication bus 502 is used to enable communication between these components.

[0088] The user interface 503 may include a display screen and a camera. Optionally, the user interface 503 may also include a standard wired interface and a wireless interface.

[0089] The network interface 504 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface).

[0090] The processor 501 may include one or more processing cores. The processor 501 connects to various parts of the server using various interfaces and lines, and performs various server functions and processes data by running or executing instructions, programs, code sets, or instruction sets stored in memory 505, and by calling data stored in memory 505. Optionally, the processor 501 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 501 may integrate one or a combination of several of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the content required for display; and the modem handles wireless communication. It is understood that the modem may also not be integrated into the processor 501 and may be implemented as a separate chip.

[0091] The memory 505 may include random access memory (RAM) or read-only memory. Optionally, the memory 505 may include non-transitory computer-readable storage medium. The memory 505 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 505 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the above-described method embodiments, etc.; the data storage area may store data involved in the above-described method embodiments, etc. Optionally, the memory 505 may also be at least one storage system located remotely from the aforementioned processor 501. (Refer to...) Figure 4 The memory 505, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and an application program for an automatic API business classification method.

[0092] exist Figure 4 In the illustrated electronic device 500, the user interface 503 is mainly used to provide an input interface for the user and to acquire user input data; while the processor 501 can be used to call an application program stored in the memory 505 for an API business automatic classification method. When executed by one or more processors 501, the electronic device 500 performs one or more methods as described in the above embodiments. It should be noted that, for the foregoing method embodiments, for the sake of simplicity, they are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, because according to this application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0093] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0094] In the various embodiments provided in this application, it should be understood that the disclosed system can be implemented in other ways. For example, the system embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some service interface; the indirect coupling or communication connection between systems or units may be electrical or other forms.

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

[0096] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0097] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned memory includes various media capable of storing program code, such as USB flash drives, portable hard drives, magnetic disks, or optical disks.

[0098] The above are merely exemplary embodiments of this disclosure and should not be construed as limiting the scope of this disclosure. Any equivalent changes and modifications made in accordance with the teachings of this disclosure shall still fall within the scope of this disclosure. Other embodiments of this disclosure will readily conceive of those skilled in the art upon consideration of the specification and the disclosure of practical truths.

[0099] This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not described in this disclosure. The specification and embodiments are to be considered exemplary only, and the scope and spirit of this disclosure are defined by the claims.

Claims

1. A method for automatically classifying API services, characterized in that: The method comprises: Parsing the message data obtained from the API interface to obtain parsed data, and converting the parsed data into target parsed data of a preset structure; Perform keyword recognition and matching on the target parsed data, determine the keywords in the target parsed data, determine the weights of each keyword according to a preset weight word library, and mark the top N keywords in the keyword weights to obtain the marked target keywords, where N is an integer greater than or equal to 2; The target keyword is converted into corresponding business semantics, and the API business type corresponding to the message data is determined according to the business semantics; the converting of the target keyword into the corresponding business semantics includes: matching the target keyword with a preset business dictionary to obtain the business semantics corresponding to the target keyword; before matching the target keyword with a preset business dictionary to obtain the business semantics corresponding to the target keyword, it also includes: selecting the preset business dictionary according to the API business scenario.

2. The method according to claim 1, characterized in that The step of parsing the message data of the API interface to obtain parsed data includes: Use the preset network packet capture tool to capture the request message of the API interface; The request message is parsed to obtain parsed data.

3. The method according to claim 1, characterized in that Before performing keyword recognition and matching on the target parsed data and determining the keywords in the target parsed data, the method further includes: constructing an AC automaton according to a preset vocabulary.

4. The method according to claim 3, characterized in that The performing keyword recognition and matching on the target parsed data to determine the keywords in the target parsed data includes: The keywords in the target parsed data are extracted by the AC automaton to determine the keywords in the target parsed data.

5. The method according to claim 1, characterized in that After determining the API business type corresponding to the message data according to the business semantics, it also includes: storing the business semantics and the API business type corresponding to the message data in a ClickHouse library, and using a preset ClickHouse monitoring tool to track the storage process of the ClickHouse library.

6. An API business automatic classification system, characterized in that: The system comprises: A traffic conversion module (110), used to parse the message data obtained from the API interface to obtain parsed data, and convert the parsed data into target parsed data of a preset structure; A keyword marking module (120) is used to perform keyword recognition and matching on the target parsed data, determine the keywords in the target parsed data, determine the weight of each keyword according to a preset weight word library, and mark the top N keywords in the keyword weights to obtain the marked target keywords, where N is an integer greater than or equal to 2; A storage module (130) is used to convert the target keyword into corresponding business semantics, and determine the API business type corresponding to the message data according to the business semantics; the converting of the target keyword into the corresponding business semantics includes: matching the target keyword with a preset business dictionary to obtain the business semantics corresponding to the target keyword; before matching the target keyword with a preset business dictionary to obtain the business semantics corresponding to the target keyword, it also includes: selecting the preset business dictionary according to the API business scenario.

7. An electronic device, characterized in that: The electronic device (500) comprises a processor (501), a memory (505), a user interface (503), a communication bus (502) and a network interface (504), wherein the processor (501), the memory (505), the user interface (503) and the network interface (504) are respectively connected to the communication bus (502), the memory (505) is used to store instructions, the user interface (503) and the network interface (504) are used to communicate with other devices, and the processor (501) is used to execute the instructions stored in the memory (505) so that the electronic device (500) executes the method according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed, the method according to any one of claims 1 to 5 is performed.

Citation Information

Patent Citations

  • Message identification method and device, computer system and readable storage medium

    CN113014558A

  • Message transmission method and device

    CN114025015A

  • User classification method and device, computer equipment, storage medium and program product

    CN116737929A