A data model-based service publishing method, device and medium
Patent Information
- Application Number
- CN202311167184.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-11
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2043-09-11
AI Technical Summary
[0004]因此,现有传统的Restful服务发布方式受开发部署框架的约束,在开发效率、需求变更、服务运维等层面存在较大的缺陷,难以实现对Restful服务的快速发布、灵活部署、智能运维
[0022]本说明书实施例采用的上述至少一个技术方案能够达到以下有益效果:根据待发布Restful服务的服务需求参数中的入参和出参,进行零代码数据建模,生成待发布Restful服务对应的出入参配置数据模型,多态化的数据模型生成方式极大的简化了数据模型的配置;通过多种接口服务注册方式,对待调用资源进行服务注册,可以通过零代码配置式快速高效地注册服务,为接下来的一键动态发布Restful服务奠定基础;通过零代码配置式对入参出参数据进行建模并动态发布为Restful服务,解决了现有发布Restful服务的复杂性,并通过数据建模、服务注册、服务发布三个步骤零代码的配置方式大大的简化了开发流程,提高了开发体验和开发效率。
Smart Images

Figure CN117270882B_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the field of service publishing technology, and in particular to a service publishing method, device and medium based on a data model. Background Technology
[0002] RESTful is a software architectural style or design style that provides a set of design principles and constraints. It is primarily used for software that facilitates client-server or server-to-server interaction. It uses a URL to represent a unique resource, appends request parameters to the requested resource address, and uses HTTP request methods such as GET, POST, PUT, and DELETE to represent CRUD operations. Software designed based on this style can be more concise, hierarchical, and easier to implement caching mechanisms.
[0003] Deploying a RESTful service is currently extremely complex and cumbersome. First, software developers need to understand the scenario requirements and then write code to implement the RESTful service. This code then needs to be compiled and deployed to the server before the deployment is considered complete. This process relies heavily on specialized software development knowledge, and the deployment process is exceptionally tedious. Second, given the current context of RESTful service deployment, when requirements change after a deployed RESTful service has been implemented, the service must be temporarily suspended. Specialized software developers must then modify the code, conduct comprehensive scenario testing, and finally deploy the code back to the server to redeploy the RESTful service.
[0004] Therefore, the existing traditional RESTful service deployment methods are constrained by the development and deployment framework, and have significant shortcomings in terms of development efficiency, requirement changes, and service operation and maintenance, making it difficult to achieve rapid deployment, flexible deployment, and intelligent operation and maintenance of RESTful services. Summary of the Invention
[0005] This specification provides one or more embodiments of a service publishing method, device, and medium based on a data model to solve the following technical problem: Therefore, the existing traditional RESTful service publishing methods are constrained by the development and deployment framework, and have significant shortcomings in terms of development efficiency, requirement changes, and service operation and maintenance, making it difficult to achieve rapid publishing, flexible deployment, and intelligent operation and maintenance of RESTful services.
[0006] One or more embodiments of this specification employ the following technical solutions:
[0007] This specification provides one or more embodiments of a service publishing method based on a data model. The method includes: obtaining service requirement parameters of a RESTful service to be published, wherein the service requirement parameters include input parameters, output parameters, and resources to be invoked; performing zero-code data modeling based on the input and output parameters in the service requirement parameters of the RESTful service to be published, generating an input / output parameter configuration data model corresponding to the RESTful service to be published; registering the resources to be invoked in the service requirement parameters through the input / output parameter configuration data model and a pre-built API interface service registration management mechanism, generating a resource invocation interface service corresponding to the RESTful service to be published; and dynamically publishing the RESTful service to be published based on dynamic publishing technology and the resource invocation interface service to generate a corresponding RESTful service.
[0008] Furthermore, based on the input and output parameters in the service requirement parameters of the RESTful service to be published, zero-code data modeling is performed to generate the input and output parameter configuration data model corresponding to the RESTful service to be published. Specifically, this includes: determining the input and output parameters in the service requirement parameters of the RESTful service to be published; describing the input and output parameters in the service requirement parameters using JSON Schema to generate an input parameter data model and an output parameter data model; and determining the input and output parameter configuration data model corresponding to the RESTful service to be published based on the input parameter data model and the output parameter data model, wherein the input and output parameter configuration data model is in JSON Schema description format.
[0009] Furthermore, through the input / output parameter configuration data model and the pre-built API interface service registration management mechanism, the resources to be invoked in the service requirement parameters are registered as services to generate the resource invocation interface service corresponding to the RESTful service to be published. Specifically, this includes: determining the system data of the system on which the resource to be invoked and the RESTful service to be published are mounted; determining the resource type to be invoked for the resource to be invoked corresponding to the RESTful service to be published based on the resource to be invoked and the system data, wherein the resource type to be invoked includes in-system resources and non-system resources; and registering the resource to be invoked as a service through the zero-code configuration method corresponding to the API interface service registration management mechanism, based on the resource type to be invoked and the input / output parameter configuration data model, to generate the resource invocation interface service corresponding to the resource to be invoked.
[0010] Furthermore, based on dynamic publishing technology and the resource call interface service, the RESTful service to be published is dynamically published to generate the corresponding RESTful service. Specifically, this includes: determining the configuration URL address of the RESTful service to be published based on the resource call interface service; and using dynamic publishing technology, dynamically publishing the service according to the pre-set general RESTful service template and the configuration URL address to generate the corresponding RESTful service.
[0011] Furthermore, using dynamic publishing technology, services are dynamically published based on a pre-set generic RESTful service template and the configured URL address mentioned above, generating the corresponding RESTful service. Specifically, this includes: pre-setting a generic RESTful service template; using dynamic compilation technology to dynamically load and compile the generic RESTful service template in memory during the runtime of the system corresponding to the RESTful service to be published, generating a compiled RESTful service template; and dynamically publishing the compiled RESTful service template and the configured URL address using dynamic publishing technology to generate the corresponding RESTful service.
[0012] Furthermore, after dynamically publishing the compiled Restful service template and the configured URL address using dynamic publishing technology to generate the corresponding Restful service, the method further includes: during the Restful service call process, routing to the resource call interface service through the configured URL address to call the service resource corresponding to the resource call interface service.
[0013] Furthermore, the system resources include any one or more of class resources, method resources, RPC resources, metadata resources in low-code architecture, and system database resources; the non-system resources include any one or more of non-system database resources, third-party system API resources, coded interface service registration resources, and multi-type resource combination resources.
[0014] Furthermore, before registering the resources to be invoked in the service requirement parameters and generating the resource invocation interface service corresponding to the RESTful service to be published, through the configuration data model and the pre-built API interface service registration management mechanism, the method further includes: pre-setting the API interface service registration method corresponding to each configuration resource, so as to build an API interface service registration management mechanism through multiple API interface service registration methods; when the configuration resource is a class resource, the API interface service registration method is Java Class registration; when the configuration resource is a method resource, the API interface service registration method is Java... Method registration; when the configuration resource is an RPC resource, the API interface service registration method is RPC registration; when the configuration resource is a metadata resource in a low-code architecture, the API interface service registration method is BEF model registration; when the configuration resource is a database resource, the API interface service registration method is external database registration and DBO data table registration; when the configuration resource is a third-party system API resource, the API interface service registration method is ICC service registration; when the configuration resource is a coded interface service registration resource, the API interface service registration method is hard-coded registration; when the configuration resource is a combination of multiple types of resources, the API interface service registration method is interface derivation registration.
[0015] This specification provides one or more embodiments of a data model-based service publishing device, including:
[0016] At least one processor; and,
[0017] A memory communicatively connected to the at least one processor; wherein,
[0018] The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enable the at least one processor to:
[0019] Obtain the service requirement parameters of the RESTful service to be published, wherein the service requirement parameters include input parameters, output parameters, and resources to be invoked; perform zero-code data modeling based on the input and output parameters of the RESTful service to be published, generating an input and output parameter configuration data model corresponding to the RESTful service to be published; register the resources to be invoked in the service requirement parameters through the input and output parameter configuration data model and a pre-built API interface service registration management mechanism, generating a resource invocation interface service corresponding to the RESTful service to be published; dynamically publish the RESTful service to be published based on dynamic publishing technology and the resource invocation interface service to generate the corresponding RESTful service.
[0020] This specification provides one or more embodiments of a non-volatile computer storage medium storing computer-executable instructions, wherein the computer-executable instructions are configured as follows:
[0021] Obtain the service requirement parameters of the RESTful service to be published, wherein the service requirement parameters include input parameters, output parameters, and resources to be invoked; perform zero-code data modeling based on the input and output parameters of the RESTful service to be published, generating an input and output parameter configuration data model corresponding to the RESTful service to be published; register the resources to be invoked in the service requirement parameters through the input and output parameter configuration data model and a pre-built API interface service registration management mechanism, generating a resource invocation interface service corresponding to the RESTful service to be published; dynamically publish the RESTful service to be published based on dynamic publishing technology and the resource invocation interface service to generate the corresponding RESTful service.
[0022] The above-mentioned at least one technical solution adopted in the embodiments of this specification can achieve the following beneficial effects: Based on the input and output parameters in the service requirement parameters of the RESTful service to be published, zero-code data modeling is performed to generate the input and output parameter configuration data model corresponding to the RESTful service to be published. The polymorphic data model generation method greatly simplifies the configuration of the data model; through multiple interface service registration methods, the service to be called resource is registered, and services can be registered quickly and efficiently through zero-code configuration, laying the foundation for the subsequent one-click dynamic publication of RESTful services; by modeling the input and output parameter data and dynamically publishing it as a RESTful service through zero-code configuration, the complexity of existing RESTful service publication is solved, and the development process is greatly simplified through the zero-code configuration method of data modeling, service registration, and service publication, improving the development experience and efficiency. Attached Figure Description
[0023] To more clearly illustrate the technical solutions in the embodiments or prior art of this specification, the drawings used in the description of the embodiments or prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In the drawings:
[0024] Figure 1 A flowchart illustrating a service publishing method based on a data model, provided as an embodiment of this specification;
[0025] Figure 2 A schematic diagram illustrating a data modeling interface provided in an embodiment of this specification;
[0026] Figure 3 A schematic diagram illustrating a service registration interface provided in an embodiment of this specification;
[0027] Figure 4 This is a schematic diagram illustrating a service publishing interface provided in an embodiment of this specification.
[0028] Figure 5 This is a schematic diagram of the structure of a service publishing device based on a data model, provided as an embodiment of this specification. Detailed Implementation
[0029] 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 specification, and not all embodiments. Based on the embodiments of this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this specification.
[0030] RESTful is a software architectural style or design style that provides a set of design principles and constraints. It is primarily used for software that facilitates client-server or server-to-server interaction. It uses a URL to represent a unique resource, appends request parameters to the requested resource address, and uses HTTP request methods such as GET, POST, PUT, and DELETE to represent CRUD operations. Software designed based on this style can be more concise, hierarchical, and easier to implement caching mechanisms.
[0031] Currently, deploying a RESTful service is extremely complex and cumbersome. First, software developers need to understand the scenario requirements and then write code to implement the RESTful service. This code then needs to be compiled and deployed to the server before the deployment is considered complete. This process relies heavily on specialized software development knowledge, and the deployment process is exceptionally tedious. Second, given the current context of RESTful service deployment, when requirements change after a deployed RESTful service has been implemented, the service must be temporarily stopped. Specialized software developers must then modify the code, conduct comprehensive scenario testing, and finally deploy the code back to the server to redeploy the RESTful service. This current development approach lacks unified management of deployed RESTful services, making it impossible to stop and start the service while the system is running.
[0032] Therefore, the existing traditional RESTful service deployment methods are constrained by the development and deployment framework, and have significant shortcomings in terms of development efficiency, requirement changes, and service operation and maintenance, making it difficult to achieve rapid deployment, flexible deployment, and intelligent operation and maintenance of RESTful services.
[0033] This specification provides a service publishing method based on a data model. It should be noted that the execution entity in this specification embodiment can be a server or any device with data processing capabilities. Figure 1 This is a flowchart illustrating a service publishing method based on a data model, as provided in an embodiment of this specification. Figure 1 As shown, the main steps include the following:
[0034] Step S101: Obtain the service requirement parameters of the RESTful service to be published.
[0035] The service requirements parameters include input parameters, output parameters, and resources to be invoked.
[0036] In one embodiment of this specification, the service requirement parameters for publishing a Restful service are first obtained. These service requirement parameters include input parameters, output parameters, and the resource to be invoked.
[0037] Step S102: Based on the input and output parameters in the service requirement parameters of the Restful service to be published, perform zero-code data modeling to generate the input and output parameter configuration data model corresponding to the Restful service to be published.
[0038] In the traditional RESTful service deployment process, the input and output parameters of the RESTful service are deployed by writing code. However, the data volume of the input and output parameters is large, and there are many fields. Coding these parameters requires high coding skills from developers and is a significant workload. Therefore, this specification proposes a zero-code configuration-based data model to describe the data structure of the input and output parameters, based on the input and output parameters in the service requirements parameters of the RESTful service to be deployed.
[0039] Based on the input and output parameters in the service requirement parameters of the RESTful service to be released, zero-code data modeling is performed to generate the corresponding input and output parameter configuration data model for the RESTful service to be released. Specifically, this includes: determining the input and output parameters in the service requirement parameters of the RESTful service to be released; describing the input and output parameters in the service requirement parameters using JSON Schema to generate input parameter data models and output parameter data models; and determining the corresponding input and output parameter configuration data model for the RESTful service to be released based on the input parameter data model and the output parameter data model, wherein the input and output parameter configuration data model is in JSON Schema description format.
[0040] In one embodiment of this specification, the input and output parameters of the service requirement parameters for the RESTful service to be published are determined. For the input and output parameters of the RESTful service, JSON Schema is used to describe the JSON data of the service, generating a data model based on JSON Schema. JSON Schema is a standard JSON string that describes the required data specifications and supports annotations and validation of JSON documents; that is, JSON Schema can be used to verify whether a given JSON string meets the required data format specifications.
[0041] In one embodiment of this specification, Figure 2 This is a schematic diagram illustrating a data modeling interface provided in an embodiment of this specification, such as... Figure 2 As shown, it supports rapid generation of data models through various methods, including business JSON data, BE / VO metadata, manual creation, and Excel import. Furthermore, the generated data models allow viewing the model's JSON Schema code and sample data in JSON structure. This polymorphic data model generation method greatly simplifies data model configuration, laying the foundation for zero-code service registration and one-click dynamic deployment of RESTful services.
[0042] Step S103: By configuring the data model with input and output parameters and the pre-built API interface service registration management mechanism, the resources to be called in the service requirement parameters are registered as services, and the resource call interface service corresponding to the Restful service to be published is generated.
[0043] Through the input / output parameter configuration data model and the pre-built API interface service registration management mechanism, the resource to be invoked in the service requirement parameters is registered as a service, generating the resource invocation interface service corresponding to the RESTful service to be published. Specifically, this includes: determining the system data of the system on which the resource to be invoked and the RESTful service to be published are mounted; determining the resource type to be invoked for the resource to be invoked corresponding to the RESTful service to be published based on the resource to be invoked and the system data, wherein the resource type to be invoked includes system resources and non-system resources; and registering the resource to be invoked as a service through the zero-code configuration method corresponding to the API interface service registration management mechanism, based on the resource type to be invoked and the input / output parameter configuration data model, to generate the resource invocation interface service corresponding to the resource to be invoked.
[0044] In one embodiment of this specification, a unified registration and management mechanism for API interface services is proposed based on a data model obtained from no-code data modeling, realizing integrated management of system resources based on no-code. The mechanism involves determining the system data of the system corresponding to the resource to be invoked and the RESTful service to be published; based on the resource to be invoked and this system data, determining the resource type of the resource to be invoked corresponding to the RESTful service to be published. The resource type includes system resources and non-system resources. System resources include any one or more of class resources, method resources, RPC resources, metadata resources in a low-code architecture, and system database resources. Here, class resources are Java class resources, method resources are Java method resources, and RPC (Remote Procedure Call) is a protocol that requests services from a remote computer program over a network without needing to understand the underlying network technology. Furthermore, due to the diverse needs of users, non-system resources include any one or more of non-system database resources, third-party system API resources, coded interface service registration resources, and combinations of multiple resource types. It should be noted that multi-type resource combination refers to multiple resources that are a combination of multiple resources in the system resources, multiple resources in the non-system resources, or a combination of system resources and non-system resources.
[0045] Before registering the resources to be invoked in the service requirement parameters and generating the resource invocation interface service corresponding to the RESTful service to be published, this method further includes: pre-setting the API interface service registration method for each type of configuration resource, so as to build an API interface service registration management mechanism through multiple API interface service registration methods; when the configuration resource is a class resource, the API interface service registration method is Java Class Registration (JCR); when the configuration resource is a method resource, the API interface service registration method is Java Method Registration; when the configuration resource is an RPC resource, the API interface service registration method is RPC Registration (Java Method Register, JMR); when the configuration resource is a metadata resource in a low-code architecture, the API interface service registration method is BEM Model Registration (Business Entity Model). Register (BEMR); when the configuration resource is a database resource, the API interface service registration method is external database registration and DBO data table registration, with DBO data table registration being Database Object Register (DBOR); when the configuration resource is a third-party system API resource, the API interface service registration method is ICC service registration, i.e., iGIX Cloud Connector register (ICCR); when the configuration resource is an encoded interface service registration resource, the API interface service registration method is hard-coded registration; when the configuration resource is a combination of multiple resource types, the API interface service registration method is interface derivation registration.
[0046] Figure 3 This is a schematic diagram illustrating a service registration interface provided in an embodiment of this specification, such as... Figure 3 As shown, no-code registration integrates and manages system resources, including existing class and method resources. It also registers existing RPC resources (inter-service communication services in a microservice architecture), metadata resources from low-code architectures (metadata mapped to specific database tables), database table resources, and third-party system APIs. Since no-code cannot cover all business scenarios, a coded API service registration method is proposed, providing users with a hard-coded registration approach. Furthermore, to adapt to application scenarios with various resource combinations, no-code registration orchestrates the aforementioned registered resources.
[0047] By using the above-mentioned various interface service registration methods, services can be registered quickly and efficiently with zero-code configuration, laying the foundation for the subsequent one-click dynamic publishing of RESTful services.
[0048] Step S104: Based on dynamic publishing technology and resource call interface service, dynamically publish the Restful service to be published to generate the corresponding Restful service.
[0049] Based on dynamic publishing technology and the resource call interface service, the RESTful service to be published is dynamically published to generate the corresponding RESTful service. Specifically, this includes: determining the configuration URL address of the RESTful service to be published based on the resource call interface service; and using dynamic publishing technology, dynamically publishing the service according to the pre-set general RESTful service template and the configuration URL address to generate the corresponding RESTful service.
[0050] Using dynamic deployment technology, services are dynamically deployed based on a pre-set generic RESTful service template and the configured URL address, generating the corresponding RESTful service. Specifically, this includes: pre-setting a generic RESTful service template; using dynamic compilation technology to dynamically load and compile the generic RESTful service template in memory during system runtime, generating a compiled RESTful service template; and then dynamically deploying the compiled RESTful service template and the configured URL address to generate the corresponding RESTful service.
[0051] After dynamically publishing the compiled Restful service template and the configuration URL address using dynamic publishing technology to generate the corresponding Restful service, the method further includes: during the Restful service call process, routing to the resource call interface service through the configuration URL address to call the service resource corresponding to the resource call interface service.
[0052] In one embodiment of this specification, Figure 4 This is a schematic diagram illustrating a service publishing interface provided in an embodiment of this specification, such as... Figure 4As shown, to address the inefficiency of existing code encoding, compilation, and deployment for publishing RESTful services, a technical solution is proposed that dynamically compiles and publishes RESTful services based on a RESTful service template at runtime. Specifically, the solution involves integrating and managing services through zero-code configuration, and then publishing them as RESTful services using dynamic publishing technology. First, a general RESTful service template is preset. After selecting the service registered in step S103, a URL address corresponding to the service resource is generated. This URL address is configured as the URL of the RESTful service, and the "Publish Service" button is clicked. At this point, dynamic compilation technology is used to dynamically load the RESTful service template into memory and compile it at runtime. Finally, based on the compiled RESTful service template and the configured URL, a RESTful service is dynamically published. During RESTful service invocation, routing is performed to the registered system resource via the configured URL. It should be noted that this dynamic publishing technology can be implemented using the open-source Apache CXF framework. Apache CXF is an open-source Web Service framework that can be used to build and develop Web Services that support multiple protocols.
[0053] Through the above technical solution, zero-code data modeling is performed based on the input and output parameters in the service requirement parameters of the RESTful service to be published, generating the corresponding input and output parameter configuration data model for the RESTful service to be published. The polymorphic data model generation method greatly simplifies the configuration of the data model. Through multiple interface service registration methods, the service to be called resource is registered. Service registration can be done quickly and efficiently through zero-code configuration, laying the foundation for the subsequent one-click dynamic publishing of RESTful services. By modeling the input and output parameter data and dynamically publishing it as a RESTful service through zero-code configuration, the complexity of publishing RESTful services in the existing system is solved. The zero-code configuration method of data modeling, service registration and service publishing greatly simplifies the development process and improves the development experience and efficiency.
[0054] This specification also provides an embodiment of a service publishing device based on a data model, such as... Figure 5 As shown, the device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to:
[0055] Obtain the service requirement parameters of the RESTful service to be published, including input parameters, output parameters, and resources to be invoked. Based on the input and output parameters of the RESTful service to be published, perform zero-code data modeling to generate the input and output parameter configuration data model corresponding to the RESTful service to be published. Through the input and output parameter configuration data model and the pre-built API interface service registration management mechanism, register the resources to be invoked in the service requirement parameters to generate the resource invocation interface service corresponding to the RESTful service to be published. Based on dynamic publishing technology and the resource invocation interface service, dynamically publish the RESTful service to be published to generate the corresponding RESTful service.
[0056] This specification also provides a non-volatile computer storage medium storing computer-executable instructions, wherein the computer-executable instructions are configured as follows:
[0057] Obtain the service requirement parameters of the RESTful service to be published, including input parameters, output parameters, and resources to be invoked. Based on the input and output parameters of the RESTful service to be published, perform zero-code data modeling to generate the input and output parameter configuration data model corresponding to the RESTful service to be published. Through the input and output parameter configuration data model and the pre-built API interface service registration management mechanism, register the resources to be invoked in the service requirement parameters to generate the resource invocation interface service corresponding to the RESTful service to be published. Based on dynamic publishing technology and the resource invocation interface service, dynamically publish the RESTful service to be published to generate the corresponding RESTful service.
[0058] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments of apparatus, devices, and non-volatile computer storage media are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0059] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0060] The devices, media, and methods provided in the embodiments of this specification are one-to-one correspondences. Therefore, the devices and media also have similar beneficial technical effects as their corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices and media will not be repeated here.
[0061] Those skilled in the art will understand that embodiments of this specification can be provided as methods, systems, or computer program products. Therefore, this specification may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this specification may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0062] This specification is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this specification. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create a machine for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0063] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0064] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0065] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0066] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0067] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0068] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0069] The above description is merely one or more embodiments of this specification and is not intended to limit this specification. Various modifications and variations can be made to the one or more embodiments of this specification by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of one or more embodiments of this specification should be included within the scope of the claims of this specification.
Claims
1. A service publishing method based on a data model, characterized in that, The method includes: Obtain the service requirement parameters of the Restful service to be published, wherein the service requirement parameters include input parameters, output parameters, and resources to be invoked; Based on the input and output parameters in the service requirement parameters of the Restful service to be published, zero-code data modeling is performed to generate the input and output parameter configuration data model corresponding to the Restful service to be published. For each type of configuration resource in the system and non-system resources, an API interface service registration method corresponding to the configuration resource is set in advance. An API interface service registration management mechanism is constructed through multiple API interface service registration methods. The service to be called resources in the service requirement parameters are registered through the input and output parameter configuration data model and the pre-built API interface service registration management mechanism to generate the resource call interface service corresponding to the Restful service to be published. Based on dynamic publishing technology and the resource invocation interface service, the RESTful service to be published is dynamically published to generate the corresponding RESTful service, specifically including: Based on the resource call interface service, determine the configuration URL address of the Restful service to be published; Using dynamic publishing technology, services are dynamically published based on a pre-set generic RESTful service template and the configured URL address, generating the corresponding RESTful service.
2. The service publishing method based on a data model according to claim 1, characterized in that, Based on the input and output parameters in the service requirement parameters of the RESTful service to be published, zero-code data modeling is performed to generate the input and output parameter configuration data model corresponding to the RESTful service to be published, specifically including: Determine the input and output parameters of the service requirement parameters for the Restful service to be published; The input parameters and output parameters in the service requirement parameters are described using JSON Schema to generate input parameter data models and output parameter data models respectively; Based on the input parameter data model and the output parameter data model, the input and output parameter configuration data model corresponding to the Restful service to be published is determined, wherein the input and output parameter configuration data model is in JSON Schema description format.
3. The service publishing method based on a data model according to claim 1, characterized in that, Through the input / output parameter configuration data model and the pre-built API interface service registration management mechanism, the resources to be invoked in the service requirement parameters are registered as services, generating the resource invocation interface service corresponding to the RESTful service to be published, specifically including: Determine the system data of the system that hosts the resource to be invoked and the RESTful service to be published; Based on the resource to be invoked and the system data, determine the resource type of the resource to be invoked corresponding to the Restful service to be published, wherein the resource type to be invoked includes system resources and non-system resources; Based on the resource type to be invoked and the input / output parameter configuration data model, the resource to be invoked is registered as a service through the zero-code configuration method corresponding to the API interface service registration management mechanism, so as to generate the resource invocation interface service corresponding to the resource to be invoked.
4. The service publishing method based on a data model according to claim 1, characterized in that, Using dynamic deployment technology, services are dynamically deployed based on a pre-set generic RESTful service template and the configured URL address mentioned above, generating the corresponding RESTful service. Specifically, this includes: Pre-configure a generic RESTful service template; When the system running the RESTful service to be released is running, dynamic compilation technology is used to dynamically load and compile the general RESTful service template in memory to generate the compiled RESTful service template. By using dynamic publishing technology, the compiled RESTful service template and the configured URL address are dynamically published to generate the corresponding RESTful service.
5. The service publishing method based on a data model according to claim 4, characterized in that, After dynamically publishing the compiled RESTful service template and the configured URL address using dynamic publishing technology to generate the corresponding RESTful service, the method further includes: During the RESTful service call process, the configured URL address is used to route to the resource call interface service to call the service resource corresponding to the resource call interface service.
6. The service publishing method based on a data model according to claim 3, characterized in that, The system resources include any one or more of the following: class resources, method resources, RPC resources, metadata resources in low-code architecture, and system database resources. The non-system resources include any one or more of the following: non-system database resources, third-party system API resources, coded interface service registration resources, and combinations of multiple resource types.
7. The service publishing method based on a data model according to claim 6, characterized in that, The method further includes: When the configuration resource is a class resource, the API interface service registration method is Java Class registration; When the configuration resource is a method resource, the API interface service registration method is Java method registration; When the configuration resource is an RPC resource, the API interface service registration method is RPC registration; When the configuration resource is a metadata resource in a low-code architecture, the API interface service registration method is BEF model registration; When the configuration resource is a database resource, the API interface service registration method is external database registration and DBO data table registration; When the configuration resource is a third-party system API resource, the API interface service registration method is ICC service registration; When the configuration resource is an encoded interface service registration resource, the API interface service registration method is hard-coded registration; When the configuration resource is a combination of multiple resource types, the API interface service registration method is interface derivation registration.
8. A service publishing device based on a data model, characterized in that, The device includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enable the at least one processor to: Obtain the service requirement parameters of the Restful service to be published, wherein the service requirement parameters include input parameters, output parameters, and resources to be invoked; Based on the input and output parameters in the service requirement parameters of the Restful service to be published, zero-code data modeling is performed to generate the input and output parameter configuration data model corresponding to the Restful service to be published. For each type of configuration resource in the system and non-system resources, an API interface service registration method corresponding to the configuration resource is set in advance. An API interface service registration management mechanism is constructed through multiple API interface service registration methods. The service to be called resources in the service requirement parameters are registered through the input and output parameter configuration data model and the pre-built API interface service registration management mechanism to generate the resource call interface service corresponding to the Restful service to be published. Based on dynamic publishing technology and the resource invocation interface service, the RESTful service to be published is dynamically published to generate the corresponding RESTful service, specifically including: Based on the resource call interface service, determine the configuration URL address of the Restful service to be published; Using dynamic publishing technology, services are dynamically published based on a pre-set generic RESTful service template and the configured URL address, generating the corresponding RESTful service.
9. A non-volatile computer storage medium storing computer-executable instructions, characterized in that, The computer-executable instructions are set as follows: Obtain the service requirement parameters of the Restful service to be published, wherein the service requirement parameters include input parameters, output parameters, and resources to be invoked; Based on the input and output parameters in the service requirement parameters of the Restful service to be published, zero-code data modeling is performed to generate the input and output parameter configuration data model corresponding to the Restful service to be published. For each type of configuration resource in the system and non-system resources, an API interface service registration method corresponding to the configuration resource is set in advance. An API interface service registration management mechanism is constructed through multiple API interface service registration methods. The service to be called resources in the service requirement parameters are registered through the input and output parameter configuration data model and the pre-built API interface service registration management mechanism to generate the resource call interface service corresponding to the Restful service to be published. Based on dynamic publishing technology and the resource invocation interface service, the RESTful service to be published is dynamically published to generate the corresponding RESTful service, specifically including: Based on the resource call interface service, determine the configuration URL address of the Restful service to be published; Using dynamic publishing technology, services are dynamically published based on a pre-set generic RESTful service template and the configured URL address, generating the corresponding RESTful service.
Citation Information
Patent Citations
Method for rapidly issuing data service
CN107622055A
Integrated management method and system for server sources based on restful API
CN107948309A