CN115687824A - Page request processing method and device, electronic equipment and computer readable medium - Google Patents

Page request processing method and device, electronic equipment and computer readable medium Download PDF

Info

Publication number
CN115687824A
CN115687824A CN202211386944.8A CN202211386944A CN115687824A CN 115687824 A CN115687824 A CN 115687824A CN 202211386944 A CN202211386944 A CN 202211386944A CN 115687824 A CN115687824 A CN 115687824A
Authority
CN
China
Prior art keywords
request
page
information
switched
splicing
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
CN202211386944.8A
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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun 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 Beijing Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202211386944.8A priority Critical patent/CN115687824A/en
Publication of CN115687824A publication Critical patent/CN115687824A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the disclosure discloses a page request processing method and device, electronic equipment and a computer readable medium. One embodiment of the method comprises: in response to detecting the page request, determining a request address included in the page request; responding to interface switching information which is determined to exist in an interface switching information set and comprises original request address information and a request address matched with each other, performing re-splicing processing on a page request according to switched request information included in the interface switching information to obtain a re-spliced page request, wherein the re-spliced page request comprises a switched request address corresponding to the switched request information, and the interface switching information in the interface switching information set comprises the original request address information and the switched request information; and initiating a re-splicing page request according to the switched request address. The implementation mode is related to API gateway switching, can avoid missing change request information, can be decoupled with the existing business logic when the request information is changed, and reduces the change range and time consumption.

Description

Page request processing method and device, electronic equipment and computer readable medium
Technical Field
The embodiment of the disclosure relates to the technical field of computers, in particular to a page request processing method, a page request processing device, electronic equipment and a computer readable medium.
Background
The API gateway can be regarded as an external entrance for communicating with the system, and can perform routing, load balancing, protocol conversion, safety protection, current limiting and fusing and the like on the request. At present, when an API gateway is switched, that is, request information of a page request is changed, a method generally adopted is as follows: and positioning the request information used for sending the page request in the page file, and redefining the request information according to the access request of the API gateway interface document to be switched.
However, when the request information of the page request is changed in the above manner, there are often the following technical problems: the request information needs to be positioned and changed one by one, and when more request information needs to be positioned and changed, more times of omitting and changing the request information are caused; the request information needs to be positioned in the page file, so that the request information cannot be logically decoupled from the existing service when being changed, and the problems of large change range and long time consumption are caused.
The above information disclosed in this background section is only for enhancement of understanding of the background of the inventive concept and, therefore, it may contain information that does not form the prior art that is already known to a person of ordinary skill in the art in this country.
Disclosure of Invention
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
Some embodiments of the present disclosure propose a page request processing method, apparatus, electronic device and computer readable medium to solve one or more of the technical problems mentioned in the background section above.
In a first aspect, some embodiments of the present disclosure provide a page request processing method, where the method includes: responding to the detected page request, and determining a request address included by the page request; responding to interface switching information which is determined to exist in an interface switching information set and comprises original request address information matched with the request address, performing re-splicing processing on the page request according to switched request information contained in the interface switching information to obtain a re-spliced page request, wherein the re-spliced page request comprises a switched request address corresponding to the switched request information, and the interface switching information in the interface switching information set comprises the original request address information and the switched request information; and initiating the re-splicing page request according to the switched request address.
Optionally, before initiating the request for the rejoined page according to the switched request address, the method further includes: and adding a time stamp in the re-splicing page request so as to update the re-splicing page request.
Optionally, the request information after switching includes an interface identifier after switching; and performing a re-splicing process on the page request according to the switched request information included in the interface switching information to obtain a re-spliced page request, including: determining the request address corresponding to the switched interface identifier as a switched request address; splicing each request parameter corresponding to the switched interface identifier according to the page request and a request parameter information set included in the page request to generate splicing request parameter information to obtain a splicing request parameter information set; and generating a re-splicing page request according to the switched request address and the splicing request parameter information set.
Optionally, the generating a re-splicing page request according to the switched request address and the splicing request parameter information set includes: determining request header parameter information corresponding to the switched interface identifier as switched request header parameter information, wherein the switched request header parameter information comprises cache parameter information; and generating a re-splicing page request according to the switched request address, the splicing request parameter information set and the switched request header parameter information.
Optionally, the generating a re-splicing page request according to the switched request address, the splicing request parameter information set, and the switched request header parameter information includes: replacing the request address and the request parameter information set included in the page request with the switched request address and the splicing request parameter information set respectively; and updating the request header parameter information included in the replaced page request according to the switched request header parameter information so as to take the updated page request as a re-splicing page request.
Optionally, the method further comprises: and responding to the interface switching information which is determined that the original request address information and the request address are not matched in the interface switching information set, and initiating the page request.
Optionally, the method further comprises: and initiating the page request in response to detecting that the interface switching information corresponding to the re-splicing page request is deleted from the interface switching information set or the re-splicing page request fails.
Optionally, before the initiating the page request, the method further includes: and adding a time stamp in the page request to update the page request.
Optionally, the method further comprises: responding to a received request response result corresponding to the re-splicing page request or the page request, and analyzing the request response result; and displaying the page of the analyzed request response result on the associated display equipment.
In a second aspect, some embodiments of the present disclosure provide a page request processing apparatus, including: a determining unit configured to determine a request address included in a page request in response to detecting the page request; the splicing unit is configured to perform re-splicing processing on the page request according to switched request information included in interface switching information set in response to determining that the interface switching information set includes interface switching information matching an original request address information and the request address, so as to obtain a re-spliced page request, wherein the re-spliced page request includes a switched request address corresponding to the switched request information, and the interface switching information in the interface switching information set includes the original request address information and the switched request information; and the initiating unit is configured to initiate the re-splicing page request according to the switched request address.
Optionally, before the initiating unit, the apparatus further comprises: and the first time stamp adding unit is configured to add a time stamp in the re-splicing page request so as to update the re-splicing page request.
Optionally, the request information after switching includes an interface identifier after switching.
Optionally, the splicing unit comprises: the device comprises a request address determining unit, a request parameter splicing unit and a re-splicing page request generating unit after switching. The switched request address determining unit is configured to determine a request address corresponding to the switched interface identifier as a switched request address. The request parameter splicing unit is configured to splice each request parameter corresponding to the switched interface identifier according to the page request and a request parameter information set included in the page request to generate splicing request parameter information, so as to obtain a splicing request parameter information set. The re-splicing page request generating unit is configured to generate a re-splicing page request according to the switched request address and the splicing request parameter information set.
Optionally, the rejoined page request generating unit is further configured to: determining request header parameter information corresponding to the switched interface identifier as switched request header parameter information, wherein the switched request header parameter information comprises cache parameter information; and generating a re-splicing page request according to the switched request address, the splicing request parameter information set and the switched request header parameter information.
Optionally, the rejoined page request generating unit is further configured to: replacing the request address and the request parameter information set included in the page request with the switched request address and the splicing request parameter information set respectively; and updating the request header parameter information included in the replaced page request according to the switched request header parameter information so as to take the updated page request as a re-splicing page request.
Optionally, the apparatus further comprises: and the first page request initiating unit is configured to initiate the page request in response to determining that no interface switching information which is included in the interface switching information set and matches the original request address information with the request address exists.
Optionally, the apparatus further comprises: and the second page request initiating unit is configured to initiate the page request in response to detecting that the interface switching information corresponding to the re-splicing page request is deleted from the interface switching information set or the re-splicing page request fails.
Optionally, before the first page request initiating unit or the second page request initiating unit, the apparatus further includes: and the second time stamp adding unit is configured to add a time stamp in the page request so as to update the page request.
Optionally, the apparatus further comprises: the device comprises an analysis unit and a display unit. The parsing unit is configured to parse the request response result in response to receiving the request response result corresponding to the re-splicing page request or the page request. The presentation unit is configured to perform page presentation on the parsed request response result on the associated display device.
In a third aspect, some embodiments of the present disclosure provide an electronic device, comprising: one or more processors; a storage device having one or more programs stored thereon, which when executed by one or more processors, cause the one or more processors to implement the method described in any of the implementations of the first aspect.
In a fourth aspect, some embodiments of the present disclosure provide a computer readable medium on which a computer program is stored, wherein the program, when executed by a processor, implements the method described in any of the implementations of the first aspect.
In a fifth aspect, some embodiments of the present disclosure provide a computer program product comprising a computer program that, when executed by a processor, implements the method described in any of the implementations of the first aspect above.
The above embodiments of the present disclosure have the following advantages: through the page request processing method of some embodiments of the disclosure, the omission of request information change can be avoided, and the request information change can be decoupled from the existing service logic, so that the change range and time consumption are reduced. Specifically, the reasons that the number of times of missing change request information is large, the change range is large, and the time consumption is long are that: the request information needs to be positioned and changed one by one, and when more request information needs to be positioned and changed, more times of omitting and changing the request information are caused; the request information needs to be positioned in the page file, so that the request information can not be logically decoupled from the existing service when being changed, and the problems of large change range and long time consumption are caused. Based on this, the page request processing method of some embodiments of the present disclosure first determines, in response to detecting a page request, a request address included in the page request. Therefore, when the page request is detected, the page request is not initiated for the moment, so that the interception of the page request is realized. And then, in response to determining that the interface switching information set contains interface switching information which is matched with the original request address information and the request address, performing re-splicing processing on the page request according to switched request information contained in the interface switching information to obtain a re-spliced page request. And the re-splicing page request comprises a switched request address corresponding to the switched request information. The interface switching information in the interface switching information set comprises original request address information and switched request information. Therefore, when interface switching information corresponding to a request address included in a currently intercepted page request exists in a pre-configured interface switching information set, the current page request can be changed according to the switched request information included in the interface switching information, so that the request information of the request can be automatically changed before the request is initiated. And finally, initiating the re-splicing page request according to the switched request address. Thus, a page request after automatic change of the front end can be initiated. And the request information requested by the page can be automatically changed at the front end, so that the request information does not need to be positioned and changed one by one, and the request information can be prevented from being omitted. And because the request information does not need to be positioned in the page file, the request information can be decoupled from the existing service logic when being changed, and the change range and time consumption are further reduced. Therefore, the request information can be prevented from being omitted, and the request information can be decoupled with the existing business logic when being changed, so that the change range and time consumption are reduced.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and elements are not necessarily drawn to scale.
1-2 are schematic diagrams of one application scenario of a page request processing method according to some embodiments of the present disclosure;
FIG. 3 is a flow diagram of some embodiments of a page request processing method according to the present disclosure;
FIG. 4 is a flow diagram of further embodiments of a page request processing method according to the present disclosure;
FIG. 5 is a block diagram of some embodiments of a page request processing apparatus according to the present disclosure;
FIG. 6 is a schematic structural diagram of an electronic device suitable for use in implementing some embodiments of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the disclosure are shown in the drawings, it is to be understood that the disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings. The embodiments and features of the embodiments in the present disclosure may be combined with each other without conflict.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1-2 are schematic diagrams of an application scenario of a page request processing method according to some embodiments of the present disclosure.
In the application scenario of fig. 1, first, the computing device 101 may determine, in response to detecting the page request 102, a request address 1021 included in the page request 102. The page request 102 may be generated by the computing device 101 after a user clicks on a page module 1012 in a page 1011 displayed in the computing device 101. Page module 1012 may be a page area in page 1011. Then, in response to determining that there is interface switching information that matches the original request address information and the request address 1021 in the interface switching information set 103, the computing device 101 may perform re-splicing processing on the page request 102 according to the post-switching request information included in the interface switching information, to obtain a re-spliced page request 104. The re-splicing page request 104 includes a switched request address 1041 corresponding to the switched request information. The interface switching information in the interface switching information set 103 includes original request address information and switched request information. Finally, the computing device 101 may initiate the re-splicing page request 104 according to the switched request address 1041. For example, the re-splicing page request 104 may be sent to the API gateway 105 corresponding to the post-switch request address 1041. The API gateway 105 may be an "API gateway a".
Alternatively, as shown in fig. 2, the computing device 101 may initiate the page request 102 in response to determining that there is no interface switching information included in the interface switching information set 103, where the original request address information matches the request address 1021. For example, the re-join page request 104 may be sent to the API gateway 106 corresponding to the post-switch request address 1041. The API gateway 106 may be an "API gateway B".
The computing device 101 may be hardware or software. When the computing device is hardware, it may be implemented as a distributed cluster composed of multiple servers or terminal devices, or may be implemented as a single server or a single terminal device. When the computing device is embodied as software, it may be installed in the hardware devices enumerated above. It may be implemented, for example, as multiple software or software modules for providing distributed services, or as a single software or software module. And is not particularly limited herein.
It should be understood that the number of computing devices in fig. 1-2 is merely illustrative. There may be any number of computing devices, as implementation needs dictate.
With continued reference to fig. 3, a flow 300 of some embodiments of a page request processing method according to the present disclosure is shown. The page request processing method comprises the following steps:
in response to detecting a page request, step 301 determines a request address included in the page request.
In some embodiments, an executing agent of a page request processing method (e.g., computing device 101 shown in fig. 1) may determine, in response to detecting a page request, a request address included in the page request. The page request may be a request for acquiring data of a page desired to be browsed. The page request may include a request address of the page. The request address may be a web address. The web address may be represented by a Uniform Resource Locator (URL). The execution subject may be a client communicably connected to the server. The detected page request may be a request generated by a browser, an application, or an applet of the client and temporarily not initiated.
As an example, a user may enter a request address in a browser of a client, and upon clicking a jump control, the client may generate a page request including the request address entered by the user. As another example, a user may click on a control or a page module in an applet of a client, which may generate a page request for requesting page data for the control or page module.
Step 302, in response to determining that the interface switching information set includes interface switching information matching the original request address information and the request address, performing re-splicing processing on the page request according to the switched request information included in the interface switching information set, so as to obtain a re-spliced page request.
In some embodiments, the execution main body may, in response to determining that there is interface switching information that matches the original request address information and the request address, perform re-splicing processing on the page request according to post-switching request information included in the interface switching information, to obtain a re-spliced page request. The interface switching information set may be a set of interface switching information configured in advance or maintained in real time. The interface switching information may be information related to an interface to be switched. The interface switching information may include original request address information and post-switching request information. The original request address information may be information related to a request address of an interface to be switched. For example, the original request address information may be a request address of an interface to be switched. For another example, the original request address information may also be a partial path used for determining a page type to be browsed in the request address of the interface to be switched. The switched request information may be request related information after the page corresponding to the original request address information requests to switch the interface. For example, when the original request address information is a request address of an interface to be switched, the switched request information may be a switched request address after the interface is switched. For another example, when the original request address information is a partial path used for determining a page type to be browsed in a request address of an interface to be switched, the switched request information may be a switched partial path used for replacing the partial path after the interface is switched. The interface switching information set may be represented in the form of a list. The interface switching information set may be stored in JSON format.
In practice, first, the execution main body may replace a request address included in the page request with the post-switch request address in response to determining that the post-switch request information is a post-switch request address. The replaced page request may then be determined to be a re-stitched page request. Wherein, the replaced request address can be used as the switched request address. In practice, the executing body may further replace, in response to determining that the post-switching request information is a post-switching partial path, a partial path included in the request address and corresponding to the post-switching partial path with the post-switching partial path. The page request after replacing the request address may then be determined to be a re-splice page request. Wherein, the replaced request address can be used as the switched request address.
Optionally, the request information after handover may include an interface identifier after handover. The switched interface identifier can uniquely identify the interface and can represent that the API gateway requested by the original page needs to be switched into the API gateway corresponding to the interface.
In some optional implementation manners of some embodiments, the execution subject may perform a re-splicing process on the page request by:
step one, determining the request address corresponding to the switched interface identifier as a switched request address. In practice, the executing entity may determine, as the target interface address information, preset interface address information in which an interface identifier included in the preset interface address information set is the same as the switched interface identifier. The preset interface address information in the preset interface address information set may be preset information for associating the interface identifier with the corresponding request address. The preset interface address information may include an interface identifier and a request address corresponding to the interface identifier. Then, the request address included in the target interface address information may be determined as a post-handover request address.
And secondly, splicing each request parameter corresponding to the switched interface identifier according to the page request and a request parameter information set included by the page request to generate splicing request parameter information, so as to obtain a splicing request parameter information set.
The request parameter information set may be request parameter information (params parameters) included in the page request. The request parameter information may include a parameter field name and a parameter value. The parameter value included in the request parameter information set may include, but is not limited to, at least one of the following: identifier, page object identification, object page type identification. The identifier may be an identifier used to uniquely represent the request. For example, the Identifier may be a Universally Unique Identifier (UUId). The page object identifier may be used to uniquely represent an object corresponding to the page requested to be browsed. For example, the page object identifier may be an item identifier, and may be used to uniquely represent an item object. The object page type identifier may be an identifier for uniquely indicating a page type of the object requesting browsing. For example, the page type may be an item detail page. By way of example, the page object identification may be "1345200". The object page type identifier may be "product" and may represent an item detail page requesting to browse the item "1345200".
The request parameter corresponding to the switched interface identifier may be a request parameter required by the API gateway corresponding to the switched interface identifier. The request parameters required by the API gateway corresponding to the switched interface identifier may include, but are not limited to, at least one of the following: the method comprises the steps of identification, page object identification, object page type identification and application identification. The application identifier may be an identifier that uniquely represents an application that transmits a request. For example, the application identification may be an application identification.
In practice, for each request parameter corresponding to the switched interface identifier, the execution main body may, in response to determining that request parameter information corresponding to the request parameter exists in the request parameter information set, splice a parameter field name corresponding to the request parameter and a parameter value included in the request parameter information into splicing request parameter information.
And thirdly, generating a re-splicing page request according to the switched request address and the splicing request parameter information set. In practice, the execution body may replace a request address included in the page request with the switched request address, and replace a request parameter information set included in the page request with the splicing request parameter information set.
In some optional implementation manners of some embodiments, the execution main body may generate a re-splicing page request according to the switched request address and the splicing request parameter information set by:
first, determining the request head parameter information corresponding to the switched interface identifier as switched request head parameter information. The request Header parameter information may be request Header parameter related information (i.e., a Header parameter of the request) required by the API gateway corresponding to the switched interface identifier. The post-handover request header parameter information may include a post-handover request header parameter set. The post-handover request header parameters in the post-handover request header parameter set may include a post-handover request header parameter field name and a post-handover request header parameter value. The post-handover request header parameter information may include cache parameter information. The cache parameter information is cookies parameters. The buffering parameter information may include a post-handover buffering parameter set.
And secondly, generating a re-splicing page request according to the switched request address, the splicing request parameter information set and the switched request header parameter information. In practice, the execution body may replace a request address, a request parameter information set, and request header parameter information included in the page request with the post-switching request address, the splicing request parameter information set, and the post-switching request header parameter information, respectively.
In some optional implementation manners of some embodiments, first, the execution main body may replace a request address and a request parameter information set included in the page request with the post-switch request address and the splicing request parameter information set, respectively. Then, according to the switched request header parameter information, the request header parameter information included in the replaced page request is updated, so that the updated page request is used as a re-splicing page request. In practice, the execution subject may determine a request header parameter set included in the request header parameter information included in the replaced page request. Then, the request header parameter whose request header parameter field name included in the request header parameter set satisfies the preset condition to be deleted may be determined as the request header parameter to be deleted, so as to obtain the request header parameter set to be deleted. The preset condition to be deleted may be that the request header parameter field name is different from each post-handover request header parameter field name included in the post-handover request header parameter set. Then, the switched request header parameter, which is included in the switched request header parameter set and whose field name satisfies the preset condition to be supplemented, may be determined as the request header parameter to be supplemented, so as to obtain the request header parameter set to be supplemented. The preset condition to be supplemented may be that the name of the request header parameter field after switching is different from the names of the request header parameter fields included in the request header parameter set. Finally, the request header parameter set to be deleted may be deleted from the request header parameter set, and the request header parameter set to be supplemented may be added to the deleted request header parameter set, so as to update the request header parameter information included in the replaced page request, and further, the updated page request may be used as a re-join page request.
Optionally, the execution body may add a timestamp in the re-spliced page request to update the re-spliced page request. In practice, the execution body may add a timestamp generated according to the current time to the re-spliced page request.
Optionally, the executing body may initiate the page request in response to determining that there is no interface switching information in the interface switching information set, where the original request address information is matched with the request address. Therefore, the intercepted page request can be directly initiated without switching the API gateway.
Step 303, initiating a re-splicing page request according to the switched request address.
In some embodiments, the execution body may initiate the re-splicing page request according to the switched request address. In practice, the execution body may send the re-splicing page request to an API gateway corresponding to the switched request address according to the switched request address.
The above embodiments of the present disclosure have the following advantages: through the page request processing method of some embodiments of the disclosure, the omission of request information change can be avoided, and the request information change can be decoupled from the existing service logic, so that the change range and time consumption are reduced. Specifically, the reasons that the number of times of missing change request information is large, the change request information cannot be decoupled from the existing service logic, the change range is large, and the time consumption is long are as follows: the request information needs to be positioned and changed one by one, and when more request information needs to be positioned and changed, more times of omitting and changing the request information are caused; the request information needs to be positioned in the page file, so that the request information can not be logically decoupled from the existing service when being changed, and the problems of large change range and long time consumption are caused. Based on this, the page request processing method of some embodiments of the present disclosure first determines, in response to detecting a page request, a request address included in the page request. Therefore, when the page request is detected, the page request is not initiated for the moment, so that the interception of the page request is realized. And then, in response to determining that the interface switching information set contains interface switching information which is matched with the original request address information and the request address, performing re-splicing processing on the page request according to switched request information contained in the interface switching information to obtain a re-spliced page request. And the re-splicing page request comprises a switched request address corresponding to the switched request information. The interface switching information in the interface switching information set comprises original request address information and switched request information. Therefore, when interface switching information corresponding to a request address included in a currently intercepted page request exists in a pre-configured interface switching information set, the current page request can be changed according to the switched request information included in the interface switching information, so that the request information of the request can be automatically changed before the request is initiated. And finally, initiating the re-splicing page request according to the switched request address. Thus, a page request after automatic change of the front end can be initiated. And the request information requested by the page can be automatically changed at the front end, so that the request information does not need to be positioned and changed one by one, and the omission of the change of the request information can be avoided. And because the request information does not need to be positioned in the page file, the request information can be logically decoupled from the existing service when being changed, and the change range and the time consumption are further reduced. Therefore, the request information can be prevented from being omitted, and the request information can be decoupled with the existing business logic when being changed, so that the change range and time consumption are reduced.
With further reference to FIG. 4, a flow 400 of further embodiments of a page request processing method is shown. The process 400 of the page request processing method includes the following steps:
in response to detecting a page request, a request address included in the page request is determined, step 401.
Step 402, in response to determining that the interface switching information set includes interface switching information matching the original request address information and the request address, performing re-splicing processing on the page request according to the switched request information included in the interface switching information set, so as to obtain a re-spliced page request.
And step 403, initiating a re-splicing page request according to the switched request address.
In some embodiments, the detailed implementation manner and technical effects of steps 401 to 403 may refer to steps 301 to 303 in those embodiments corresponding to fig. 3, and are not described herein again.
Step 404, in response to detecting that the interface switching information corresponding to the re-splicing page request is deleted from the interface switching information set, or the re-splicing page request fails, initiating a page request.
In some embodiments, an executing entity of the page request processing method (e.g., the computing device 101 shown in fig. 1) may initiate the page request in response to detecting that the interface switching information corresponding to the re-splicing page request is deleted from the set of interface switching information or that the re-splicing page request fails. And deleting the interface switching information from the interface switching information set to represent the API gateway which does not need to switch the current request. The failure of the re-splicing page request may represent that an API gateway corresponding to the re-splicing page request is failed. Therefore, the original page request can be directly initiated when the API gateway does not need to be switched or the API gateway to be switched fails, so that the reversibility of the change of the request information is realized.
Optionally, before initiating the page request, the execution subject may add a timestamp in the page request to update the page request. In practice, the execution subject may add a timestamp generated according to the current time to the page request.
Optionally, the execution main body may parse the request response result in response to receiving the request response result corresponding to the re-splicing page request or the page request. The parsing may be parsing of the page data. And then, page display is carried out on the analyzed request response result on the associated display equipment. Therefore, page display of the request response result can be realized.
As can be seen from fig. 4, compared with the description of some embodiments corresponding to fig. 3, the flow 400 of the page request processing method in some embodiments corresponding to fig. 4 embodies a step of expanding the implementation of request information reversibility. Therefore, the solutions described in the embodiments can directly initiate the original page request when the API gateway does not need to be switched or the API gateway to be switched fails, so as to achieve reversibility of request information change.
With further reference to fig. 5, as an implementation of the methods shown in the above figures, the present disclosure provides some embodiments of a page request processing apparatus, which correspond to those of fig. 3, and which can be applied in various electronic devices.
As shown in fig. 5, the page request processing apparatus 500 of some embodiments includes: a determination unit 501, a splicing unit 502 and an initiation unit 503. The determining unit 501 is configured to determine, in response to detecting a page request, a request address included in the page request; the splicing unit 502 is configured to, in response to determining that there is interface switching information in which original request address information included in an interface switching information set matches the request address, perform re-splicing processing on the page request according to post-switching request information included in the interface switching information to obtain a re-spliced page request, where the re-spliced page request includes a post-switching request address corresponding to the post-switching request information, and the interface switching information in the interface switching information set includes the original request address information and the post-switching request information; the initiating unit 503 is configured to initiate the re-splicing page request according to the switched request address.
Optionally, before the initiating unit 503, the page request processing apparatus 500 may further include: a first timestamp adding unit (not shown in the figure) configured to add a timestamp in the re-spliced page request to update the re-spliced page request.
Optionally, the request information after switching includes an interface identifier after switching.
Optionally, the splicing unit 502 may include: a post-switching request address determining unit, a request parameter splicing unit and a re-splicing page request generating unit (not shown in the figure). The switched request address determining unit is configured to determine a request address corresponding to the switched interface identifier as a switched request address. The request parameter splicing unit is configured to splice each request parameter corresponding to the switched interface identifier according to the page request and a request parameter information set included in the page request to generate splicing request parameter information, so as to obtain a splicing request parameter information set. The re-splicing page request generating unit is configured to generate a re-splicing page request according to the switched request address and the splicing request parameter information set.
Optionally, the rejoined page request generating unit may be further configured to: determining request header parameter information corresponding to the switched interface identifier as switched request header parameter information, wherein the switched request header parameter information comprises cache parameter information; and generating a re-splicing page request according to the switched request address, the splicing request parameter information set and the switched request header parameter information.
Optionally, the rejoined page request generating unit may be further configured to: replacing the request address and the request parameter information set included in the page request with the switched request address and the splicing request parameter information set respectively; and updating the request header parameter information included in the replaced page request according to the switched request header parameter information so as to take the updated page request as a re-splicing page request.
Optionally, the page request processing apparatus 500 may further include: a first page request initiating unit (not shown in the figure) configured to initiate the page request in response to determining that there is no interface switching information in the interface switching information set, where the original request address information included in the interface switching information set matches the request address.
Optionally, the page request processing apparatus 500 may further include: a second page request initiating unit (not shown in the figure), configured to initiate the page request in response to detecting that the interface switching information corresponding to the re-splicing page request is deleted from the interface switching information set, or that the re-splicing page request fails.
Optionally, before the first page request initiating unit or the second page request initiating unit, the page request processing apparatus 500 may further include: and a second time stamp adding unit (not shown in the figure) configured to add a time stamp in the page request to update the page request.
Optionally, the page request processing apparatus 500 may further include: a parsing unit and a presentation unit (not shown in the figure). The parsing unit is configured to parse the request response result in response to receiving the request response result corresponding to the re-splicing page request or the page request. The presentation unit is configured to perform page presentation on the parsed request response result on the associated display device.
It will be understood that the elements described in the apparatus 500 correspond to various steps in the method described with reference to fig. 3. Thus, the operations, features and advantages described above with respect to the method are also applicable to the apparatus 500 and the units included therein, and are not described herein again.
Referring now to FIG. 6, a block diagram of an electronic device (e.g., computing device 101 of FIG. 1) 600 suitable for use in implementing some embodiments of the present disclosure is shown. The electronic device in some embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle-mounted terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 6, the electronic device 600 may include a processing means (e.g., central processing unit, graphics processor, etc.) 601 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM) 602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM603, various programs and data necessary for the operation of the electronic apparatus 600 are also stored. The processing device 601, the ROM 602, and the RAM603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Generally, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While fig. 6 illustrates an electronic device 600 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided. Each block shown in fig. 6 may represent one device or may represent multiple devices as desired.
In particular, according to some embodiments of the present disclosure, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, some embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer-readable medium, the computer program comprising program code for performing the method illustrated by the flow chart. In some such embodiments, the computer program may be downloaded and installed from a network through the communication device 609, or installed from the storage device 608, or installed from the ROM 602. The computer program, when executed by the processing device 601, performs the above-described functions defined in the methods of some embodiments of the present disclosure.
It should be noted that the computer readable medium described in some embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, 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), an optical fiber, 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 some embodiments of the 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. In some embodiments of the present disclosure, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: responding to the detected page request, and determining a request address included in the page request; responding to interface switching information which is determined to exist in an interface switching information set and comprises original request address information matched with the request address, performing re-splicing processing on the page request according to switched request information contained in the interface switching information to obtain a re-spliced page request, wherein the re-spliced page request comprises a switched request address corresponding to the switched request information, and the interface switching information in the interface switching information set comprises the original request address information and the switched request information; and initiating the re-splicing page request according to the switched request address.
Computer program code for carrying out operations for embodiments of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
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 and/or flowchart illustration, and combinations of blocks in the block diagrams and/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.
The units described in some embodiments of the present disclosure may be implemented by software, and may also be implemented by hardware. The described units may also be provided in a processor, and may be described as: a processor includes a determination unit, a stitching unit, and an initiation unit. Where the names of these units do not in some cases constitute a limitation on the unit itself, for example, the determining unit may also be described as a "unit that determines a request address included in the page request in response to detecting the page request".
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems on a chip (SOCs), complex Programmable Logic Devices (CPLDs), and the like.
Some embodiments of the present disclosure also provide a computer program product comprising a computer program which, when executed by a processor, implements any of the page request processing methods described above.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is made without departing from the inventive concept as defined above. For example, the above features and (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure are mutually replaced to form the technical solution.

Claims (13)

1. A page request processing method comprises the following steps:
in response to detecting a page request, determining a request address included in the page request;
responding to interface switching information which is determined to exist in an interface switching information set and comprises original request address information matched with the request address, performing re-splicing processing on the page request according to switched request information contained in the interface switching information to obtain a re-spliced page request, wherein the re-spliced page request comprises a switched request address corresponding to the switched request information, and the interface switching information in the interface switching information set comprises the original request address information and the switched request information;
and initiating the re-splicing page request according to the switched request address.
2. The method of claim 1, wherein prior to said initiating said re-splice page request according to said post-switch request address, said method further comprises:
and adding a time stamp in the re-splicing page request so as to update the re-splicing page request.
3. The method of claim 1, wherein the post-handover request information comprises a post-handover interface identification; and
the re-splicing processing is performed on the page request according to the switched request information included in the interface switching information to obtain a re-spliced page request, and the re-splicing processing includes:
determining a request address corresponding to the switched interface identifier as a switched request address;
splicing each request parameter corresponding to the switched interface identifier according to the page request and a request parameter information set included in the page request to generate splicing request parameter information to obtain a splicing request parameter information set;
and generating a re-splicing page request according to the switched request address and the splicing request parameter information set.
4. The method of claim 3, wherein the generating a re-join page request according to the switched request address and the join request parameter information set comprises:
determining request header parameter information corresponding to the switched interface identifier as switched request header parameter information, wherein the switched request header parameter information comprises cache parameter information;
and generating a re-splicing page request according to the switched request address, the splicing request parameter information set and the switched request header parameter information.
5. The method of claim 4, wherein the generating a re-tile page request according to the post-switch request address, the set of tile request parameter information, and the post-switch request header parameter information comprises:
replacing the request address and the request parameter information set included in the page request with the switched request address and the splicing request parameter information set respectively;
and updating the request header parameter information included in the replaced page request according to the switched request header parameter information so as to take the updated page request as a re-splicing page request.
6. The method of claim 1, wherein the method further comprises:
and responding to the interface switching information which is determined that the original request address information and the request address are not matched in the interface switching information set, and initiating the page request.
7. The method of claim 1, wherein the method further comprises:
and initiating the page request in response to detecting that the interface switching information corresponding to the re-splicing page request is deleted from the interface switching information set or the re-splicing page request fails.
8. The method of any of claims 6 or 7, wherein prior to the initiating the page request, the method further comprises:
and adding a time stamp in the page request so as to update the page request.
9. The method according to one of claims 1 to 7, wherein the method further comprises:
responding to a received request response result corresponding to the re-splicing page request or the page request, and analyzing the request response result;
and displaying the page of the analyzed request response result on the associated display equipment.
10. A page request processing apparatus comprising:
a determining unit configured to determine, in response to detecting a page request, a request address included in the page request;
the splicing unit is configured to perform re-splicing processing on the page request according to switched request information included in interface switching information set in response to determining that the included interface switching information of which the original request address information is matched with the request address exists in the interface switching information set, so as to obtain a re-spliced page request, wherein the re-spliced page request includes a switched request address corresponding to the switched request information, and the interface switching information in the interface switching information set includes the original request address information and the switched request information;
and the initiating unit is configured to initiate the re-splicing page request according to the switched request address.
11. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-9.
12. A computer-readable medium, on which a computer program is stored, wherein the program, when executed by a processor, implements the method of any one of claims 1-9.
13. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-9.
CN202211386944.8A 2022-11-07 2022-11-07 Page request processing method and device, electronic equipment and computer readable medium Pending CN115687824A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211386944.8A CN115687824A (en) 2022-11-07 2022-11-07 Page request processing method and device, electronic equipment and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211386944.8A CN115687824A (en) 2022-11-07 2022-11-07 Page request processing method and device, electronic equipment and computer readable medium

Publications (1)

Publication Number Publication Date
CN115687824A true CN115687824A (en) 2023-02-03

Family

ID=85049532

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211386944.8A Pending CN115687824A (en) 2022-11-07 2022-11-07 Page request processing method and device, electronic equipment and computer readable medium

Country Status (1)

Country Link
CN (1) CN115687824A (en)

Similar Documents

Publication Publication Date Title
CN110909521B (en) Online document information synchronous processing method and device and electronic equipment
CN111432001B (en) Method, apparatus, electronic device and computer readable medium for jumping scenes
CN111309747A (en) Data synchronization method, system and device
CN111246228B (en) Method, device, medium and electronic equipment for updating gift resources of live broadcast room
WO2020233168A1 (en) Network storage method and apparatus for picture type comment data, and electronic device and medium
CN111694757A (en) Application program testing method and device, electronic equipment and computer readable storage medium
CN112748962A (en) Application loading method and device, electronic equipment and computer readable medium
CN111596991A (en) Interactive operation execution method and device and electronic equipment
CN112965673A (en) Content printing method, device, equipment and storage medium
CN112269959A (en) Display content control method and device, readable medium and electronic equipment
CN113760536A (en) Data caching method and device, electronic equipment and computer readable medium
CN111930709A (en) Data storage method and device, electronic equipment and computer readable medium
CN111694629A (en) Information display method and device and electronic equipment
CN114428925A (en) Page rendering method and device, electronic equipment and computer readable medium
CN111596992B (en) Navigation bar display method and device and electronic equipment
CN110619101A (en) Method and apparatus for processing information
CN115563134A (en) Interaction method, interaction device, electronic equipment and computer readable medium
CN115687824A (en) Page request processing method and device, electronic equipment and computer readable medium
CN111460020B (en) Method, device, electronic equipment and medium for resolving message
CN110633324B (en) Method, apparatus, electronic device and computer readable medium for synchronizing data
CN114115941A (en) Resource sending method, page rendering method, device, electronic equipment and medium
CN110795670A (en) Webpage image monitoring method and device, electronic equipment and readable storage medium
CN111949833B (en) Index construction method, data processing method, device, electronic equipment and medium
CN115248642B (en) Information interaction method and device and electronic equipment
CN113157365B (en) Program running method, program running device, electronic equipment and computer readable medium

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