CN113051090A - Interface processing method and device, interface calling method and device, system and medium - Google Patents

Interface processing method and device, interface calling method and device, system and medium Download PDF

Info

Publication number
CN113051090A
CN113051090A CN202110427335.1A CN202110427335A CN113051090A CN 113051090 A CN113051090 A CN 113051090A CN 202110427335 A CN202110427335 A CN 202110427335A CN 113051090 A CN113051090 A CN 113051090A
Authority
CN
China
Prior art keywords
interface
static
name
path
resource
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
CN202110427335.1A
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.)
Industrial and Commercial Bank of China Ltd ICBC
ICBC Technology Co Ltd
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
ICBC 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 Industrial and Commercial Bank of China Ltd ICBC, ICBC Technology Co Ltd filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202110427335.1A priority Critical patent/CN113051090A/en
Publication of CN113051090A publication Critical patent/CN113051090A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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/547Remote procedure calls [RPC]; Web services

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention provides an interface processing method, which is applied to the field of computers and comprises the steps of obtaining the name of a dynamic interface, analyzing the name of the dynamic interface to obtain the request path and the interface parameters of the dynamic interface, and generating the name of a static interface according to the request path and the interface parameters of the dynamic interface.

Description

Interface processing method and device, interface calling method and device, system and medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to an interface processing method and apparatus, an interface calling method and apparatus, a computer system, and a computer-readable storage medium.
Background
At present, a plurality of websites are subjected to page staticizing treatment during construction, and the websites using the page staticizing technology do not need to call a system database during webpage browsing, so that the server burden is reduced, normal access of the websites is not affected when the database is unavailable, and meanwhile, the websites can be safer, attack is reduced, SQL injection is prevented, and the like.
In the process of implementing the concept disclosed by the present disclosure, the inventor finds that the dynamic interface and the static interface are coupled together for judgment and calling in the development process of the front end, and the front end needs to pay attention to the dynamic interface while paying attention to the static interface, which is equivalent to developing the calling logic of two sets of service interfaces, thereby increasing the development cost and reducing the expandability of the service.
Disclosure of Invention
In view of the above, the present disclosure provides an interface processing method and apparatus, an interface calling method and apparatus, a computer system, and a computer-readable storage medium.
A first aspect of the present disclosure provides an interface processing method, including:
acquiring the name of a dynamic interface;
analyzing the name of the dynamic interface to obtain a request path and interface parameters of the dynamic interface;
and generating the name of the static interface according to the request path and the interface parameters of the dynamic interface.
In one embodiment of the present disclosure, the name of the static interface includes a file path and a file name.
In one embodiment of the present disclosure, the generating a name of a static interface according to a request path and an interface parameter of the dynamic interface includes:
generating a file path of the static interface according to the request path of the dynamic interface;
generating a file name of the static interface according to the request path and the interface parameters of the dynamic interface;
and splicing the file path and the file name of the static interface according to the naming rule of the name of the static interface to obtain the name of the static interface.
In one embodiment of the present disclosure, the request path includes a resource path and a resource name, and the generating the file path of the static interface according to the request path of the dynamic interface includes:
extracting resource paths in the request paths;
and determining the resource path as a file path of the static interface.
In one embodiment of the present disclosure, the request path includes a resource path and a resource name, and the generating the file name of the static interface according to the request path and the interface parameter of the dynamic interface includes:
extracting the resource name in the request path;
and generating the file name of the static interface by using the resource name and the interface parameter based on a file name naming rule.
In one embodiment of the present disclosure, the method further includes:
acquiring data returned through the dynamic interface;
and storing the data through the static interface, wherein the stored data are static resources.
A second aspect of the present disclosure provides an interface calling method, including:
responding to the received resource access request, and calling a static interface to obtain a corresponding static resource;
when the static interface is called to obtain the static resource, the dynamic interface is called to obtain corresponding data;
the name of the static interface obtains the request path and the interface parameter of the dynamic interface by analyzing the name of the dynamic interface, and the static interface is generated according to the request path and the interface parameter of the dynamic interface.
The method is applied to page access service, and the static resource is page data.
In one embodiment of the present disclosure, a file path of the static interface is generated according to a request path of the dynamic interface;
generating a file name of the static interface according to the request path and the interface parameters of the dynamic interface;
and splicing the file path and the file name of the static interface according to the naming rule of the name of the static interface to obtain the name of the static interface.
In one embodiment of the present disclosure, the request path includes a resource path and a resource name, and the generating the file path of the static interface according to the request path of the dynamic interface includes:
extracting resource paths in the request paths;
and determining the resource path as a file path of the static interface.
In one embodiment of the present disclosure, the request path includes a resource path and a resource name, and the generating the file name of the static interface according to the request path and the interface parameter of the dynamic interface includes:
extracting the resource name in the request path;
and generating the file name of the static interface by using the resource name and the interface parameter based on a file name naming rule.
A third aspect of the present disclosure provides an interface processing apparatus including:
the acquisition module is used for acquiring the name of the dynamic interface;
the analysis module is used for analyzing the name of the dynamic interface to obtain a request path and interface parameters of the dynamic interface;
and the first generation module is used for generating the name of the static interface according to the request path and the interface parameters of the dynamic interface.
In one embodiment of the present disclosure, the name of the static interface includes a file path and a file name.
In one embodiment of the present disclosure, the first generating module includes:
and the first generation submodule is used for generating a file path of the static interface according to the request path of the dynamic interface.
And the second generation submodule is used for generating the file name of the static interface according to the request path and the interface parameters of the dynamic interface.
And the splicing submodule is used for splicing the file path and the file name of the static interface according to the naming rule of the name of the static interface to obtain the name of the static interface.
In one embodiment of the present disclosure, the request path includes a resource path and a resource name, and the first generation sub-module includes:
a first extraction unit, configured to extract a resource path in the request path;
and the determining unit is used for determining the resource path as the file path of the static interface.
In one embodiment of the present disclosure, the request path includes a resource path and a resource name, and the second generation submodule includes:
the second extraction unit is used for extracting the resource name in the request path;
and the generating unit is used for generating the file name of the static interface by using the resource name and the interface parameter based on a file name naming rule.
In one embodiment of the present disclosure, the interface processing apparatus further includes:
the data acquisition module is used for acquiring data returned by the dynamic interface;
and the storage module is used for storing the data through the static interface, and the stored data is a static resource.
A fourth aspect of the present disclosure provides an interface calling apparatus, including:
the second generation module is used for responding to the received resource access request and calling the static interface to obtain the corresponding static resource;
the calling module is used for calling the dynamic interface to obtain corresponding data when the static interface is called to obtain the static resource;
and the name of the static interface is generated according to the request path and the interface parameters of the dynamic interface.
In one embodiment of the present disclosure, the interface processing device is applied to a page access service, and the static resource is page data.
In one embodiment of the present disclosure, the method further includes:
and the first generation submodule is used for generating a file path of the static interface according to the request path of the dynamic interface.
And the second generation submodule is used for generating the file name of the static interface according to the request path and the interface parameters of the dynamic interface.
And the splicing submodule is used for splicing the file path and the file name of the static interface according to the naming rule of the name of the static interface to obtain the name of the static interface.
In one embodiment of the present disclosure, the request path includes a resource path and a resource name, and the first generation sub-module includes:
a first extraction unit, configured to extract a resource path in the request path;
and the determining unit is used for determining the resource path as the file path of the static interface.
In one embodiment of the present disclosure, the request path includes a resource path and a resource name, and the second generation submodule includes:
the second extraction unit is used for extracting the resource name in the request path;
and the generating unit is used for generating the file name of the static interface by using the resource name and the interface parameter based on a file name naming rule.
A fifth aspect of the present disclosure provides a computer system comprising:
one or more processors;
a memory for storing one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of the first aspect.
A sixth aspect of the present disclosure provides a computer system comprising:
one or more processors;
a memory for storing one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of the second aspect.
A seventh aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions for implementing the method of the first aspect as described above when executed.
An eighth aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions for implementing the method of the second aspect as described above when executed.
According to the embodiment of the disclosure, the name of a dynamic interface is obtained, the name of the dynamic interface is analyzed, the request path and the interface parameter of the dynamic interface are obtained, and the name of a static interface is generated according to the request path and the interface parameter of the dynamic interface. The static interface is generated not by the service type or function but by the name of the dynamic interface, so that the static interface and the dynamic interface are associated, technicians can obtain the static interface by developing the dynamic interface through the scheme, the front-end development cost is reduced, and the expandability of the front-end code is improved.
Drawings
The above and other objects, features and advantages of the present disclosure will become more apparent from the following description of embodiments of the present disclosure with reference to the accompanying drawings, in which:
FIG. 1 schematically illustrates an exemplary system architecture to which interface processing methods and apparatus, interface calling methods and apparatus, may be applied, according to embodiments of the disclosure;
FIG. 2 schematically illustrates a flow chart of an interface processing method according to an embodiment of the present disclosure;
FIG. 3 schematically shows a flow chart of an interface processing method according to an embodiment of the present disclosure;
FIG. 4 schematically illustrates a flow chart of a method of page quieting according to an embodiment of the disclosure;
FIG. 5 schematically illustrates a flow chart of an interface invocation method according to an embodiment of the present disclosure;
FIG. 6 schematically shows a block diagram of an interface processing device according to an embodiment of the present disclosure;
FIG. 7 schematically illustrates a block diagram of an interface invocation apparatus according to an embodiment of the present disclosure;
FIG. 8 schematically shows a block diagram of a computer system according to an embodiment of the disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is illustrative only and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It is noted that the terms used herein should be interpreted as having a meaning that is consistent with the context of this specification and should not be interpreted in an idealized or overly formal sense.
Where a convention analogous to "at least one of A, B and C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B and C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.). Where a convention analogous to "A, B or at least one of C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B or C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
The embodiment of the disclosure provides an interface processing method, which includes obtaining a name of a dynamic interface, analyzing the name of the dynamic interface, and obtaining a request path and interface parameters of the dynamic interface. And generating the name of the static interface according to the request path and the interface parameters of the dynamic interface. The embodiment of the disclosure provides an interface calling method, which includes: and calling a static interface to obtain corresponding static resources in response to the received resource access request, calling a dynamic interface to obtain corresponding data when the static interface is not called to obtain the static resources, wherein the name of the static interface obtains a request path and interface parameters of the dynamic interface by analyzing the name of the dynamic interface, and generating the request path and interface parameters according to the dynamic interface.
Fig. 1 schematically illustrates an exemplary system architecture 100 to which interface processing methods and apparatus, interface calling methods and apparatus, may be applied, according to embodiments of the disclosure. It should be noted that fig. 1 is only an example of a system architecture to which the embodiments of the present disclosure may be applied to help those skilled in the art understand the technical content of the present disclosure, and does not mean that the embodiments of the present disclosure may not be applied to other devices, systems, environments or scenarios.
As shown in fig. 1, the system architecture 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104, a server 105, a server 106. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103, the server 105, and the server 106. Network 104 may include various connection types, such as wired and/or wireless communication links, and so forth.
The user may use the terminal devices 101, 102, 103 to interact with the server 105, the server 106 via the network 104, to receive or send messages, etc. The terminal devices 101, 102, 103 may have installed thereon various communication client applications, such as a shopping-like application, a web browser application, a search-like application, an instant messaging tool, a mailbox client, and/or social platform software, etc. (by way of example only).
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The servers 105, 106 may be servers providing various services, such as background management servers (for example only) providing support for websites browsed by users using the terminal devices 101, 102, 103. The background management server may analyze and perform other processing on the received data such as the user request, and feed back a processing result (e.g., a webpage, information, or data obtained or generated according to the user request) to the terminal device.
It should be noted that the interface processing method provided by the embodiments of the present disclosure may be generally executed by the servers 105 and 106. Accordingly, the interface processing apparatus provided by the embodiments of the present disclosure may be generally disposed in the servers 105, 106. The interface processing method provided by the embodiment of the present disclosure may also be executed by a server or a server cluster different from the server 105 and capable of communicating with the terminal devices 101, 102, 103 and/or the servers 105, 106. Accordingly, the interface processing apparatus provided by the embodiment of the present disclosure may also be disposed in a server or a server cluster different from the servers 105 and 106 and capable of communicating with the terminal devices 101, 102 and 103 and/or the servers 105 and 106. Alternatively, the interface processing method provided by the embodiment of the present disclosure may also be executed by the terminal device 101, 102, or 103, or may also be executed by another terminal device different from the terminal device 101, 102, or 103. Accordingly, the interface processing apparatus provided by the embodiment of the present disclosure may also be disposed in the terminal device 101, 102, or 103, or in another terminal device different from the terminal device 101, 102, or 103.
For example, the name of the dynamic interface may be originally stored in any of the terminal devices 101, 102, or 103 (e.g., the terminal device 101, but not limited thereto), or stored on an external storage device and may be imported into the terminal device 101. Then, the terminal device 101 may locally execute the interface processing method provided by the embodiment of the present disclosure, or send the name of the dynamic interface to another terminal device, a server, or a server cluster, and execute the interface processing method provided by the embodiment of the present disclosure by another terminal device, a server, or a server cluster that receives the name of the dynamic interface.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
In the present disclosure, the term "page quiesce" refers to caching accessed data (including databases, local storage, etc.) in advance in some form.
In this disclosure, a dynamic interface refers to an interface that obtains data, which may be page data or other data, from a database through an application service.
In the present disclosure, a static interface refers to a static resource generated by a dynamic interface in a static page and stored in a designated storage space in a file form, a front end obtains data by accessing the static resource in the designated storage space, an access path of the front end is called as a static interface, and the designated storage space may be a WEB server.
Fig. 2 schematically shows a flow chart of an interface processing method according to an embodiment of the present disclosure.
As shown in fig. 2, the method includes operations S201 to S203.
In operation S201, a name of a dynamic interface is acquired.
In operation S202, the name of the dynamic interface is parsed to obtain a request path and interface parameters of the dynamic interface.
In operation S203, a name of a static interface is generated according to the request path and the interface parameters of the dynamic interface.
In the present disclosure, the name of the dynamic interface includes a request path and interface parameters, the request path includes a resource path and a resource name, and the last slash of the request path is preceded by the resource path and followed by the resource name. Generally, in a dynamic interface, by the symbol "? "connected," it being understood that other symbols may be used for connection.
In one example, the name of the dynamic interface is, for example,/sys/user/getListparam ═ 1& pageSize ═ 10& pageIndex ═ 1, then the request path is/sys/user/getList, and the interface parameter is param ═ 1& pageSize ═ 10& pageIndex ═ 1.
In the disclosure, the name of the static interface includes a file path and a file name, and the name of the static interface is generated according to the request path and the interface parameter of the dynamic interface, which may be extracting the parts of the request path and the interface parameter that can constitute the file path and the file name, and combining them according to the naming rule of the name of the static interface to obtain the name of the static interface.
According to the embodiment of the disclosure, the name of the dynamic interface is acquired, the name of the dynamic interface is analyzed, the request path and the interface parameter of the dynamic interface are acquired, and the name of the static interface is generated according to the request path and the interface parameter of the dynamic interface. The static interface is generated not by the service type or function but by the name of the dynamic interface, so that the static interface and the dynamic interface are associated, technicians can obtain the static interface by developing the dynamic interface through the scheme, the front-end development cost is reduced, and the expandability of the front-end code is improved.
Fig. 3 schematically shows a flow chart of an interface processing method according to an embodiment of the present disclosure.
As shown in fig. 3, in addition to comprising operations S201 to S203, operation S203: generating the name of the static interface according to the request path and the interface parameter of the dynamic interface, and further comprising operations S301 to S303.
In operation S301, a file path of the static interface is generated according to the request path of the dynamic interface.
In operation S302, a file name of the static interface is generated according to the request path and the interface parameters of the dynamic interface.
In operation S303, the file path and the file name of the static interface are spliced according to the naming rule of the name of the static interface, so as to obtain the name of the static interface.
In one embodiment of the present disclosure, the request path of the dynamic interface includes a resource path and a resource name. In one example, the name of the dynamic interface is, for example,/sys/user/getListparam ═ 1& pageSize ═ 10& pageIndex ═ 1, where the request path is/sys/user/getList, then the interface parameters are param ═ 1& pageSize ═ 10& pageIndex ═ 1. In request path/sys/user/getList, the resource path is/sys/user, and the resource name is getList.
Specifically, operation S301: the generating of the file path of the static interface according to the request path of the dynamic interface may be extracting a resource path in the request path, and determining the resource path as the file path of the static interface. In the above example, that is, when the name of the dynamic interface is/sys/user/getListparam ═ 1& pageSize ═ 10& pageIndex ═ 1, the resource path/sys/user is determined as the file path of the static interface.
Specifically, operation S302: the file name of the static interface is generated according to the request path and the interface parameters of the dynamic interface, which may be extracting a resource name in the request path, and generating the file name of the static interface by using the resource name and the interface parameters based on a file name naming rule. For example, the file name naming rule may be finally added with ". json". xml ", etc., and the present disclosure is not limited thereto. Taking the example that the file name naming rule is added last with ". json", in the above example, when the name of the dynamic interface is/sys/user/getListparam 1& pageSize 10& pageIndex 1, the file name of the static interface is generated using the resource name getList and the interface parameter param 1& pageSize 10& pageIndex 1, getList & param 1& pageSize 10& pageIndex 1, json.
Specifically, in operation S303, the name of the static interface is named, for example, by connecting the file path and the file name through the symbol "&", and the generated name of the static interface is/sys/user & getList & param 1& pageSize 10& pageIndex 1 json.
FIG. 4 schematically shows a flow chart of a page quieting method according to an embodiment of the disclosure.
As shown in fig. 4, the method includes operations S401 to S402, in addition to operations S201 to S203.
In operation S201, a name of a dynamic interface is acquired.
In operation S202, the name of the dynamic interface is parsed to obtain a request path and interface parameters of the dynamic interface.
In operation S203, a name of a static interface is generated according to the request path and the interface parameters of the dynamic interface.
In operation S401, data returned through the dynamic interface is acquired.
In operation S402, the data is stored through the static interface, and the stored data is a static resource.
In the present disclosure, the dynamic interface obtains data from the database through the application service, and then stores the data through the static interface generated by the dynamic interface, thereby implementing the staticizing process. The storage address of the data is not limited in the disclosure, and for page staticizing processing, the data can be page data, the page data can be stored in a WEB server, and the data stored in the WEB server is called as static resources.
In the disclosure, for the page access service subjected to the page staticizing processing, when a website page is accessed, static resources in the WEB server are preferentially accessed through the static interface, and if the static resources do not exist, the database is accessed through the dynamic interface.
According to the embodiment of the disclosure, the name of a dynamic interface is acquired, the name of the dynamic interface is analyzed, the request path and the interface parameter of the dynamic interface are acquired, the name of a static interface is generated according to the request path and the interface parameter of the dynamic interface, data returned through the dynamic interface is acquired, the data is stored through the static interface, and the stored data is a static resource. Technicians can obtain the static interface only by developing the dynamic interface through the scheme, the front-end development cost is reduced, and the staticizing processing efficiency is improved.
Fig. 5 schematically shows a flow chart of an interface invocation method according to an embodiment of the present disclosure.
As shown in fig. 5, the method includes operations S501 to S502.
In operation S501, in response to the received resource access request, a static interface is called to obtain a corresponding static resource, the name of the static interface obtains a request path and an interface parameter of the dynamic interface by analyzing the name of the dynamic interface, and the static resource is generated according to the request path and the interface parameter of the dynamic interface.
In operation S502, when the static interface is called and the static resource is not acquired, the dynamic interface is called to acquire the resource.
In the disclosure, when a resource access request is received, a static interface is first called to obtain a static resource corresponding to the resource access request, and when the static resource is not obtained from the static interface, a dynamic interface is called to obtain data corresponding to the resource access request. The technical personnel only need to develop the dynamic interface and can obtain the static interface through the scheme, the development personnel only need to maintain the dynamic interface or the static interface, and meanwhile, the static interface and the dynamic interface are associated, so that the interface is more convenient to call.
In one embodiment of the present disclosure, the interface calling method is applied to a page access service, and the static resource is page data.
In one embodiment of the present disclosure, a file path of the static interface is generated according to the request path of the dynamic interface, a file name of the static interface is generated according to the request path and the interface parameters of the dynamic interface, and the file path and the file name of the static interface are spliced according to the naming rule of the name of the static interface to obtain the name of the static interface.
In one embodiment of the present disclosure, the request path includes a resource path and a resource name, and generating the file path of the static interface according to the request path of the dynamic interface includes extracting the resource path in the request path, and determining the resource path as the file path of the static interface.
In one embodiment of the present disclosure, the request path includes a resource path and a resource name, and the generating the file name of the static interface according to the request path and the interface parameter of the dynamic interface includes: and extracting the resource name in the request path, and generating the file name of the static interface by using the resource name and the interface parameter based on a file name naming rule.
Fig. 6 schematically shows a block diagram of an interface processing device according to an embodiment of the present disclosure.
As shown in fig. 6, the interface processing apparatus 600 includes an obtaining module 610, a parsing module 620, and a first generating module 630.
The obtaining module 610 is configured to obtain a name of the dynamic interface.
The parsing module 620 is configured to parse the name of the dynamic interface to obtain a request path and interface parameters of the dynamic interface.
The first generating module 630 is configured to generate a name of the static interface according to the request path and the interface parameter of the dynamic interface.
In one embodiment of the present disclosure, the name of the static interface includes a file path and a file name.
In one embodiment of the present disclosure, the first generating module 630 includes:
and the first generation submodule is used for generating a file path of the static interface according to the request path of the dynamic interface.
And the second generation submodule is used for generating the file name of the static interface according to the request path and the interface parameters of the dynamic interface.
And the splicing submodule is used for splicing the file path and the file name of the static interface according to the naming rule of the name of the static interface to obtain the name of the static interface.
In one embodiment of the present disclosure, the request path includes a resource path and a resource name, and the first generation sub-module includes:
a first extraction unit, configured to extract a resource path in the request path;
and the determining unit is used for determining the resource path as the file path of the static interface.
In one embodiment of the present disclosure, the request path includes a resource path and a resource name, and the second generation submodule includes:
the second extraction unit is used for extracting the resource name in the request path;
and the generating unit is used for generating the file name of the static interface by using the resource name and the interface parameter based on the file name naming rule.
In one embodiment of the present disclosure, the interface processing apparatus 600 further includes:
the data acquisition module is used for acquiring data returned by the dynamic interface;
and the storage module is used for storing the data through the static interface, and the stored data is a static resource.
Fig. 7 schematically shows a block diagram of an interface invocation means according to an embodiment of the present disclosure.
As shown in fig. 7, the interface processing apparatus 700 includes a first calling module 710 and a second calling module 720.
The first calling module 710 is configured to, in response to the received resource access request, call the static interface to obtain a corresponding static resource.
The second calling module 720 is configured to call the dynamic interface to obtain corresponding data when the static interface is called and the static resource is not obtained.
The name of the static interface obtains the request path and the interface parameters of the dynamic interface by analyzing the name of the dynamic interface, and the static interface is generated according to the request path and the interface parameters of the dynamic interface.
In one embodiment of the present disclosure, the interface processing device 700 is applied to a page access service, and the static resource is page data.
In one embodiment of the present disclosure, the method further includes:
and the first generation submodule is used for generating a file path of the static interface according to the request path of the dynamic interface.
And the second generation submodule is used for generating the file name of the static interface according to the request path and the interface parameters of the dynamic interface.
And the splicing submodule is used for splicing the file path and the file name of the static interface according to the naming rule of the name of the static interface to obtain the name of the static interface.
In one embodiment of the present disclosure, the request path includes a resource path and a resource name, and the first generation sub-module includes:
a first extraction unit, configured to extract a resource path in the request path;
and the determining unit is used for determining the resource path as the file path of the static interface.
In one embodiment of the present disclosure, the request path includes a resource path and a resource name, and the second generation submodule includes:
the second extraction unit is used for extracting the resource name in the request path;
and the generating unit is used for generating the file name of the static interface by using the resource name and the interface parameter based on the file name naming rule.
Any number of modules, sub-modules, units, sub-units, or at least part of the functionality of any number thereof according to embodiments of the present disclosure may be implemented in one module. Any one or more of the modules, sub-modules, units, and sub-units according to the embodiments of the present disclosure may be implemented by being split into a plurality of modules. Any one or more of the modules, sub-modules, units, sub-units according to embodiments of the present disclosure may be implemented at least in part as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented in any other reasonable manner of hardware or firmware by integrating or packaging a circuit, or in any one of or a suitable combination of software, hardware, and firmware implementations. Alternatively, one or more of the modules, sub-modules, units, sub-units according to embodiments of the disclosure may be at least partially implemented as a computer program module, which when executed may perform the corresponding functions.
For example, any plurality of the obtaining module 610, the parsing module 620 and the first generating module 630 may be combined and implemented in one module/unit/sub-unit, or any one of the modules/units/sub-units may be split into a plurality of modules/units/sub-units. Alternatively, at least part of the functionality of one or more of these modules/units/sub-units may be combined with at least part of the functionality of other modules/units/sub-units and implemented in one module/unit/sub-unit. According to an embodiment of the present disclosure, at least one of the obtaining module 610, the parsing module 620, and the first generating module 630 may be implemented at least partially as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented by hardware or firmware in any other reasonable manner of integrating or packaging a circuit, or may be implemented by any one of three implementations of software, hardware, and firmware, or any suitable combination of any of the three implementations. Alternatively, at least one of the obtaining module 610, the parsing module 620, the first generating module 630 may be at least partially implemented as a computer program module, which when executed may perform a corresponding function.
It should be noted that the interface processing device portion in the embodiments of the present disclosure corresponds to the interface processing method portion in the embodiments of the present disclosure, and the description of the interface processing device portion specifically refers to the interface processing method portion. Similarly, the interface calling device portion in the embodiment of the present disclosure corresponds to the interface calling method portion in the embodiment of the present disclosure, and the description of the interface calling device portion specifically refers to the interface calling method portion, which is not described herein again.
FIG. 8 schematically shows a block diagram of a computer system suitable for implementing any of the methods described above, according to an embodiment of the present disclosure. The computer system illustrated in FIG. 8 is only one example and should not impose any limitations on the scope of use or functionality of embodiments of the disclosure.
As shown in fig. 8, a computer system 800 according to an embodiment of the present disclosure includes a processor 801 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)802 or a program loaded from a storage section 808 into a Random Access Memory (RAM) 803. The processor 801 may include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or associated chipset, and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), among others. The processor 801 may also include onboard memory for caching purposes. The processor 801 may include a single processing unit or multiple processing units for performing different actions of the method flows according to embodiments of the present disclosure.
In the RAM 803, various programs and data necessary for the operation of the system 800 are stored. The processor 801, the ROM 802, and the RAM 803 are connected to each other by a bus 804. The processor 801 performs various operations of the method flows according to the embodiments of the present disclosure by executing programs in the ROM 802 and/or RAM 803. Note that the program may also be stored in one or more memories other than the ROM 802 and the RAM 803. The processor 801 may also perform various operations of method flows according to embodiments of the present disclosure by executing programs stored in the one or more memories.
System 800 may also include an input/output (I/O) interface 805, also connected to bus 804, according to an embodiment of the disclosure. The system 800 may also include one or more of the following components connected to the I/O interface 805: an input portion 806 including a keyboard, a mouse, and the like; an output section 807 including a signal such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 808 including a hard disk and the like; and a communication section 809 including a network interface card such as a LAN card, a modem, or the like. The communication section 809 performs communication processing via a network such as the internet. A drive 810 is also connected to the I/O interface 805 as necessary. A removable medium 811 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 810 as necessary, so that a computer program read out therefrom is mounted on the storage section 808 as necessary.
According to embodiments of the present disclosure, method flows according to embodiments of the present disclosure may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable storage medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 809 and/or installed from the removable medium 811. The computer program, when executed by the processor 801, performs the above-described functions defined in the system of the embodiments of the present disclosure. The systems, devices, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.
The present disclosure also provides a computer-readable storage medium, which may be contained in the apparatus/device/system described in the above embodiments; or may exist separately and not be assembled into the device/apparatus/system. The computer-readable storage medium carries one or more programs which, when executed, implement the method according to an embodiment of the disclosure.
According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. Examples may include, but are not limited to: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
For example, according to embodiments of the present disclosure, a computer-readable storage medium may include the ROM 802 and/or RAM 803 described above and/or one or more memories other than the ROM 802 and RAM 803.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Those skilled in the art will appreciate that various combinations and/or combinations of features recited in the various embodiments and/or claims of the present disclosure can be made, even if such combinations or combinations are not expressly recited in the present disclosure. In particular, various combinations and/or combinations of the features recited in the various embodiments and/or claims of the present disclosure may be made without departing from the spirit or teaching of the present disclosure. All such combinations and/or associations are within the scope of the present disclosure.
The embodiments of the present disclosure have been described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described separately above, this does not mean that the measures in the embodiments cannot be used in advantageous combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be devised by those skilled in the art without departing from the scope of the present disclosure, and such alternatives and modifications are intended to be within the scope of the present disclosure.

