A metadata business layer data calling method and system

By encapsulating call annotations and building standardized templates in enterprise application development, the data island problem is solved, efficient management of metadata and unified calls between systems are realized, and the enterprise's informatization construction and rapid response capabilities are improved.

CN118981345BActive Publication Date: 2025-04-01ZHEJIANG POST & TELECOMM
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411472385.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-22
Publication Date
2025-04-01
Estimated Expiration
2044-10-22

AI Technical Summary

Technical Problem

In enterprise application development and management, data dispersed in various business systems lead to data silos, making it difficult to achieve data sharing and integration, and metadata management lacks uniformity and flexibility, which increases human resources costs and learning difficulties.

Method used

By encapsulating call annotations for business data standardized processing in the interface of the business system, a standardized service call template is built, and a unified data model and management is implemented in the metadata layer, the call error rate between different systems is reduced and robustness and compatibility are improved.

Benefits of technology

It realizes efficient quality management of metadata, reduces the metadata call error rate, simplifies application development, and improves the compatibility and flexibility of different business systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118981345B_ABST
    Figure CN118981345B_ABST
Patent Text Reader

Abstract

The present invention discloses a metadata business layer data calling method and system, comprising: configuring multiple API interfaces of the metadata layer, each API interface connects the metadata layer and the corresponding business application layer, and encapsulating a first query annotation in the API interface; configuring a business call template, configuring a call list for each business call module, storing a call annotation of a specified method in the business call template, querying the call list according to the field obtained by the first query annotation to obtain a specified call template; obtaining a business call template hit by a query in the business call template, obtaining corresponding parameters in the metadata layer according to the call annotation corresponding to the business call template, and generating corresponding call classes and methods; encapsulating the call class and method into an invocation object and sending it to a corresponding business application layer interface API, and the corresponding business application layer interface API parses the invocation object for executing the corresponding class and method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of metadata management technology, and in particular to a method and system for retrieving data at the metadata business layer. Background Technology

[0002] In traditional enterprise application development and management, data is often scattered across various business systems, leading to serious data silos and information silos. This hinders data sharing and integration, limiting enterprise IT infrastructure development and business innovation. Furthermore, the high degree of independence and coupling between different business systems results in a lack of flexibility and rapid response capabilities when addressing market changes and business needs.

[0003] Currently, the collection and storage of metadata across different business systems is quite disorganized, and there is no effective oversight of the quality of metadata collected from different business systems. This results in significant human resources being required to maintain both the business application layer and the metadata management layer, increasing human resource costs. Furthermore, manual maintenance of the metadata layer and the business layer may lead to inconsistent standards, and requires a substantial learning curve. Summary of the Invention

[0004] One of the objectives of this invention is to provide a method and system for retrieving metadata business layer data. The method and system encapsulate method call annotations for business data standardization processing in the API of the business system interface. Through the call annotations, the business data can be quickly standardized, and the business-related enterprise metadata can be obtained after standardization. The metadata is then stored in a designated area, thereby achieving efficient and high-quality management of enterprise metadata.

[0005] Another objective of this invention is to provide a method and system for retrieving metadata business layer data. The method and system utilize standardized business call templates built for different business systems, configure relevant call annotations based on these standardized templates, and obtain standardized classes and methods using the call annotations of the standardized templates. These standardized classes and methods are implemented for the metadata, thereby enabling standardized calls from different business systems when retrieving metadata. This reduces the error rate of metadata calls across different systems and improves the robustness of metadata calls across different business systems.

[0006] Another objective of this invention is to provide a method and system for calling data in the metadata business layer. The method and system construct a separate architecture for the metadata layer and the business application layer. By calling annotations and corresponding business call templates, unified calling of different business application layers can be achieved. The metadata layer defines a unified data model, data relationships, data permissions, data versions, and data lifecycle management, which makes application development based on the metadata layer easier. The business application layer does not need to be configured with independent storage space and processing logic, thus improving the compatibility of different business application layers.

[0007] To achieve at least one of the above-mentioned objectives, the present invention further provides a method for retrieving data at the metadata service layer, the method comprising:

[0008] Configure multiple API interfaces for the metadata layer. Each API interface connects the metadata layer and the corresponding business application layer. The API interface encapsulates a first query annotation.

[0009] Configure a business call template, configure a call list for each business call module, and store call annotations for specified methods in the business call template. Query the call list based on the fields obtained from the first query annotation to obtain the specified call template.

[0010] Obtain the business call template that is matched in the query from the business call template, obtain the corresponding parameters in the metadata layer according to the call annotation corresponding to the business call template, and generate the corresponding call class and method;

