Metadata service layer data calling method and system

By encapsulating call annotations and building standardized templates in the business system interfaces, the problem of managing metadata in different business systems is solved, achieving efficient quality management and standardized calling of metadata, and improving the system's compatibility and flexibility.

CN118981345AActive Publication Date: 2024-11-19ZHEJIANG POST & TELECOMM
View PDF 6 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In enterprise application development and management, the dispersal of metadata across different business systems leads to data silos and information silos, making it difficult to achieve data sharing and integration. Furthermore, the lack of effective metadata management in existing technologies results in high human resource costs and inconsistent standards.

Method used

By encapsulating call annotations for standardized business data processing in the interfaces of business systems, standardized business call templates are built, and a unified data model and management mechanism are defined in the metadata layer. This enables efficient quality management and standardized calls of metadata, reduces error rates, and improves robustness and compatibility.

Benefits of technology

It enables rapid and standardized processing and efficient management of metadata, reduces the error rate in metadata calls, improves the compatibility and flexibility of different business systems, and reduces the demand for human resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118981345A_ABST
    Figure CN118981345A_ABST
Patent Text Reader

Abstract

The invention discloses a metadata service layer data calling method and system, and the method comprises the steps: configuring a plurality of api interfaces of a metadata layer, enabling each api interface to be connected with the metadata layer and a corresponding service application layer, and packaging a first query annotation in the api interface; configuring a service calling template, configuring a calling list for each service calling module, storing a calling annotation of a specified method in the service calling template, and querying the calling list according to a field obtained by the first query annotation to obtain a specified calling template; obtaining a service calling template hit by query in the service calling templates, obtaining a corresponding parameter in the metadata layer according to a calling annotation corresponding to the service calling template, and generating a corresponding calling class and method; packaging the calling class and method into an intrusion object, and sending the intrusion object to a corresponding service application layer interface api, wherein the corresponding service application layer interface api analyzes the intrusion object so as to execute the corresponding class and method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of metadata management technology, and in particular to a metadata business layer data calling method and system. Background Art

[0002] In traditional enterprise application development and management, data is often scattered across various business systems, resulting in serious data and information island problems, making it difficult to achieve data sharing and integration, and limiting the company's informatization construction and business innovation. In addition, due to the high degree of independence and coupling between different business systems, companies lack flexibility and rapid response capabilities when dealing with market changes and business needs.

[0003] In the current existing technology, the collection and storage of metadata in different business systems is relatively messy, and there is no effective supervision on the quality of metadata collected by different business systems, so that the business application layer and the metadata management layer require a large amount of human resources to maintain, thereby increasing the cost of human resources. In addition, manual maintenance of the metadata layer and the business layer may have the problem of inconsistent standards, and manual maintenance requires a large learning cost. Summary of the invention

[0004] One of the inventive objectives of the present invention is to provide a metadata business layer data calling method and system, which encapsulates method calling annotations for business data standardization processing in the API of the business system interface. Through the calling annotations, rapid standardization processing of the business data can be achieved, and after the standardization processing, business-related enterprise metadata can be obtained, and the metadata is saved in a specified area, thereby realizing efficient and quality management of enterprise metadata.

[0005] Another inventive object of the present invention is to provide a metadata business layer data calling method and system, wherein the method and system construct standardized business calling templates according to different business systems, configure relevant calling annotations according to the standardized business calling templates, and obtain standardized classes and methods using the calling annotations of the standardized templates, wherein the standardized classes and methods are implemented for the metadata, so that when the different business systems call the metadata, standardized calls can be implemented to reduce the error rate of metadata in different system calls and improve the robustness of metadata calls of different business systems.

[0006] Another inventive object of the present invention is to provide a metadata business layer data calling method and system, which constructs a separate architecture for the metadata layer and the business application layer, and realizes unified calling of different business application layers through calling annotations and corresponding business calling templates, wherein the metadata layer defines a unified data model, data relationship, data permission, data version, and data lifecycle management, making application development based on the metadata layer easier, and the business application layer does not need to be configured with independent storage space and processing logic, thereby improving the compatibility of different business application layers.

[0007] In order to achieve at least one of the above-mentioned invention objects, the present invention further provides a metadata business layer data calling method, the method comprising: 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 template, configure a call list for each business call module, store a call annotation of a specified method in the business call template, and query the call list according to the field obtained by the first query annotation to obtain a specified call template; Obtain the business call template hit by the query in the business call template, obtain corresponding parameters in the metadata layer according to the call annotation corresponding to the business call template, and generate corresponding call classes and methods; 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.