Claims (19)

1. An interface processing method, comprising:
acquiring the name of a dynamic interface;
analyzing the name of the dynamic interface to obtain a request path and interface parameters of the dynamic interface;
and generating the name of the static interface according to the request path and the interface parameters of the dynamic interface.
2. The method of claim 1, the name of the static interface comprising a file path and a file name.
3. The method of claim 2, wherein generating the name of the static interface according to the request path and the interface parameters of the dynamic interface comprises:
generating a file path of the static interface according to the request path of the dynamic interface;
generating a file name of the static interface according to the request path and the interface parameters of the dynamic interface;
and splicing the file path and the file name of the static interface according to the naming rule of the name of the static interface to obtain the name of the static interface.
4. The method of claim 3, the request path comprising a resource path and a resource name, the generating the file path of the static interface according to the request path of the dynamic interface comprising:
extracting resource paths in the request paths;
and determining the resource path as a file path of the static interface.
5. The method of claim 3 or 4, the request path comprising a resource path and a resource name, and the generating the file name of the static interface according to the request path and the interface parameters of the dynamic interface comprising:
extracting the resource name in the request path;
and generating the file name of the static interface by using the resource name and the interface parameter based on a file name naming rule.
6. The method of claim 1 or 2, further comprising:
acquiring data returned through the dynamic interface;
and storing the data through the static interface, wherein the stored data are static resources.
7. An interface calling method, comprising:
responding to the received resource access request, and calling a static interface to obtain a corresponding static resource;
when the static interface is called to obtain the static resource, the dynamic interface is called to obtain corresponding data;
the name of the static interface obtains the request path and the interface parameter of the dynamic interface by analyzing the name of the dynamic interface, and the static interface is generated according to the request path and the interface parameter of the dynamic interface.
8. The method of claim 6, applied to a page access service, wherein the static resource is page data.
9. The method of claim 7, wherein a file path of the static interface is generated according to a request path of the dynamic interface;
generating a file name of the static interface according to the request path and the interface parameters of the dynamic interface;
and splicing the file path and the file name of the static interface according to the naming rule of the name of the static interface to obtain the name of the static interface.
10. The method of claim 9, wherein the request path comprises a resource path and a resource name, and the generating the file path of the static interface according to the request path of the dynamic interface comprises:
extracting resource paths in the request paths;
and determining the resource path as a file path of the static interface.
11. The method according to claim 9 or 10, wherein the request path includes a resource path and a resource name, and the generating the file name of the static interface according to the request path and the interface parameters of the dynamic interface includes:
extracting the resource name in the request path;
and generating the file name of the static interface by using the resource name and the interface parameter based on a file name naming rule.
12. An interface processing apparatus comprising:
the acquisition module is used for acquiring the name of the dynamic interface;
the analysis module is used for analyzing the name of the dynamic interface to obtain a request path and interface parameters of the dynamic interface;
and the first generation module is used for generating the name of the static interface according to the request path and the interface parameters of the dynamic interface.
13. The apparatus of claim 12, the name of the static interface comprising a file path and a file name.
14. An interface invocation apparatus, comprising:
the second generation module is used for responding to the received resource access request and calling the static interface to obtain the corresponding static resource;
the calling module is used for calling the dynamic interface to obtain corresponding data when the static interface is called to obtain the static resource;
and the name of the static interface is generated according to the request path and the interface parameters of the dynamic interface.
15. The apparatus of claim 14, applied to a page access service, wherein the static resource is page data.
16. A computer system, comprising:
one or more processors;
a memory for storing one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1-6.
17. A computer system, comprising:
one or more processors;
a memory for storing one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 7-11.
18. A computer readable storage medium having stored thereon executable instructions which, when executed by a processor, cause the processor to carry out the method of any one of claims 1 to 6.
19. A computer readable storage medium having stored thereon executable instructions which, when executed by a processor, cause the processor to carry out the method of any one of claims 7 to 11.
CN202110427335.1A 2021-04-20 2021-04-20 Interface processing method and device, interface calling method and device, system and medium Pending CN113051090A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110427335.1A CN113051090A (en) 2021-04-20 2021-04-20 Interface processing method and device, interface calling method and device, system and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110427335.1A CN113051090A (en) 2021-04-20 2021-04-20 Interface processing method and device, interface calling method and device, system and medium