[0011] The calling class and method are encapsulated into an invocation object and sent to the corresponding business application layer interface API. The corresponding business application layer interface API parses the invocation object to execute the corresponding class and method.

[0012] According to a preferred embodiment of the present invention, the first query annotation includes the @RequestMapping annotation, and a first query method RequestMethod.GET is constructed in the @RequestMapping annotation. The first query method RequestMethod.GET maps a URL to a specified method and returns the specified method or object mapped. The field values ​​configured in the first query method RequestMethod.GET are obtained by identifying and assembling the relevant fields of the corresponding business application layer.

[0013] According to another preferred embodiment of the present invention, the interface includes a field definition annotation @Target. The value of the first query method RequestMethod.GET includes the URL mapped by the call list, which is used to find the call list. After obtaining the relevant fields of the business application layer, the relevant fields of the business application layer are configured with the field definition annotation @Target. A field is declared through the field definition annotation, and the declared field is matched with the fields in the call list for querying and locating the call method name.

[0014] According to another preferred embodiment of the present invention, a standard mapping call annotation @Autowired is configured for each field in the call list. When the field defined by the @Target annotation is matched in the call list, the matched field is automatically wired through the call annotation @Autowired, and the Spring container automatically matches the annotated field of the bean in the metadata layer.

[0015] According to another preferred embodiment of the present invention, in the metadata layer, when the call annotation @Autowired is configured with the hit field, the dependency will be automatically matched in the method parameters corresponding to the field, and the matched array and field will be assembled into the collection by bean injection.

[0016] According to another preferred embodiment of the present invention, the @Repository annotation is configured in the storage space of the metadata layer. Standard fields, classes and methods are added as data access objects of the standard fields and methods through the @Repository annotation, and a mapping rule is established between the standard fields, classes and methods and the fields in the call list. When the @Repository annotation is scanned and identified as an access object, the access object is returned to the API interface.

[0017] According to another preferred embodiment of the present invention, after obtaining business application layer data through the API interface, keywords of the business application layer data are extracted using a keyword recognition algorithm, the keywords are assembled into the field definition annotation @Target, and the same fields existing in the call list are searched according to the field definition annotation @Target.

[0018] According to another preferred embodiment of the present invention, after obtaining the keywords of the business application layer data, a text similarity algorithm is used to calculate the similarity value between the keywords and the fields in the call list, and the call list field with the largest similarity value is selected as the hit field.

[0019] To achieve at least one of the above-mentioned objectives, the present invention further provides a metadata business layer data retrieval system, wherein the system executes the above-mentioned metadata business layer data retrieval method.

[0020] The present invention further provides a computer-readable storage medium storing a computer program, which is executed by a processor to implement the above-described metadata service layer data retrieval method. Attached Figure Description

[0021] Figure 1 The diagram shown is a flowchart illustrating a method for retrieving metadata business layer data according to the present invention. Detailed Implementation

[0022] The following description is intended to disclose the present invention and enable those skilled in the art to implement it. The preferred embodiments described below are merely examples, and other obvious variations will occur to those skilled in the art. The basic principles of the invention defined in the following description can be applied to other embodiments, modifications, improvements, equivalents, and other technical solutions that do not depart from the spirit and scope of the invention.

[0023] It is understood that the term "a" should be understood as "at least one" or "one or more", that is, in one embodiment, the number of an element can be one, while in another embodiment, the number of the element can be multiple, and the term "a" should not be understood as a limitation on the number.

[0024] Please refer to Figure 1 This invention discloses a flowchart of a data invocation method for the metadata business layer. By modifying the processing and invocation methods of the corresponding API interfaces for the metadata layer and the business application layer, this invention establishes standardized data processing rules, enabling different business layers to maintain a relatively unified invocation method when invoking the relevant metadata of the metadata layer. This allows the metadata layer to be effectively and cost-effectively compatible with the signaling forms of different business application layers, and the complex invocation signaling constructed by the business application will not affect the data processing and invocation of the metadata layer.

[0025] Specifically, this invention configures multiple API interfaces in the metadata layer, each API interface establishing a communication connection with its corresponding business application layer. Each API interface is configured with an access method for the business application layer. When initiating access, a standard-specified access URL is inserted into the request link of each API. This invention can employ, but is not limited to, man-in-the-middle techniques to replace the request link URL received by each API interface. In this case, each application layer API interface points to a specified storage area, or a specified method and class.

