CN115879257A - Service simulation calling method and system based on microservice - Google Patents

Service simulation calling method and system based on microservice Download PDF

Info

Publication number
CN115879257A
CN115879257A CN202111146145.9A CN202111146145A CN115879257A CN 115879257 A CN115879257 A CN 115879257A CN 202111146145 A CN202111146145 A CN 202111146145A CN 115879257 A CN115879257 A CN 115879257A
Authority
CN
China
Prior art keywords
service
data
simulation
parameter
microservice
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111146145.9A
Other languages
Chinese (zh)
Inventor
黄可
胡兵
王盛义
周云昊
谭克元
李朝阳
颜礼齐
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Baosight Software Co Ltd
Original Assignee
Shanghai Baosight Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Baosight Software Co Ltd filed Critical Shanghai Baosight Software Co Ltd
Priority to CN202111146145.9A priority Critical patent/CN115879257A/en
Publication of CN115879257A publication Critical patent/CN115879257A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention provides a method for invoking service simulation based on micro-service, which is characterized by comprising the following steps: step S1: displaying corresponding service information according to different service types; step S2: automatically generating a service document according to the service information, and inputting service parameters; and step S3: performing service debugging, and sending a micro-service call request; and step S4: obtaining a return result according to the service type query; step S5: and checking the service call chain information according to the returned result, and troubleshooting the problems encountered in the service call. According to the invention, through the customized micro-service-based service simulation calling method, the defects of high availability, customization, safety, service document and result display of the traditional service simulation calling in the process of dealing with multi-platform industrial big data are overcome, the service trial and simulation experience of a user is effectively improved, and the potential user trial data value is mined by utilizing a big data technology.

Description