Publications (1)

Publication Number Publication Date
CN113051090A true CN113051090A (en) 2021-06-29

Family

ID=76519795

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110427335.1A Pending CN113051090A (en) 2021-04-20 2021-04-20 Interface processing method and device, interface calling method and device, system and medium

Country Status (1)

Country Link
CN (1) CN113051090A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040260722A1 (en) * 2000-04-27 2004-12-23 Microsoft Corporation Web address converter for dynamic web pages
CN101183395A (en) * 2007-12-25 2008-05-21 北京中企开源信息技术有限公司 Method and system for realizing staticize of dynamic page
CN104915387A (en) * 2015-05-25 2015-09-16 成都视达科信息技术有限公司 Internet website static state page processing system and method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040260722A1 (en) * 2000-04-27 2004-12-23 Microsoft Corporation Web address converter for dynamic web pages
CN101183395A (en) * 2007-12-25 2008-05-21 北京中企开源信息技术有限公司 Method and system for realizing staticize of dynamic page
CN104915387A (en) * 2015-05-25 2015-09-16 成都视达科信息技术有限公司 Internet website static state page processing system and method

Similar Documents

Publication Publication Date Title
CN113434241A (en) Page skipping method and device
CN113505302A (en) Method, device and system for supporting dynamic acquisition of buried point data and electronic equipment
CN115357761A (en) Link tracking method and device, electronic equipment and storage medium
CN113132400B (en) Business processing method, device, computer system and storage medium
CN112965916B (en) Page testing method, page testing device, electronic equipment and readable storage medium
CN114237651A (en) Installation method and device of cloud native application, electronic equipment and medium
CN113176907A (en) Interface data calling method and device, computer system and readable storage medium
CN112825096A (en) Data desensitization method and device
CN116561013B (en) Testing method and device based on target service framework, electronic equipment and medium
CN113553123A (en) Data processing method and device, electronic equipment and storage medium
CN113191889A (en) Wind control configuration method, configuration system, electronic device and readable storage medium
CN111414154A (en) Method and device for front-end development, electronic equipment and storage medium
CN112732547B (en) Service testing method and device, storage medium and electronic equipment
CN111783005A (en) Method, apparatus and system for displaying web page, computer system and medium
CN112988604B (en) Object testing method, testing system, electronic device and readable storage medium
CN114780361A (en) Log generation method, device, computer system and readable storage medium
CN113051090A (en) Interface processing method and device, interface calling method and device, system and medium
CN113448578A (en) Page data processing method, processing system, electronic device and readable storage medium
CN112506781A (en) Test monitoring method, test monitoring device, electronic device, storage medium, and program product
CN113760274A (en) Front-end component logic injection method and device
CN112068814A (en) Method, device, system and medium for generating executable file
CN113535565B (en) Interface use case generation method, device, equipment and medium
CN113347250B (en) Data access method, data access device, electronic equipment and readable storage medium
CN114237624A (en) Go language-based error processing method, device, equipment, medium and product
CN114490891A (en) Data processing method, apparatus, device, medium, and program product

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