[0008] According to one of the preferred embodiments of the present invention, 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 through the first query method RequestMethod.GET, and the mapped specified method or object is returned, and the field value configured by the first query method RequestMethod.GET is assembled according to the relevant field identification of the corresponding business application layer.

[0009] According to another preferred embodiment of the present invention, 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 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, and 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 calling method name.

[0010] According to another preferred embodiment of the present invention, 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 by the call annotation @Autowired, and the Spring container automatically matches the annotated field of the bean in the metadata layer.

[0011] According to another preferred embodiment of the present invention, in the metadata layer, when the calling annotation @Autowired configures the hit field, the dependency will be automatically injected into the method parameter corresponding to the field, and the matched array and field will be assembled into the collection through bean injection.

[0012] 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, and mapping rules between the standard fields, classes, methods and fields in the call list are established, and when the @Repository annotation is scanned and identified as an access object, the access object is returned to the API interface.

[0013] According to another preferred embodiment of the present invention, 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.

[0014] According to another preferred embodiment of the present invention, 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.

[0015] In order to achieve at least one of the above-mentioned invention purposes, the present invention further provides a metadata business layer data calling system, wherein the system executes the above-mentioned metadata business layer data calling method.

[0016] The present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the above-mentioned metadata business layer data calling method. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 Shown is a flowchart of a metadata business layer data calling method of the present invention. DETAILED DESCRIPTION

[0018] The following description is used to disclose the present invention so that those skilled in the art can implement the present invention. The preferred embodiments described below are only examples, and those skilled in the art can think of other obvious variations. The basic principles of the present invention defined in the following description can be applied to other embodiments, variations, improvements, equivalents, and other technical solutions that do not deviate from the spirit and scope of the present invention.

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

[0020] Please refer to Figure 1 The present invention discloses a flowchart of a metadata business layer data calling method. The present invention establishes standardized data processing rules for the metadata layer and the business application layer by modifying the processing and calling methods of the corresponding interface API, so that different business layers can maintain a relatively unified calling method when calling the relevant metadata of the metadata layer, so that the metadata layer can be effectively and cost-effectively compatible with the signaling forms of different business application layers, and the complex calling signaling constructed in the business application will not affect the metadata layer related data processing and calling.

[0021] Specifically, the present invention configures multiple API interfaces in the metadata layer, wherein each API interface establishes a communication connection with the corresponding business application layer, and each API interface is configured with an access method including the business application layer. When initiating access, the request link of each API inserts a standard specified access URL, and the present invention can use, including but not limited to, middleman technology to replace the request link URL received by each API interface. At this time, each application layer API interface points to a specified storage area, or specifies methods and classes.

[0022] It should be noted that in order to achieve standardized processing of each request link by each API interface, the present invention encapsulates the first query annotation of the specified URL in each API interface, wherein the first query annotation includes the @RequestMapping annotation, and constructs the first query method of RequestMethod.GET in the @RequestMapping annotation, maps a URL to a specified method or object through the first query method RequestMethod.GET, and returns the mapped specified method, and the value mapped by the first query method RequestMethod.GET includes the value obtained by identifying and assembling the relevant fields of the corresponding business application layer. It should be noted that the URL mapped by the first query method RequestMethod.GET constructed for the @RequestMapping annotation in the present invention can be specified as the call list F. So that the first query method RequestMethod.GET can query and obtain the call list F.

[0023] 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, wherein the request message includes a request header and a request method, and the present invention extracts the keyword fields for the request header and the request method, and configures the extracted keyword fields to the RequestMethod.GET method of the @RequestMapping annotation, so that it can be used for subsequent list matching operations of the field value. The @RequestMapping annotation is defined in the specified class class of the api interface.

[0024] Furthermore, the present invention pre-configures the field definition annotation @Target in each API interface, wherein the field definition annotation @Target can obtain the specified class class where the @RequestMapping annotation is located through the Java reflection mechanism, and obtain the properties and methods of the class through the specified class calss. Therefore, the field definition annotation @Target can obtain the method of the specified class class: RequestMethod.GET method through the Java reflection mechanism, and obtain the field value from the RequestMethod.GET method, and configure the field value to the field definition annotation @Target. A comparison method is defined in the field definition annotation @Target, and the comparison method includes: obtaining the call list F obtained by the first query method RequestMethod.GET, and comparing and matching the field value with the call method name of the call list F to obtain the call method name hit by the field value.