Service simulation calling method and system based on micro-service
Technical Field
The invention relates to the technical field of micro services, in particular to a method and a system for invoking service simulation based on micro services.
Background
The essence of the data center platform is to exert the storage and calculation capabilities of the big data platform; the method realizes the aims of service business, insights business, driving business, value-creating business and management around the development strategy of enterprises, performs organizational fusion modeling on data, continuously precipitates standardized data service capability and data asset operation capability, enables foreground business and provides flexible and efficient data service.
When a user needs to try or debug the data sharing service and the standard sharing service, the data services cannot provide the simulation calling function, and at the moment, the user needs to call the data services in a simulation mode through a new service calling mode.
Compared with the current domestic simulation calling products, the products have the following limitations: (1) Service calling is limited to basic interface calling, and micro-services are not subjected to customized configuration; (2) The used simulation calling scheme is not stored, so that the service parameters need to be backed up by the user; (3) The lack of flexible parameter display functions allows the input of parameters in only one view.
Through retrieval, patent document CN108959076A discloses an API online debugging method, developers write interface annotations using standard java doc format specifications, add custom annotations to API implementation codes, scan items using an API formatted description generation tool, analyze the annotation information and custom annotation contents of the code in the java doc format to form uniform API formatted description, and register the uniform API formatted description to an API center; the API center is responsible for uniformly managing all API documents, analyzing API formatting description, generating API documents and Web pages with uniform styles and performing persistence processing; the user can read the API document by accessing the corresponding Web page through the client or the browser, and the API is debugged and tested immediately. Although the prior art improves the interface development efficiency and the interface integration quality by online debugging different types of APIs, the prior art bypasses the requirements of high availability of services, simulation customization, data security and the like, only provides a scheme for automatic generation and management based on API documents, and standardizes the management of the APIs to a certain extent, but fails to solve the problems of service customization configuration and desensitization of simulation data, a user can only input parameters in one view, and does not provide effective scheme management for historical simulation calling parameters, and thus the problem of core problem is not really solved.
Patent document CN110457017A discloses an enterprise central office system adopting a domain hierarchical design, including: layered design: based on a business and data hierarchical management strategy, designing an enterprise middle platform hierarchical architecture into a field layer and a general center layer, wherein the field layer and the general center layer are in communication connection through an API (application programming interface), and provide unified external service management through an application service gateway; dividing the fields into: dividing each layer into sub-centers according to a field design principle; capacity arrangement: realizing customized aggregation arrangement of platform capability; flow arrangement: solving the customized scene of the business process; and (3) field configuration: and realizing the configuration management of the resource items. Although the prior art can solve the problem of coupling of the business process and the business data, the prior art cannot solve the problem of simulation calling of multiple services.
Therefore, it is desirable to develop a method and system that enables a user to make an emulated call to a data service.
Disclosure of Invention
Aiming at the defects in the prior art, the invention aims to provide a method and a system for invoking service simulation based on microservice. The method solves the problem of how to realize the simulation calling technology of the data service based on the micro-service architecture, so that the simulation calling technology has the characteristics of high availability, customization and data desensitization, meets the trial and debugging requirements of users, and makes up the defects of the traditional service simulation.
The invention provides a method for calling service simulation based on microservice, which comprises the following steps:
step S1: displaying corresponding service information according to different service types;
step S2: automatically generating a service document according to the service information, and inputting service parameters;
and step S3: performing service debugging and sending a micro-service call request through a built-in parameter example template;
and step S4: obtaining a return result according to the service type query;
step S5: and checking service call chain information according to the returned result, performing service flow limitation, setting service degradation, and troubleshooting problems encountered in service call.
Preferably, the different service types in step S1 include a standard sharing service and a data sharing service, and the service information displayed by the standard sharing service includes a sharing service identifier, a sharing service name, and a sharing service entry; the service information exposed by the data sharing service includes API name, model name and parameter fill-in.
Preferably, the service document in step S2 includes service details, request parameter descriptions, status code descriptions, request code examples, and return result examples.
Preferably, the service parameter input in the step S2 includes table format parameter input or JSON format parameter input, the table format parameter input shows parameter names, parameter descriptions and information whether to be filled, example parameter values are automatically filled, and a user can modify the parameter values to call; and the JSON format parameter is input and displayed with the parameter name and the corresponding parameter value. The JSON format parameter is a fixed-format data structure called EiInfo.
Preferably, the return result in step S4 is displayed in a table format by default, and the service return data is data that is simple key value pairs and is not suitable for table display, and is displayed in a JSON format.
Preferably, the simulation calling process for the standard shared service is to firstly query whether the standard shared service exists, if the standard shared service exists, the shared service is called, and finally, the execution result of the shared service is displayed on the simulation calling page.
Preferably, the simulation call flow for the data sharing service includes performing anonymous filtering according to the model identifier, querying whether a data sharing service model and an API exist, if so, querying according to the database type to obtain a return result, and finally displaying the data sharing service execution result on the simulation call page.
The invention provides a micro-service-based service simulation calling system, which comprises:
the data sharing service module: one model is a combination of data tables in the business field, a group of API access data tables can be defined on the model, and service calling is carried out after the API and the API are associated with microservice through the model to acquire data in the data tables;
standard shared services module: the service sharing is directly performed through the micro-service call.
Preferably, the system further comprises a micro-service module, which acquires a micro-service calling address according to the micro-service information, calls the remote service in an REST mode, and uniformly analyzes a micro-service return result by using the EiInfo.
Preferably, the method further comprises the following steps:
station-data service module in data: the data center station-data service module provides three data service interfaces, including user-defined SQL single table query, user-defined API multi-table SQL query and model action;
basic middle station-shared service module: the base middlebox-shared services module packages portions of the microservices into shared services for cross-platform use.
Compared with the prior art, the invention has the following beneficial effects:
1. according to the invention, through the customized micro-service-based service simulation calling method, the defects of high availability, customization, safety, service document and result display of the traditional service simulation calling in the process of dealing with multi-platform industrial big data are overcome, the service trial and simulation experience of a user is effectively improved, and the potential user trial data value is mined by utilizing a big data technology.
2. The invention realizes the high-availability simulation of the service by simplifying the flow of the simulation call of the shared service. All steps of the service simulation calling process can be visualized, including selecting simulation services, setting service parameters, viewing service documents, displaying return results and the like. The operation is simple in the calling process, the service simulation record is stored through a built-in parameter example template, the service simulation calling can be carried out only through clicking operation without inputting. According to the service link information in the simulation service result, service current limitation and service degradation setting can be performed, and therefore high availability of the service is achieved.
3. The invention stores the existing simulation scheme for the user to read by customizing the data sharing service and the standard sharing service and ensures the data security.
4. The invention automatically generates detailed service documents for the reference of users, and displays input parameters and output results in various views.
Drawings
Other features, objects and advantages of the invention will become more apparent upon reading of the detailed description of non-limiting embodiments with reference to the following drawings:
FIG. 1 is a flow chart illustrating the steps of a method for invoking a microservice-based service simulation in accordance with the present invention;
FIG. 2 is a block diagram of a shared services module framework of the present invention;
FIG. 3 is a first block diagram of a microservice module of the present invention;
FIG. 4 is a diagram of a second framework of microservice modules of the present invention;
FIG. 5 is a schematic diagram illustrating a microservice basic information structure according to the present invention.
Detailed Description
The present invention will be described in detail with reference to specific examples. The following examples will aid those skilled in the art in further understanding the present invention, but are not intended to limit the invention in any manner. It should be noted that variations and modifications can be made by persons skilled in the art without departing from the concept of the invention. All falling within the scope of the present invention.
As shown in fig. 1, the present invention provides a method for invoking a service simulation based on a microservice, comprising the following steps:
step S1: and displaying corresponding service information according to different service types. Specifically, the method comprises the following steps:
in the step S1, different service types comprise standard sharing service and data sharing service, and the service information displayed by the standard sharing service comprises a sharing service identifier, a sharing service name and sharing service access; the service information exposed by the data sharing service includes an API name, a model name, and a parameter fill.
Step S2: and automatically generating a service document according to the service information, and inputting service parameters. Specifically, the method comprises the following steps:
the service document in step S2 includes service details, request parameter description, status code description, request code example, and return result example.
Step S2, inputting service parameters including table format parameter input or JSON format parameter input, wherein the table format parameter input shows parameter names, parameter description and information whether the information is required to be filled, example parameter values are automatically filled, and a user can modify the parameter values to call; and the JSON format parameter is input and displayed with the parameter name and the corresponding parameter value. The JSON format parameter is a data structure with a fixed format, called EiInfo, mainly comprises an attribute area (extAttr) and data areas (blocks), and is more flexible and free than a table format parameter. For example: { extAttr: { userId:178237}, blocks: { q: { metas { 'compoycode', 'appCode', }, rows [ [ [ '1001', 'BSMS' ] } } } }.
And step S3: and debugging the service and sending a micro-service calling request through a built-in parameter example template.
And step S4: and obtaining a return result according to the service type query. Specifically, the method comprises the following steps:
the returned result in the step S4 is displayed in a table format by default, the service returned data is data which is simple in key value pair and is not suitable for table display, and is displayed in a JSON format, for example, the service returned data of the user login state { status:0, msg: 'user login success', extAttr: { loginStatus:0} }.
Step S5: and checking the service call chain information according to the returned result, performing service flow limitation, setting service degradation, and checking the problems in service call.
As shown in fig. 2 to 5, the present invention further provides a service emulation invoking system based on microservice, including:
the data sharing service module: one model is a combination of business field data tables, a group of API access data tables can be defined on the model, and data in the data tables are obtained by carrying out service calling after the API and the API are associated with the microservice through the model.
Standard shared services module: the service sharing is directly performed through the micro-service call.
The micro-service module: acquiring a micro-service calling address according to micro-service information, calling remote service in a REST mode, (using HTTP protocol POST request: service calling address +/service Id), and analyzing a micro-service return result by uniformly using EiInfo (JSON format in 4, which can represent request parameters and return results).
Station-data service module in data: the data center station-data service module provides three data service interfaces, including user-defined SQL single table query, user-defined API multi-table SQL query and model action;
basic middle station-shared service module: the base middlebox-shared services module packages portions of the microservices into shared services for cross-platform use.
The simulation calling process aiming at the standard shared service comprises the steps of firstly inquiring whether the standard shared service exists or not, calling the shared service if the standard shared service exists, and finally displaying the execution result of the shared service on a simulation calling page.
The simulation calling process for the data sharing service comprises the steps of firstly carrying out anonymous filtering according to the model identification, inquiring whether a data sharing service model and an API exist or not, inquiring to obtain a return result according to the type of a database if the data sharing service model and the API exist, and finally displaying a data sharing service execution result on a simulation calling page.
The invention effectively promotes the trial and simulation experience of the user on the service, utilizes the big data technology to mine the potential trial data value of the user, and has the following characteristics:
(1) The service simulation calling method provided by the invention is used for carrying out customized configuration on the data sharing service and the standard sharing service. For data service with relatively fixed input parameters and return results, table format parameter input and multiple result display modes are provided; and for the standard sharing service with relatively unfixed returned results, table data block switching and JSON format result display are provided.
(2) The security of data transmission is ensured by data encryption of a data center station and a basic center station, the simulation calling only allows a user to inquire desensitization data after prefix retention and masking processing, the security of scheme storage is ensured by a data storage copy mechanism, and the whole simulation calling process is safe and reliable from data transmission, simulation to final scheme storage.
(3) The service simulation calling method provided by the patent can read the input parameters of the data service or the shared service, and carry out multi-dimensional query, thereby meeting the requirement of the user on all-dimensional simulation trial of the service.
(4) Each user can perform addition, deletion, modification and check management on the own simulation scheme, so that repeated parameter entry is avoided, and the simulation scheme experience of the user is improved.
The specific embodiment is as follows:
by utilizing the service market oriented to the end user, the service market provides a service trial function for the service user, and the implementation mode of using customized simulation calling by the user is described below by taking the user trial service as an example.
(1) The user finds a data service [ investment return model ] in the service market, and clicks a trial button to jump to a trial page.
(2) The trial page shows the [ investment return model ] as service information (service description: inquiry investment return information) of the data service type, and automatically generates a service document for reference. The service document comprises five parts of service details, request parameter description, state code description, request code example and return result example.
(3) The default of parameter filling is filling in a form format, and a user can fill in parameter values by referring to a service document or directly make service call according to the provided default parameter values. The service has a parameter [ ACCT _ PERIOD _ NO ], which is described as "date", which is a mandatory parameter. The user fills in the parameter value "202005".
(4) And clicking a test button to execute simulation calling.
(5) And checking a returned result in a table format, and returning 10 rows of data, namely investment return information of the Bao steel package and the Bao steel shares subjected to data desensitization. The returned result can be switched to be displayed in a JSON format.
(6) And clicking a 'view call chain' button by the user, skipping a 'call chain detail' page, and viewing the call chain information of the service.
It is well within the knowledge of a person skilled in the art to implement the system and its various devices, modules, units provided by the present invention in a purely computer readable program code means that the same functionality can be implemented by logically programming method steps in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Therefore, the system and various devices, modules and units thereof provided by the invention can be regarded as a hardware component, and the devices, modules and units included in the system for realizing various functions can also be regarded as structures in the hardware component; means, modules, units for realizing various functions can also be regarded as structures in both software modules and hardware components for realizing the methods.
In the description of the present application, it is to be understood that the terms "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", and the like indicate orientations or positional relationships based on those shown in the drawings, and are only for convenience in describing the present application and simplifying the description, but do not indicate or imply that the referred device or element must have a specific orientation, be constructed in a specific orientation, and be operated, and thus, should not be construed as limiting the present application.
The foregoing description of specific embodiments of the present invention has been presented. It is to be understood that the present invention is not limited to the specific embodiments described above, and that various changes or modifications may be made by one skilled in the art within the scope of the appended claims without departing from the spirit of the invention. The embodiments and features of the embodiments of the present application may be combined with each other arbitrarily without conflict.

Claims (10)

1. A service simulation calling method based on micro-service is characterized by comprising the following steps:
step S1: displaying corresponding service information according to different service types;
step S2: automatically generating a service document according to the service information, and inputting service parameters;
and step S3: performing service debugging and sending a micro-service calling request through a built-in parameter example template;
and step S4: obtaining a return result according to the service type query;
step S5: and checking service call chain information according to the returned result, performing service flow limitation, setting service degradation, and troubleshooting problems encountered in service call.
2. The method for invoking service simulation based on microservice according to claim 1, wherein the different service types in step S1 comprise a standard sharing service and a data sharing service, and the service information displayed by the standard sharing service comprises a sharing service identifier, a sharing service name and a sharing service parameter; the service information displayed by the data sharing service comprises an API name, a model name and parameter filling.
3. The method for invoking service emulation based on microservice according to claim 1, wherein the service document in step S2 comprises service details, request parameter description, status code description, request code example and return result example.
4. The method for invoking service simulation based on microservice according to claim 1, wherein the step S2 of entering service parameters comprises table format parameter entry or JSON format parameter entry, wherein the table format parameter entry shows parameter name, parameter description and information whether to be required or not, and automatically fills in example parameter values, and the user can modify the parameter values to invoke; the JSON format parameter is input and displayed with a parameter name and a corresponding parameter value;
the JSON format parameter is a fixed-format data structure called EiInfo.
5. The method for invoking service simulation based on microservice according to claim 1, wherein the returned result in the step S4 is displayed in a table format by default, and the service returned data is simple key value pairs and the data which is not suitable for table display is displayed in a JSON format.
6. The method for invoking service simulation based on microservice according to claim 2, wherein the simulation invoking flow for the standard sharing service is to first query whether the standard sharing service exists, if the standard sharing service exists, invoke the sharing service, and finally show the execution result of the sharing service on the simulation invoking page.
7. The method for invoking service simulation based on microservice according to claim 2, wherein the emulation invoking process for the data sharing service is to perform anonymous filtering according to the model identification, query whether the data sharing service model and API exist, query to obtain a return result according to the database type if the data sharing service model and API exist, and finally display the data sharing service execution result on the emulation invoking page.
8. A micro-service based service simulation calling system, which is characterized in that the micro-service based service simulation calling method of any one of claims 1 to 7 is adopted to perform service simulation calling, and comprises the following steps:
the data sharing service module: performing service calling after the model is associated with the API and the API is associated with the microservice to acquire data in a data table, wherein one model is a combination of data tables in the business field, and a group of API access data tables can be defined on the model;
standard shared services module: the service sharing is directly performed through the micro-service call.
9. The microservice-based service simulation invoking system according to claim 8, further comprising a microservice module, acquiring a microservice invoking address according to microservice information, invoking a remote service in REST mode, and analyzing microservice return result by using EiInfo in a unified manner.
10. The microservice-based service emulation invocation system according to claim 8, further comprising:
station-data service module in data: the data center station-data service module provides three data service interfaces, including user-defined SQL single table query, user-defined API multi-table SQL query and model action;
basic middle station-shared service module: the base middlebox-shared services module packages portions of the microservices into shared services for cross-platform use.
CN202111146145.9A 2021-09-28 2021-09-28 Service simulation calling method and system based on microservice Pending CN115879257A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111146145.9A CN115879257A (en) 2021-09-28 2021-09-28 Service simulation calling method and system based on microservice

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111146145.9A CN115879257A (en) 2021-09-28 2021-09-28 Service simulation calling method and system based on microservice

Publications (1)

Publication Number Publication Date
CN115879257A true CN115879257A (en) 2023-03-31

Family

ID=85763744

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111146145.9A Pending CN115879257A (en) 2021-09-28 2021-09-28 Service simulation calling method and system based on microservice

Country Status (1)

Country Link
CN (1) CN115879257A (en)

Similar Documents

Publication Publication Date Title
US8271940B2 (en) System and method for dynamic generation and customization of web service client applications for terminals
US8234308B2 (en) Deliver application services through business object views
CN101939736B (en) System and method for developing rich internet applications for remote computing devices
EP2437524A1 (en) M2m service platform and work method thereof
US8060863B2 (en) Conformance control module
US8806345B2 (en) Information exchange using generic data streams
CN110381135A (en) Interface creation method, service request method, device, computer equipment and medium
CN108519952A (en) A kind of distributed WEB automatization test systems and method
CN110807015A (en) Big data asset value delivery management method and system
US20120089931A1 (en) Lightweight operation automation based on gui
CN105637478A (en) Computer-aided development of native mobile application code
CN115640045B (en) Low-code development platform based on domain-driven design and business system creation method
US10313421B2 (en) Providing Odata service based on service operation execution flow
US20140006000A1 (en) Built-in response time analytics for business applications
CN115857886A (en) Low code development platform for basic government affair application
CN109144479A (en) Development frame
CN115879257A (en) Service simulation calling method and system based on microservice
US8732708B2 (en) Dynamic generation of scenarios for managing computer system entities using management descriptors
US20190188063A1 (en) Mapping computer programs to network protocol methods
US20180130240A1 (en) Displaying visualization images on portable electronic device
CN114296698A (en) BPM-based business demand flow system design method
CN114296696A (en) Business function operation method and device, storage medium and electronic equipment
CN113221511A (en) Method, device and equipment for converting configuration file into XML file and storage medium
Ducreux et al. Rapid prototyping of complete systems, the case study of a smart parking
US20120174195A1 (en) Function module dispatcher

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination