[go: up one dir, main page]

CN111880950B - Method and system for managing cloud service API (application program interface) based on government cloud platform - Google Patents

Method and system for managing cloud service API (application program interface) based on government cloud platform Download PDF

Info

Publication number
CN111880950B
CN111880950B CN202010747981.1A CN202010747981A CN111880950B CN 111880950 B CN111880950 B CN 111880950B CN 202010747981 A CN202010747981 A CN 202010747981A CN 111880950 B CN111880950 B CN 111880950B
Authority
CN
China
Prior art keywords
api
project
interface
data
test
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.)
Active
Application number
CN202010747981.1A
Other languages
Chinese (zh)
Other versions
CN111880950A (en
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.)
Inspur Cloud Information Technology Co Ltd
Original Assignee
Inspur Cloud Information Technology 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 Inspur Cloud Information Technology Co Ltd filed Critical Inspur Cloud Information Technology Co Ltd
Priority to CN202010747981.1A priority Critical patent/CN111880950B/en
Publication of CN111880950A publication Critical patent/CN111880950A/en
Application granted granted Critical
Publication of CN111880950B publication Critical patent/CN111880950B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/543User-generated data transfer, e.g. clipboards, dynamic data exchange [DDE], object linking and embedding [OLE]
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/31User authentication
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Quality & Reliability (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a method and a system for managing cloud service APIs based on a government cloud platform, which belong to the field of government cloud, and the technical problem to be solved by the invention is how to uniformly manage cloud service APIs, realize the business of APIs, project management and automatic construction of test cases, and simultaneously reduce the level requirements of API testing and management processes on operators, and the adopted technical scheme is as follows: the method comprises the following steps: managing cloud service APIs in units of items and being capable of modifying item information and deleting items; establishing an API corresponding to the project according to the project information, carrying out grouping management on the API corresponding to the project, and sequencing the grouping; managing a single API, and perfecting preset information of the API corresponding to the project; and adding Mock data for the API. The system comprises a login module, a permission control module, a service line module, a project management module, an API test module and an API test record module.

Description

Method and system for managing cloud service API (application program interface) based on government cloud platform
Technical Field
The invention relates to the field of government cloud, in particular to a method and a system for managing cloud service APIs based on a government cloud platform.
Background
Application program interface API: application Program Interface), an application program interface is a set of definitions, programs, and protocols through which the computer software communicates with each other. One of the main functions of the API is to provide a generic set of functions. The programmer can lighten the programming task by calling the API function to develop the application program. The API is also a middleware for providing data sharing for various platforms. APIs can be categorized into four types based on the performance of data sharing between different software applications on a single or distributed platform:
(1) remote Procedure Calls (RPCs) enable inter-program communication through processes (or tasks) acting on a shared data buffer;
(2) standard Query Language (SQL), which is a standard query language for accessing data, realizes data sharing among application programs through a database;
(3) file transmission, namely realizing data sharing among application programs by sending formatted files;
(4) information delivery refers to small format information between loosely coupled or tightly coupled application programs, and data sharing is realized through direct communication between the programs.
At present, governments advocate 'one-net-work' and 'one-time' and advocate that departments of each unit migrate to cloud and data intercommunication. The cloud service APIs on the government cloud platform do not have unified management, all projects are all fight, data cannot be communicated, API documents cannot be provided for other projects to call, and when the interfaces are in butt joint, the safety problem is also very remarkable. As cloud services become more popular, more and more cloud services will open their APIs for other projects and other units.
In the prior art, the management and test of the API are still in a manual stage, and some API testing tools, such as Postman, are also available, but the tools can not realize the business and project management of the API and can not realize the automatic construction of the test cases. The level of testing and managing the API depends on the level of operators, has strong subjectivity, and cannot uniformly manage the API of the cloud service. Therefore, how to uniformly manage the cloud service API, realize the business of the API, project management and automatic construction of test cases, and reduce the level requirements of the API test and management process on operators is a technical problem to be solved.
Disclosure of Invention
The technical task of the invention is to provide a method and a system for managing cloud service APIs based on a government cloud platform, which are used for solving the problems of how to uniformly manage the cloud service APIs, realizing the business of the APIs, project management and automatic construction of test cases, and simultaneously reducing the level requirements of the API test and management process on operators.
The technical task of the invention is realized in the following way, and the method for managing the cloud service API based on the government cloud platform comprises the following steps:
managing cloud service APIs in units of items and being capable of modifying item information and deleting items;
establishing an API corresponding to the project according to the project information, carrying out grouping management on the API corresponding to the project, and sequencing the grouping;
managing a single API, and perfecting preset information of the API corresponding to the project;
adding Mock data for the API;
the interface test is carried out in the API detail function, the interface URL and the information of the test parameters are automatically initialized, the interface test function supports selecting the operation environment, then the complete URL links of different environments are automatically generated, the parameter values of the test are filled, and the interface request can be initiated once and the result is displayed; the display result is interface response data, the interface response data supports a binding data structure, and the attribute of the data structure supports nested reference and also supports multiplexing;
after interface test is carried out, the test result (interface URL and test parameter information) is stored, and test history records of all interfaces can be checked, restored and deleted;
and taking the service line as a dimension to control the authority, and having the authority of the service line, only allowing the operation of the service line project interface, otherwise, only allowing the viewing.
Preferably, the item information comprises attribute information of the item and a following address of the item, the attribute information of the item comprises a service line, an item name and an item description, and a root address of the item comprises a test address, a pre-release address and an online address;
the preset information of the API comprises the steps of setting groups for the API, marking star levels of the API, adding the API newly, deleting the API, modifying the API, inquiring the API, perfecting the API attribute and supporting Markdown by the API remarking information.
More preferably, the Mock data includes a response result type and response result data; the response result type comprises Json, XML, HTML, TEXT and JSONP; the response result data means that each piece of Mock data generates a unique Mock link, and when the unique Mock link is accessed, the corresponding Mock data is returned according to the set data type such as JSON.
A system for managing cloud service APIs based on government cloud platforms, the system comprising,
the login module is used for enabling a user to login the API management system according to the account number and the password, enabling the user to open a login interface, and inputting a user name, the password and the verification code to complete login;
the authority control module is used for judging the function authority and the data authority owned by the user according to the service line owned by the user, and the API management system lists a user menu according to the function authority and displays the data conforming to the user according to the data authority;
the service line module is used for realizing maintenance of the service line by an administrator, namely, performing operations of adding, deleting, changing and checking the service line, and distributing users for the service line;
the project management module is used for creating or editing an API project, namely, performing operations of adding, deleting, modifying and searching on the project; simultaneously setting three environments of the project, namely a test environment, a pre-release environment and a formal environment;
the API management module is used for creating or editing an API, perfecting preset information of the API, and simultaneously performing operations of adding, deleting, modifying and searching the API and grouping the API so as to ensure unified management and test of the API with the same property; wherein the APIs belong to items, one API only belongs to one item, and one item comprises a plurality of APIs;
the API testing module is used for selecting a construction mode, inputting API parameters and initializing the API parameters;
and the API test recording module is used for single execution or batch execution, and the execution result of the test cases of the API is saved in the test result library so as to facilitate the subsequent analysis.
Preferably, the login module and the authority control module specifically have the following working processes:
firstly, inputting an account number, a password and a verification code by a user;
(II) judging whether the account exists or not:
(1) if the account number is not available, prompting that the account number is wrong, jumping to the step (I), and inputting the account number, the password and the verification code again;
(2) if so, executing the step (III) next;
thirdly, continuing to judge the password, and judging whether the password meets the specification or not:
(1) if the password does not meet the specification, prompting that the password does not meet the specification, jumping to the step (I), and inputting again;
(2) if the specification is met, executing the step (IV) next;
fourthly, performing case-and-space distinguishing processing on the verification code, and judging whether the verification code meets the specification or not:
(1) if the verification code does not meet the specification, prompting that the verification code does not meet the specification, jumping to the step (I), and inputting again;
(2) if the specification is met, executing the step (fifth) next;
and fifthly, encrypting the account number, the password and the verification code, transmitting the encrypted account number, the encrypted password and the verification code to a background service for verification, and firstly verifying whether the verification code is correct or not by the background:
(1) if the verification code is incorrect, returning the verification code to the front end, jumping to the step (I), and inputting the verification code again;
(2) if the result is correct, executing the step (six) next;
and (six) continuing to judge the account number and the password, searching a database by the background service, and judging whether the account number and the password are matched or not:
(1) if the two numbers are not matched, returning an account number and a password error to the front end, jumping to the step (I), inputting again and submitting;
(2) if so, the user logs in successfully, and the step (seventh) is executed next;
seventhly, the API management system reads the role of the user, acquires the function authority and the data authority of the user, and executes the step (eight) next;
(eight) listing a user menu according to the function authority, and executing the step (nine) next;
and (nine) displaying the data conforming to the user according to the data authority.
Preferably, the project management module and the API management module specifically have the following working procedures:
(1) Preparing project information: the project information comprises the attribute information of the project and the following address of the project, the attribute information of the project comprises a service line, a project name and a project description, and the root address of the project comprises a test address, a pre-release address and an on-line address;
(2) Creating an item: creating items according to the prepared item information, and supporting updating and deleting the items;
(3) Creating an API packet: supporting API packet ordering and updating and deleting packets;
(4) Preparing API information, namely preparing preset information of the API, wherein the preset information of the API comprises basic information, a request header, request parameters, a response result and an API description; wherein the basic information includes URL, packet, method, status and name; the URL is the address of the interface request, note here the relative address, the root address being obtained from the root address attribute of the item to which it belongs; method is a request Method such as get, post, etc.; the state is an interface state, in the interface list, the starting state interface is marked by a green circle, the maintenance state interface is marked by a yellow circle, and the waste state interface is marked by a gray circle;
the request header includes a header tag and header content; the header tag refers to the type of the request header, such as Accept-Encoding; the header content refers to the value of the request header, such as UTF-8 corresponding to the Accept-Encoding header label;
the request parameters refer to that the same interface supports setting a plurality of request parameters, and the request parameters comprise parameter names, descriptions, types and whether filling is needed;
the response result includes a response data type MIME and binding data structures for the response data; setting the response data type as Json or XML;
the API description refers to an attribute description supporting a MarkDown format;
(5) Perfect interface description using Markdown;
(6) Creating an API and supporting updating and deleting the API;
(7) API grouping: marking star levels of the API;
(8) Search API: supporting API searching, wherein the searching keyword is URL;
(9) Export import API: the API interface list is exported as a PDF format interface document, and supports the importing of the format interface data of Swagger and Postman.
More preferably, the working process of the API test module and the API test recording module is specifically as follows:
(1) entering an interface detail function, and preparing Mock data, wherein the Mock data comprises a result data type and result data;
(2) adding Mock data for the interface, and supporting updating and deleting the Mock data;
(3) setting a request header and request parameters required by interface test;
(4) performing single interface test and grouping batch interface test;
(5) and (5) storing a test record.
Preferably, the system further comprises,
the user management module is used for providing two user roles of an administrator and a common user, and users with different roles can modify the personal login password through the password modification function; an administrator owns all rights of the system; the common user defaults to only have the read-only permission of the project interface and the data type, and only allows to operate the project and the interface under the service line after being distributed with the service line permission; the administrator roles are used for managing system user information, such as adding users, setting user roles, distributing rights and the like;
the business line management module is used for providing classification management and authority control functions; the classified management is that the project interfaces belong to the service line, and different project interfaces are isolated through the service line, so that the management is convenient; the authority control is that the API management system takes the service line as the dimension to control the authority, and the user only has the authority of the service line and is allowed to operate the service line project interface, otherwise, only is allowed to be checked.
An electronic device, comprising: a memory and at least one processor;
wherein the memory stores computer-executable instructions;
the at least one processor executes the computer-executable instructions stored by the memory, causing the at least one processor to perform the method of managing cloud service APIs based on government cloud platforms as described above.
A computer readable storage medium having stored therein computer executable instructions that when executed by a processor perform a method for managing cloud service APIs based on a government cloud platform as described above.
The government cloud platform based cloud service API management method and system have the following advantages:
the government cloud is an industry cloud, cloud service in the government cloud is large in scale and large in quantity, and APIs of the cloud service need unified management, and the cloud service cloud has the functions of API isolation, API grouping of single items, star marking, single API management, rich API attribute perfection, remark information support MarkDown, mock support, online test and authority control, realizes the business of the APIs, project management and automatic construction of test cases, and reduces the level requirements of API test and management processes on operators;
the management and the test of the API are strictly controlled by the invention, so that the function safety and the data safety are realized; the construction modes comprise a test environment, a pre-release environment and a formal environment; the APIs are grouped and marked in star level, so that visual management of the APIs is facilitated; the description of the API supports the MarkDown format; supporting Mock for the type and data of the returned result; the API test record can be saved, so that subsequent identical API tests do not need to search the API parameters and re-analyze the returned results;
thirdly, the invention carries out password and verification code double-factor authentication on the user login, thereby ensuring the safety; front-end and back-end double verification is carried out on the account number, the password and the verification code, so that the account number, the password and the verification code cannot be violently cracked; the login and the user password are both subjected to md5 encryption, so that the system security is improved; the user has the function authority and the data authority, so that the function safety can be ensured, and the data safety can be ensured;
the project management of the invention comprises all three environments, so that the management and test problems of the API under different environments are effectively solved; grouping APIs and marking star levels, so that the management problem of a large number of APIs is effectively solved; the single API contains detailed and perfect basic information, so that the API can be effectively and quickly tested; the Markdown perfect interface description is used, the browser can identify the Markdown format, and the display form of the interface description can be optimized; the system supports the input data type, the data type supports nesting, each API only needs to bind one data type, and response data parameters do not need to be executed independently; the search keywords are URLs, so that the user requirements are more met;
fifthly, the Mock data effectively solves the problem that other services cannot be called when the interfaces are not developed or deployed, so that the Mock interfaces are rapidly provided, and development progress is quickened; the single interface test can effectively solve the problem that a developer can quickly call and debug a single interface; the batch interface test of grouping can realize the scale test of interfaces, finish all interface tests by one key, scale, automatize, raise the test efficiency, save manpower, material resources and financial resources;
the invention carries out classification management aiming at the project by taking the business line as granularity, thereby effectively solving the problem that interfaces of different projects on the same business line are difficult to manage; interface permission is distributed through the service line, so that the problems of functional safety and data safety are effectively solved.
Drawings
The invention is further described below with reference to the accompanying drawings.
FIG. 1 is a system architecture block diagram of a government cloud platform based cloud service API;
FIG. 2 is a flow chart of the operation of a system for managing cloud service APIs based on a government cloud platform;
FIG. 3 is a flow chart of the operation of the login module and the rights control module;
FIG. 4 is a flow chart of the process of project management module and API management module;
FIG. 5 is a flow chart of the operation of the API test module and the API test record module.
Detailed Description
The method and system for managing cloud service APIs based on government cloud platform according to the present invention will be described in detail with reference to the accompanying drawings and specific embodiments.
Example 1:
the invention discloses a method for managing cloud service APIs based on a government cloud platform, which comprises the following steps:
s1, managing a cloud service API by taking a project as a unit and modifying project information and deleting the project; the project information comprises the attribute information of the project and the following address of the project, the attribute information of the project comprises a service line, a project name and a project description, and the root address of the project comprises a test address, a pre-release address and an on-line address;
s2, building APIs corresponding to the projects according to the project information, carrying out grouping management on the APIs corresponding to the projects, and sequencing the grouping;
s3, managing the single API, and perfecting preset information of the API corresponding to the project; the preset information of the API comprises the steps of setting groups for the API, marking star levels of the API, adding the API, deleting the API, modifying the API, inquiring the API, perfecting the API attribute and supporting Markdown by the API remark information.
S4, adding Mock data for the API; the Mock data comprises a response result type and response result data; the response result type comprises Json, XML, HTML, TEXT and JSONP; the response result data means that each piece of Mock data generates a unique Mock link, and when the unique Mock link is accessed, the corresponding Mock data is returned according to the set data type such as JSON.
S5, interface testing is carried out in an API detail function, information of interface URL and testing parameters is automatically initialized, the interface testing function supports selection of operation environments, then complete URL links of different environments are automatically generated, tested parameter values are filled, an interface request can be initiated, and a result is displayed; the display result is interface response data, the interface response data supports a binding data structure, and the attribute of the data structure supports nested reference and also supports multiplexing;
s6, after interface test is carried out, the test result (interface URL and test parameter information) is stored, and test history records of all interfaces can be checked, restored and deleted;
s7, controlling authority by taking the service line as a dimension, and only allowing operation of the service line project interface if the service line has the authority of the service line, otherwise only allowing viewing.
Example 2:
as shown in fig. 1, the system for managing cloud service APIs based on government cloud platform of the present invention comprises,
the login module is used for enabling a user to login the API management system according to the account number and the password, enabling the user to open a login interface, and inputting a user name, the password and the verification code to complete login;
the authority control module is used for judging the function authority and the data authority owned by the user according to the service line owned by the user, and the API management system lists a user menu according to the function authority and displays the data conforming to the user according to the data authority;
the service line module is used for realizing maintenance of the service line by an administrator, namely, performing operations of adding, deleting, changing and checking the service line, and distributing users for the service line;
the project management module is used for creating or editing an API project, namely, performing operations of adding, deleting, modifying and searching on the project; simultaneously setting three environments of the project, namely a test environment, a pre-release environment and a formal environment;
the API management module is used for creating or editing an API, perfecting preset information of the API, and simultaneously performing operations of adding, deleting, modifying and searching the API and grouping the API so as to ensure unified management and test of the API with the same property; wherein the APIs belong to items, one API only belongs to one item, and one item comprises a plurality of APIs;
the API testing module is used for selecting a construction mode, inputting API parameters and initializing the API parameters;
the API test recording module is used for single execution or batch execution, and the execution result of the test cases of the API is stored in the test result library so as to facilitate the subsequent analysis;
the user management module is used for providing two user roles of an administrator and a common user, and users with different roles can modify the personal login password through the password modification function; an administrator owns all rights of the system; the common user defaults to only have the read-only permission of the project interface and the data type, and only allows to operate the project and the interface under the service line after being distributed with the service line permission; the administrator roles are used for managing system user information, such as adding users, setting user roles, distributing rights and the like;
the business line management module is used for providing classification management and authority control functions; the classified management is that the project interfaces belong to the service line, and different project interfaces are isolated through the service line, so that the management is convenient; the authority control is that the API management system takes the service line as the dimension to control the authority, and the user only has the authority of the service line and is allowed to operate the service line project interface, otherwise, only is allowed to be checked.
The deployment mode of the system is specifically as follows:
1) Environmental requirements: maven3+, jdk1.8+, mysql 5.7+;
2) Preparing a database, initializing an Sql script, and executing an hc-api-mysql.sql file;
3) Configuring JDBC links, wherein the names of configuration files are as follows: hc-api,
4) Source code compilation: mvn clean install (V),
5) When the cloud host is deployed, running the generated jar packet by using a java command: java-jar hc-api-admin. Jar,
6) When the cluster is deployed, the JDBC link of each jar packet is set to be consistent,
7) When the container is deployed, pushing the jar packet to mirror image to the docker, and then operating the mirror image by using a docker command: dock run hc-api-admin.
As shown in fig. 2, the system works as follows:
(I), login: the user logs in the API management system according to the account number and the password;
(II) authority control: the API management system performs authority control according to the service line owned by the user, wherein the authority control comprises function authority and data authority;
(III) creating an item;
(iv), create project API: perfecting preset information of the project API, including setting groups for the API, marking star levels of the API and perfecting the API attribute;
(v) initializing API parameters: selecting a construction mode and inputting API parameters;
returning a result by Mock;
(VII) performing API test: including single and batch execution, and automatically save test records.
As shown in fig. 3, the login module and the authority control module specifically work as follows:
firstly, inputting an account number, a password and a verification code by a user;
(II) judging whether the account exists or not:
(1) if the account number is not available, prompting that the account number is wrong, jumping to the step (I), and inputting the account number, the password and the verification code again;
(2) if so, executing the step (III) next;
thirdly, continuing to judge the password, and judging whether the password meets the specification or not:
(1) if the password does not meet the specification, prompting that the password does not meet the specification, jumping to the step (I), and inputting again;
(2) if the specification is met, executing the step (IV) next;
fourthly, performing case-and-space distinguishing processing on the verification code, and judging whether the verification code meets the specification or not:
(1) if the verification code does not meet the specification, prompting that the verification code does not meet the specification, jumping to the step (I), and inputting again;
(2) if the specification is met, executing the step (fifth) next;
and fifthly, encrypting the account number, the password and the verification code, transmitting the encrypted account number, the encrypted password and the verification code to a background service for verification, and firstly verifying whether the verification code is correct or not by the background:
(1) if the verification code is incorrect, returning the verification code to the front end, jumping to the step (I), and inputting the verification code again;
(2) if the result is correct, executing the step (six) next;
and (six) continuing to judge the account number and the password, searching a database by the background service, and judging whether the account number and the password are matched or not:
(1) if the two numbers are not matched, returning an account number and a password error to the front end, jumping to the step (I), inputting again and submitting;
(2) if so, the user logs in successfully, and the step (seventh) is executed next;
seventhly, the API management system reads the role of the user, acquires the function authority and the data authority of the user, and executes the step (eight) next;
(eight) listing a user menu according to the function authority, and executing the step (nine) next;
and (nine) displaying the data conforming to the user according to the data authority.
As shown in fig. 4, the project management module and the API management module specifically work as follows:
(1) Preparing project information: the project information comprises the attribute information of the project and the following address of the project, the attribute information of the project comprises a service line, a project name and a project description, and the root address of the project comprises a test address, a pre-release address and an on-line address;
(2) Creating an item: creating items according to the prepared item information, and supporting updating and deleting the items;
(3) Creating an API packet: supporting API packet ordering and updating and deleting packets;
(4) Preparing API information, namely preparing preset information of the API, wherein the preset information of the API comprises basic information, a request header, request parameters, a response result and an API description; wherein the basic information includes URL, packet, method, status and name; the URL is the address of the interface request, note here the relative address, the root address being obtained from the root address attribute of the item to which it belongs; method is a request Method such as get, post, etc.; the state is an interface state, in the interface list, the starting state interface is marked by a green circle, the maintenance state interface is marked by a yellow circle, and the waste state interface is marked by a gray circle;
the request header includes a header tag and header content; the header tag refers to the type of the request header, such as Accept-Encoding; the header content refers to the value of the request header, such as UTF-8 corresponding to the Accept-Encoding header label;
the request parameters refer to that the same interface supports setting a plurality of request parameters, and the request parameters comprise parameter names, descriptions, types and whether filling is needed;
the response result includes a response data type MIME and binding data structures for the response data; setting the response data type as Json or XML;
the API description refers to an attribute description supporting a MarkDown format;
(5) Perfect interface description using Markdown;
(6) Creating an API and supporting updating and deleting the API;
(7) API grouping: marking star levels of the API;
(8) Search API: supporting API searching, wherein the searching keyword is URL;
(9) Export import API: the API interface list is exported as a PDF format interface document, and supports the importing of the format interface data of Swagger and Postman.
As shown in fig. 5, the working process of the API test module and the API test recording module is specifically as follows:
(1) entering an interface detail function, and preparing Mock data, wherein the Mock data comprises a result data type and result data;
(2) adding Mock data for the interface, and supporting updating and deleting the Mock data;
(3) setting a request header and request parameters required by interface test;
(4) performing single interface test and grouping batch interface test;
(5) and (5) storing a test record.
Example 3:
the embodiment of the invention also provides electronic equipment, which comprises: a memory and a processor;
wherein the memory stores computer-executable instructions;
one processor executes the computer-executable instructions stored by the memory, causing the one processor to perform the method of managing cloud service APIs based on a government cloud platform as in embodiment 1.
Example 4:
the embodiment of the invention also provides a computer readable storage medium, wherein a plurality of instructions are stored, and the instructions are loaded by a processor, so that the processor executes the method for managing cloud service APIs based on the government cloud platform in any embodiment of the invention. Specifically, a system or apparatus provided with a storage medium on which a software program code realizing the functions of any of the above embodiments is stored, and a computer (or CPU or MPU) of the system or apparatus may be caused to read out and execute the program code stored in the storage medium.
In this case, the program code itself read from the storage medium may realize the functions of any of the above-described embodiments, and thus the program code and the storage medium storing the program code form part of the present invention.
Examples of storage media for providing program code include floppy disks, hard disks, magneto-optical disks, optical disks (e.g., CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-R, method and system M, DVD-RW, DVD+RW for managing cloud service APIs based on government cloud platforms), magnetic tape, nonvolatile memory cards, and ROM. Alternatively, the program code may be downloaded from a server computer by a communication network.
Further, it should be apparent that the functions of any of the above-described embodiments may be implemented not only by executing the program code read out by the computer, but also by causing an operating system or the like operating on the computer to perform part or all of the actual operations based on the instructions of the program code.
Further, it is understood that the program code read out by the storage medium is written into a memory provided in an expansion board inserted into a computer or into a memory provided in an expansion unit connected to the computer, and then a CPU or the like mounted on the expansion board or the expansion unit is caused to perform part and all of actual operations based on instructions of the program code, thereby realizing the functions of any of the above embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some or all of the technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the invention.

Claims (10)

1. A method for managing cloud service API based on government cloud platform is characterized in that the method comprises the following steps:
managing cloud service APIs in units of items and being capable of modifying item information and deleting items;
establishing an API corresponding to the project according to the project information, carrying out grouping management on the API corresponding to the project, and sequencing the grouping;
managing a single API, and perfecting preset information of the API corresponding to the project;
adding Mock data for the API;
interface testing is carried out in the API detail function, firstly, interface URL and information of testing parameters are automatically initialized, then complete URL links of different environments are automatically generated, parameter values of the testing are filled, and then an interface request can be initiated once and a result is displayed;
after interface test is carried out, the test result is stored, and the test history records of all interfaces can be checked, restored and deleted;
and taking the service line as a dimension to control the authority, and having the authority of the service line, only allowing the operation of the service line project interface, otherwise, only allowing the viewing.
2. The method for managing cloud service APIs based on a government cloud platform according to claim 1, wherein the project information comprises attribute information of a project and a following address of the project, the attribute information of the project comprises a business line, a project name and a project description, and a root address of the project comprises a test address, a pre-release address and an online address;
the preset information of the API comprises the steps of setting groups for the API, marking star levels of the API, adding the API newly, deleting the API, modifying the API, inquiring the API, perfecting the API attribute and supporting Markdown by the API remarking information.
3. The method for managing cloud service APIs based on government cloud platform according to claim 1 or 2, wherein the Mock data comprises a response result type and response result data; the response result type comprises Json, XML, HTML, TEXT and JSONP; the response result data means that each piece of Mock data generates a unique Mock link, and when the unique Mock link is accessed, the corresponding Mock data is returned according to the set data type such as JSON.
4. A system for managing cloud service APIs based on government cloud platform, wherein the system comprises,
the login module is used for enabling a user to login the API management system according to the account number and the password, enabling the user to open a login interface, and inputting a user name, the password and the verification code to complete login;
the authority control module is used for judging the function authority and the data authority owned by the user according to the service line owned by the user, and the API management system lists a user menu according to the function authority and displays the data conforming to the user according to the data authority;
the service line module is used for realizing maintenance of the service line by an administrator, namely, performing operations of adding, deleting, changing and checking the service line, and distributing users for the service line;
the project management module is used for creating or editing an API project, namely, performing operations of adding, deleting, modifying and searching on the project; simultaneously setting three environments of the project, namely a test environment, a pre-release environment and a formal environment;
the API management module is used for creating or editing an API, perfecting preset information of the API, and simultaneously performing operations of adding, deleting, modifying and searching the API and grouping the API so as to ensure unified management and test of the API with the same property; wherein the APIs belong to items, one API only belongs to one item, and one item comprises a plurality of APIs;
the API testing module is used for selecting a construction mode, inputting API parameters and initializing the API parameters;
and the API test recording module is used for single execution or batch execution, and the execution result of the test cases of the API is saved in the test result library so as to facilitate the subsequent analysis.
5. The system for managing cloud service APIs based on government cloud platform as claimed in claim 4, wherein the working processes of said login module and rights control module are as follows:
firstly, inputting an account number, a password and a verification code by a user;
(II) judging whether the account exists or not:
(1) if the account number is not available, prompting that the account number is wrong, jumping to the step (I), and inputting the account number, the password and the verification code again;
(2) if so, executing the step (III) next;
thirdly, continuing to judge the password, and judging whether the password meets the specification or not:
(1) if the password does not meet the specification, prompting that the password does not meet the specification, jumping to the step (I), and inputting again;
(2) if the specification is met, executing the step (IV) next;
fourthly, performing case-and-space distinguishing processing on the verification code, and judging whether the verification code meets the specification or not:
(1) if the verification code does not meet the specification, prompting that the verification code does not meet the specification, jumping to the step (I), and inputting again;
(2) if the specification is met, executing the step (fifth) next;
and fifthly, encrypting the account number, the password and the verification code, transmitting the encrypted account number, the encrypted password and the verification code to a background service for verification, and firstly verifying whether the verification code is correct or not by the background:
(1) if the verification code is incorrect, returning the verification code to the front end, jumping to the step (I), and inputting the verification code again;
(2) if the result is correct, executing the step (six) next;
and (six) continuing to judge the account number and the password, searching a database by the background service, and judging whether the account number and the password are matched or not:
(1) if the two numbers are not matched, returning an account number and a password error to the front end, jumping to the step (I), inputting again and submitting;
(2) if so, the user logs in successfully, and the step (seventh) is executed next;
seventhly, the API management system reads the role of the user, acquires the function authority and the data authority of the user, and executes the step (eight) next;
(eight) listing a user menu according to the function authority, and executing the step (nine) next;
and (nine) displaying the data conforming to the user according to the data authority.
6. The system for managing cloud service APIs based on government cloud platform as claimed in claim 4, wherein the project management module and the API management module work as follows:
(1) Preparing project information: the project information comprises the attribute information of the project and the following address of the project, the attribute information of the project comprises a service line, a project name and a project description, and the root address of the project comprises a test address, a pre-release address and an on-line address;
(2) Creating an item: creating items according to the prepared item information, and supporting updating and deleting the items;
(3) Creating an API packet: supporting API packet ordering and updating and deleting packets;
(4) Preparing API information, namely preparing preset information of the API, wherein the preset information of the API comprises basic information, a request header, request parameters, a response result and an API description; wherein the basic information includes URL, packet, method, status and name; the URL is the address of the interface request, and the root address is obtained from the root address attribute of the item to which the URL belongs; method is the request Method; the state is an interface state, in the interface list, the starting state interface is marked by a green circle, the maintenance state interface is marked by a yellow circle, and the waste state interface is marked by a gray circle;
the request header includes a header tag and header content; the header tag refers to the type of request header; header content refers to the value of the request header;
the request parameters refer to that the same interface supports setting a plurality of request parameters, and the request parameters comprise parameter names, descriptions, types and whether filling is needed;
the response result includes a response data type MIME and binding data structures for the response data; setting the response data type as Json or XML;
the API description refers to an attribute description supporting a MarkDown format;
(5) Perfect interface description using Markdown;
(6) Creating an API and supporting updating and deleting the API;
(7) API grouping: marking star levels of the API;
(8) Search API: supporting API searching, wherein the searching keyword is URL;
(9) Export import API: the API interface list is exported as a PDF format interface document, and supports the importing of the format interface data of Swagger and Postman.
7. The system for managing cloud service APIs based on a government cloud platform according to any one of claims 4-6, wherein the working procedures of the API test module and the API test recording module are specifically as follows:
(1) entering an interface detail function, and preparing Mock data, wherein the Mock data comprises a result data type and result data;
(2) adding Mock data for the interface, and supporting updating and deleting the Mock data;
(3) setting a request header and request parameters required by interface test;
(4) performing single interface test and grouping batch interface test;
(5) and (5) storing a test record.
8. The system for managing cloud service APIs based on a government cloud platform as claimed in claim 4, further comprising,
the user management module is used for providing two user roles of an administrator and a common user, and users with different roles can modify the personal login password through the password modification function; an administrator owns all rights of the system; the common user defaults to only have the read-only permission of the project interface and the data type, and only allows to operate the project and the interface under the service line after being distributed with the service line permission; the administrator role is used for managing system user information;
the business line management module is used for providing classification management and authority control functions; the classified management is that the project interfaces belong to the service line, and different project interfaces are isolated through the service line, so that the management is convenient; the authority control is that the API management system takes the service line as the dimension to control the authority, and the user only has the authority of the service line and is allowed to operate the service line project interface, otherwise, only is allowed to be checked.
9. An electronic device, comprising: a memory and at least one processor;
wherein the memory stores computer-executable instructions;
the at least one processor executing computer-executable instructions stored in the memory causes the at least one processor to perform the method of managing cloud service APIs based on a government cloud platform as in any of claims 1-3.
10. A computer readable storage medium having stored therein computer executable instructions which, when executed by a processor, implement the method of managing cloud service APIs based on government cloud platforms as defined in claims 1-3.
CN202010747981.1A 2020-07-30 2020-07-30 Method and system for managing cloud service API (application program interface) based on government cloud platform Active CN111880950B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010747981.1A CN111880950B (en) 2020-07-30 2020-07-30 Method and system for managing cloud service API (application program interface) based on government cloud platform

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010747981.1A CN111880950B (en) 2020-07-30 2020-07-30 Method and system for managing cloud service API (application program interface) based on government cloud platform

Publications (2)

Publication Number Publication Date
CN111880950A CN111880950A (en) 2020-11-03
CN111880950B true CN111880950B (en) 2023-12-26

Family

ID=73201995

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010747981.1A Active CN111880950B (en) 2020-07-30 2020-07-30 Method and system for managing cloud service API (application program interface) based on government cloud platform

Country Status (1)

Country Link
CN (1) CN111880950B (en)

Families Citing this family (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112541031A (en) * 2020-12-21 2021-03-23 四川新网银行股份有限公司 Unified data service method and system based on automatic data assembly
CN112764774B (en) * 2020-12-31 2024-05-14 炬星科技(深圳)有限公司 Product information management method, management system, electronic equipment and storage medium
CN112685201A (en) * 2020-12-31 2021-04-20 中国建设银行股份有限公司 Government affair service access control method and device
CN112860551B (en) * 2021-02-02 2024-04-30 浪潮云信息技术股份公司 Method for realizing online debugging and document export based on API gateway
CN114971441A (en) * 2021-02-19 2022-08-30 北京神州数码云科信息技术有限公司 A method of material description information
CN113098867B (en) * 2021-04-01 2021-12-14 博思盈(成都)建筑科技有限公司 Network security big data processing method based on artificial intelligence and big data cloud system
CN113159737B (en) * 2021-05-27 2022-11-01 中国平安人寿保险股份有限公司 RPA service processing method, RPA management platform, device and medium
CN113297595B (en) * 2021-06-09 2025-04-15 北京沃东天骏信息技术有限公司 Privilege escalation processing method, device, storage medium and electronic device
CN113518008A (en) * 2021-07-07 2021-10-19 北京明略软件系统有限公司 Method and device for processing services based on gateway access
CN113535264A (en) * 2021-07-07 2021-10-22 北京明略软件系统有限公司 API processing method and device and electronic equipment
CN113592436B (en) * 2021-07-09 2024-02-06 上海云轴信息科技有限公司 Cloud service management method and equipment based on government cloud platform
CN113837538A (en) * 2021-08-18 2021-12-24 中国科学院自动化研究所 Industrial building business management server and management method thereof
CN113778863A (en) * 2021-08-23 2021-12-10 行云智网络科技(北京)有限公司 A method and system for automated testing
CN114117505A (en) * 2022-01-26 2022-03-01 湖南湘生网络信息有限公司 Universal BS architecture authority management control system based on control group
CN114996106B (en) * 2022-04-22 2024-11-12 马上消费金融股份有限公司 Business system testing method, electronic device and storage medium
CN115061666A (en) * 2022-05-31 2022-09-16 重庆大司空信息科技有限公司 Django-based customized integrated data management system
CN115190016B (en) * 2022-07-25 2023-04-28 平安科技(深圳)有限公司 System general switch configuration method, device, equipment and storage medium
CN115617393B (en) * 2022-10-14 2025-08-01 武汉众邦银行股份有限公司 API information management method based on whole application system group
CN116128517B (en) * 2023-02-17 2023-09-22 连云港海通市民一卡通有限公司 Method and system for managing security of operation data of all-purpose card
CN116578623A (en) * 2023-04-23 2023-08-11 北京海致科技集团有限公司 API-based data exchange method and device
CN116974624B (en) * 2023-06-28 2024-04-05 三峡科技有限责任公司 Enterprise-level interface document management system and method
CN117081849B (en) * 2023-09-28 2024-02-13 上海佑瞻智能科技有限公司 Heterogeneous cloud platform unified management system based on user behavior analysis
CN117768456A (en) * 2023-12-25 2024-03-26 福建新大陆支付技术有限公司 Polymorphic service method, equipment and medium for aggregating POS (point of sale) expansion application capability
CN118939344B (en) * 2024-10-15 2025-03-07 华能信息技术有限公司 A method for configuring system functions of information management

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106327310A (en) * 2016-09-13 2017-01-11 四川虹慧云商科技有限公司 Intelligent business platform based on cloud technology

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8868751B2 (en) * 2011-03-29 2014-10-21 Sap Se Framework for diversified provisioning of services into business networks

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106327310A (en) * 2016-09-13 2017-01-11 四川虹慧云商科技有限公司 Intelligent business platform based on cloud technology

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于SSH框架的云计算建筑项目管理系统研究;易书林;刘毅;;现代电子技术(19);全文 *

Also Published As

Publication number Publication date
CN111880950A (en) 2020-11-03

Similar Documents

Publication Publication Date Title
CN111880950B (en) Method and system for managing cloud service API (application program interface) based on government cloud platform
US20240256254A1 (en) Systems and methods for transformation of reporting schema
US9063808B2 (en) Deploying a package for a software application
CN112506807B (en) Automatic test system for interface serving multiple systems
US20060117055A1 (en) Client-based web server application verification and testing system
US7464004B2 (en) Troubleshooting to diagnose computer problems
US7778801B2 (en) Automated test script for communications server
CN103150647B (en) Report file disposal route, server and system
US12154052B2 (en) Cross-enterprise workflow adaptation
US8402433B2 (en) Method and system for performing automated transactions using a server-side script-engine
CN115203306A (en) Data exporting method and device, computer equipment and readable storage medium
CN116719735A (en) Test case generation method and device
Sakinmaz Python Essentials for AWS Cloud Developers: Run and deploy cloud-based Python applications using AWS
CN119621585B (en) Method, device and medium for automatically generating interface automation test project architecture
Knowlton Python: Create-modify-reuse
US12393676B1 (en) Secure code execution for artificial intelligence agents
CN119885209B (en) A software supply chain and full-cycle network security auxiliary defense system
US11899737B1 (en) System and method for managing information sourced by a primary server that is sent to other servers when a user interacts with a web page without distorting the other servers
KR20130027767A (en) Method and system for providing service for controlling program linked to database
Ragupathi et al. ASP. NET Core: Cloud-ready, Enterprise Web Application Development
CN117726467A (en) RPA-based automatic processing system and method
Sharma et al. Three Layered Crud API Architecture
Valentine Database-Driven Web Development: Learn to Operate at a Professional Level with PERL and MySQL
CN119336385A (en) A method and device for collecting and processing component metadata
EP1783956B1 (en) Automated test script for communications server

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
GR01 Patent grant
GR01 Patent grant