[0025] It is worth mentioning that in the present invention, a mapping relationship is pre-established with a call template for each call method name in the call list, wherein the call template includes the called class name required to execute the corresponding call method name, the called method name, method annotation, called parameter type and return value type, which are used to form a call method related to the call method name. For example: if the called method class name is load_service, the corresponding parameter annotation @RequestParam is configured under the method class name load_service, and the parameter type (user id) and return value type (id) are configured in the parameter annotation, then a download method based on the user id corresponding to the load_service class can be obtained, and the parameter annotation @RequestParam sends the corresponding user id to the corresponding interface api, thereby realizing a standardized call template call method. It should be noted that the call method in the present invention may include but is not limited to GET, POST, PUT, DELETE, and executable methods under related class names, such as data stored from different business layers, which will not be described in detail in the present invention.

[0026] In one of the preferred embodiments of the present invention, a standard mapped call annotation @Autowired is configured for each call method name in the call list. When the field assembled by the field definition annotation @Target is hit in the call list, the hit field is automatically assembled by the call annotation @Autowired, and the Spring container automatically matches the annotated field of the bean in the metadata layer. It should be noted that in the metadata layer, when the call annotation @Autowired configures the hit field, the dependency is automatically injected into the method parameter corresponding to the field, and the matched array and field of the hit are assembled into the collection by bean injection. In another preferred embodiment of the present invention, the call annotation can be configured as a period definition annotation @Retention, and the life cycle of the corresponding class and method can be defined by the period definition annotation @Retention. The period definition annotation can be configured in the metadata layer to define the management life cycle of the specified metadata, thereby effectively improving the management quality of the metadata layer.

[0027] In another preferred embodiment of the present invention, the @Repository annotation can be configured in the storage space of the metadata layer, and standard fields, classes and methods are added through the @Repository as data access objects of the standard fields and methods, 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.

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

[0029] The present invention further encapsulates the called class, called method, method annotation, called parameter type and return value type into an invocation object, and the invocation object is used for remote calling 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 interface list implemented by the proxy class, and an InvocationHandler instance. An Invocation object is encapsulated by passing in, including but not limited to, a Method object and a parameter array into the proxy object. The invoke method can be used to perform processing operations related to the Invocation object.

[0030] The embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. The embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part, and / or installed from a removable medium. When the computer program is executed by the central processing unit (CPU), the above-mentioned functions defined in the method of the present application are executed. It should be noted that the above-mentioned computer-readable medium of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, but not limited to, a system, device or device of an electrical, magnetic, optical, electromagnetic, infrared segment, or semiconductor, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection with one or more wire segments, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, electrical wire, optical cable, RF, etc., or any suitable combination of the foregoing.

[0031] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a different order from the order marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0032] Those skilled in the art should understand that the embodiments of the present invention described above and shown in the accompanying drawings are only examples and do not limit the present invention. The objectives of the present invention have been fully and effectively achieved. The functional and structural principles of the present invention have been demonstrated and explained in the embodiments. Without departing from the principles, the implementation methods of the present invention may be deformed or modified in any way.

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; 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.

2. A metadata business layer data calling method according to claim 1, characterized in that: The first query annotation includes the @RequestMapping annotation, and constructs the first query method of RequestMethod.GET 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. The field values ​​configured by the first query method RequestMethod.GET are assembled according to the relevant field identification of the corresponding business application layer.

3. A metadata business layer data calling method according to claim 2, characterized in that: The interface includes the 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 find the call list. After the relevant fields of the business application layer are obtained, the relevant fields of the business application layer are configured with the field definition annotation @Target, and 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 calling method name.

4. A metadata business layer data calling method according to claim 1, characterized in that: 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.

5. A metadata business layer data calling method according to claim 4, 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.

6. 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.

7. A metadata business layer data calling method according to claim 4, 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.

8. 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.

9. 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-8 above.

10. 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 8.

Citation Information

Patent Citations

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

    CN109739573A

  • Interface calling method and device

    CN113626223A

  • Interface calling method and micro-service application system applying same

    CN115442372A

  • Data query method, data query device, electronic equipment and storage medium

    CN117009397A

  • Remote scheduling method and system among micro-services

    CN117573395A