[0026] It should be noted that, in order to achieve standardized processing of each request link for each API interface, this invention encapsulates a first query annotation for a specified URL in each API interface. This first query annotation includes the `@RequestMapping` annotation, and a first query method `RequestMethod.GET` is constructed within the `@RequestMapping` annotation. This first query method `RequestMethod.GET` maps a URL to a specified method or object and returns the mapped specified method. The value mapped by the first query method `RequestMethod.GET` is obtained by identifying and assembling relevant fields from the corresponding business application layer. It should also be noted that the URL mapped by the first query method `RequestMethod.GET` constructed for the `@RequestMapping` annotation can be specified as the call list `F`, enabling the first query method `RequestMethod.GET` to query and retrieve the call list `F`.

[0027] The mapped field values ​​included in the first query method RequestMethod.GET can be obtained through the request message sent by each business application layer to the API interface. This request message includes a request header and a request method. In this invention, keyword fields are extracted from the request header and request method, and these extracted keyword fields are configured into the RequestMethod.GET method annotated with @RequestMapping, so that they can be used for subsequent list matching operations of these field values. The @RequestMapping annotation is defined in the specified class of the API interface.

[0028] Furthermore, this invention pre-configures a field definition annotation `@Target` in each API interface. This `@Target` annotation can obtain the specified class containing the `@RequestMapping` annotation via Java reflection, and retrieve the class's attributes and methods. Therefore, the `@Target` annotation can obtain the method `RequestMethod.GET` of the specified class via Java reflection, retrieve the field value from `RequestMethod.GET`, and configure the field value to the `@Target` annotation. A comparison method is defined within the `@Target` annotation. This comparison method includes: obtaining the call list `F` obtained from the first query method `RequestMethod.GET`, and comparing the field value with the call method names in the call list `F` to obtain the call method name matched by the field value.

[0029] It is worth mentioning that, in this invention, a mapping relationship between each method name in the call list and a call template is pre-established. The call template includes the called class name, the called method name, the method annotation, the called parameter type, and the return value type required to execute the corresponding method name. This is used to construct the call method associated with the method name. For example, if the called method class name is `load_service`, and a corresponding parameter annotation `@RequestParam` is configured under the `load_service` class name, with parameter type (user id) and return value type (id) configured in the parameter annotation, then a download method based on the user id corresponding to the `load_service` class can be obtained. The parameter annotation `@RequestParam` sends the corresponding user id to the corresponding API interface, thereby realizing a standardized call template call method. It should be noted that the call methods in this invention can include, but are not limited to, GET, POST, PUT, DELETE, and executable methods under related class names, such as methods for storing data from different business layers. This invention will not elaborate on these further.

[0030] In one preferred embodiment of the present invention, a standard mapping annotation `@Autowired` is configured for each method name in the call list. When a field defined by the `@Target` annotation is matched in the call list, the matched field is automatically wired through the `@Autowired` annotation, and the Spring container automatically matches the annotated field in the metadata layer. It should be noted that in the metadata layer, after the `@Autowired` annotation is configured with a matched field, the dependency is automatically injected into the method parameters corresponding to that field, and the matched array and field are wired into the collection via bean injection. In another preferred embodiment of the present invention, the call annotation can be configured as a lifecycle annotation `@Retention`, which can be used to define the lifecycle of the corresponding class and method. The lifecycle annotation can be configured in the metadata layer to define the management lifecycle of specified metadata, thereby effectively improving the management quality of the metadata layer.

[0031] In another preferred embodiment of the present invention, the storage space of the metadata layer can be configured with the @Repository annotation. Standard fields, classes and methods are added through the @Repository annotation as data access objects for the standard fields and methods, and mapping rules are established between the standard fields, classes and methods and the fields in the call list. When the @Repository annotation is scanned and identified as an access object, the access object is returned to the API interface.

[0032] It should be noted that, since the request messages of each business application layer may contain non-standardized field content, after obtaining the request message of the business application layer, the invention uses an algorithm including but not limited to keyword extraction to obtain at least one target keyword, and uses the target keyword as a relevant field of the query annotation. The invention also calculates the text similarity value between the relevant field of the query annotation and all the method names in the call list, and selects the target field with the highest similarity value between all the relevant fields of the query annotation and all the method names in the call list as the hit method name in the call list. The invention then enables the called class of the hit method name, the called method, the method annotation, the called parameter type, and the return value type to the corresponding business application layer's API interface.

[0033] This invention further encapsulates the called class, the called method, method annotations, the called parameter types, and the return type into an `invocation` object. This `invocation` object is used for remote invocation at different business layers. The encapsulation method of the `invocation` object includes: defining an `InvocationHandler`, constructing an `InvocationHandler` interface, injecting the `invoke` method into the `InvocationHandler` interface, and creating a proxy object using the `Proxy.newProxyInstance` method after obtaining the class loader, the list of interfaces implemented by the proxy class, and an `InvocationHandler` instance. An `Invocation` object is encapsulated by passing an `Invocation` object and, but not limited to, a `Method` object and a parameter array to the proxy object. The `invoke` method can be used to execute the relevant processing operations of the `Invocation` object.

[0034] The processes described above with reference to the flowcharts in the embodiments disclosed in this invention can be implemented as computer software programs. The embodiments disclosed in this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication component, and / or installed from a removable medium. When the computer program is executed by a central processing unit (CPU), it performs the functions defined in the methods of this application. It should be noted that the computer-readable medium described above in this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wire segments, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on a computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless segments, wire segments, optical fibers, RF, etc., or any suitable combination thereof.

[0035] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0036] Those skilled in the art should understand that the embodiments of the present invention described above and shown in the accompanying drawings are merely examples and do not limit the present invention. The purpose of the present invention has been fully and effectively achieved. The functions and structural principles of the present invention have been shown and explained in the embodiments. Without departing from the stated principles, the implementation of the present invention may have any variations or modifications.

Claims

1. A metadata business layer data calling method, characterized in that: The method comprises: Configure multiple API interfaces of the metadata layer, each API interface connects the metadata layer and the corresponding business application layer, and the first query annotation is encapsulated in the API interface; Configure a business call list, wherein the call list is configured with multiple call method names, each call method name is configured with a call template, the call annotation of the specified method is stored in the business call template, and the call list is queried according to the field obtained by the first query annotation to obtain the specified call template; Obtain the business call template hit by the query in the call list, obtain the corresponding parameters in the metadata layer according to the call annotation corresponding to the business call template, and generate the corresponding call class and method; Encapsulate the calling class and method into an invocation object and send it to the corresponding business application layer interface API, and the corresponding business application layer interface API parses the invocation object to execute the corresponding class and method; The first query annotation includes a @RequestMapping annotation, and a first query method of RequestMethod.GET is constructed in the @RequestMapping annotation, a URL is mapped to a specified method or object through the first query method RequestMethod.GET, and the mapped specified method is returned, and the field value configured by the first query method RequestMethod.GET is obtained by assembling according to the relevant field identification of the corresponding business application layer; The interface includes a field definition annotation @Target, and the value of the first query method RequestMethod.GET includes the URL mapped by the call list, which is used to search the call list. After the relevant fields of the business application layer are obtained, the field definition annotation @Target is configured for the relevant fields of the business application layer, a field is declared through the field definition annotation, and the declared field is matched with the fields in the call list for query positioning of the call method name; A standard mapped call annotation @Autowired is configured for each field in the call list. When a field assembled by the field definition annotation @Target is hit in the call list, the hit field is automatically assembled through the call annotation @Autowired, and the Spring container automatically matches the annotated field of the bean in the metadata layer.

2. A metadata business layer data calling method according to claim 1, characterized in that: In the metadata layer, when the call annotation @Autowired configures the hit field, the dependency will be automatically matched in the method parameter corresponding to the field, and the matched array and field will be assembled into the collection through bean injection.

3. A metadata business layer data calling method according to claim 1, characterized in that: The @Repository annotation is configured in the storage space of the metadata layer, and standard fields, classes and methods are added as data access objects of the standard fields and methods through the @Repository, and mapping rules between the standard fields, classes, methods and fields in the call list are established. When the @Repository annotation is scanned and identified as an access object, the access object is returned to the API interface.

4. A metadata business layer data calling method according to claim 1, characterized in that: After obtaining the business application layer data through the API interface, a keyword recognition algorithm is used to extract keywords of the business application layer data, the keywords are assembled into the field definition annotation @Target, and the same fields existing in the call list are searched according to the field definition annotation @Target.

5. A metadata business layer data calling method according to claim 1, characterized in that: After the keywords of the business application layer data are obtained, a text similarity algorithm is used to calculate the similarity value between the keywords and the fields in the call list, and the call list field with the largest similarity value is selected as the hit field.

6. A metadata business layer data calling system, characterized in that: The system executes a metadata business layer data calling method as described in any one of claims 1-5 above.

7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement a metadata business layer data calling method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Processing method and device for achieving API calling and system for achieving API

    CN109739573A

  • Interface calling method and device

    CN113626223A