Front-end and back-end asynchronous request calling method, device, equipment and medium

By loading and parsing the domain name in the HTML landing page, and using the static resource splicing interface identifier to directly send an Ajax request to the web application server, it solves the problem of low efficiency and accuracy of domain name and interface determination in the existing technology, and achieves high efficiency and accuracy. Ajax request call.

CN113076497BActive Publication Date: 2024-09-20BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110419855.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-19
Publication Date
2024-09-20
Estimated Expiration
2041-04-19

AI Technical Summary

Technical Problem

Determining the correct domain name and interface in the existing technology is inefficient, and negligence is prone to occur when calling Ajax requests in different environments, resulting in low accuracy of the domain name and interface.

Method used

By loading the Hypertext Markup Language HTML landing page and parsing out the domain name in the corresponding access environment, using static resources to splice the domain name and interface identifier, and directly sending an Ajax request to the web application server, avoiding manual modification of the domain name and interface.

Benefits of technology

It improves the efficiency of determining the correct domain name and interface, ensures the accuracy of domain names and interfaces in different environments, and reduces errors caused by negligence.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113076497B
    Figure CN113076497B
Patent Text Reader

Abstract

The embodiment of the present invention provides a front-end and back-end asynchronous request calling method, device, equipment and medium, the method comprising: determining the corresponding access environment when calling the front-end and back-end asynchronous Ajax request; loading the corresponding hypertext markup language HTML landing page according to the access environment, and parsing the domain name of the Ajax request in the corresponding access environment from the HTML landing page; loading the corresponding static resource in the HTML landing page, and using the static resource to splice the domain name and interface identifier of the Ajax request in the corresponding access environment to obtain the interface in the corresponding access environment; sending the Ajax request to the web application server of the corresponding access environment through the interface to realize the calling of the Ajax request, which effectively improves the efficiency of determining the correct domain name and interface, and improves the accuracy of the domain name and interface when calling the Ajax request under different access environments.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the technical field of web page development, and in particular to a front-end and back-end asynchronous request calling method, device, equipment and medium. Background Art

[0002] Asynchronous JavaScript and XML (Ajax) is a technology used to create better, faster and more interactive web applications. Ajax technology enables web applications to quickly present incremental updates on the user interface without reloading the entire page, so it is widely used.

[0003] Currently, when the front-end calls the front-end and back-end asynchronous requests (abbreviated as: Ajax requests) to obtain data from the server, the domain name and interface of the Ajax request are different in the pre-release environment and the online environment. There are two main solutions to implement the specific Ajax request. The first solution is to use the first domain name and interface in the pre-release environment. In the online environment, it is implemented by manually changing the first domain name and interface to the second domain name and interface. The second solution is to use the front-end scaffolding, and configure different packaging commands of the scaffolding in the pre-release environment and the online environment to modify the domain name and interface to achieve it.

[0004] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art: since both the domain name and the interface need to be modified, the efficiency of determining the correct domain name and interface is low, and negligence is prone to occur during the modification process, resulting in low accuracy of the domain name and interface when calling Ajax requests in different environments. Summary of the invention

[0005] The embodiment of the present invention provides a front-end and back-end asynchronous request calling method, device, equipment and medium to solve the technical problems in the prior art that the efficiency of determining the correct domain name and interface is low, and negligence is prone to occur during the modification process, resulting in low accuracy of the domain name and interface when calling Ajax requests in different environments.

[0006] In a first aspect, an embodiment of the present invention provides a front-end and back-end asynchronous request calling method, comprising:

[0007] Determine the corresponding access environment when calling front-end and back-end asynchronous Ajax requests;

[0008] Loading a corresponding hypertext markup language HTML landing page according to the access environment, and parsing the domain name of the Ajax request in the corresponding access environment from the HTML landing page;

[0009] Load the corresponding static resources in the HTML landing page, and use the static resources to concatenate the domain name and interface identifier of the Ajax request in the corresponding access environment to obtain the interface in the corresponding access environment;

[0010] An Ajax request is sent to a web application server corresponding to the access environment through the interface to implement the call of the Ajax request.

[0011] In a second aspect, an embodiment of the present invention provides a front-end and back-end asynchronous request calling device, comprising:

[0012] The determination module is used to determine the corresponding access environment when calling the front-end and back-end asynchronous Ajax requests;

[0013] A loading module, used to load a corresponding hypertext markup language HTML landing page according to the access environment;

[0014] A parsing module, used to parse the domain name of the Ajax request in the corresponding access environment from the HTML landing page;

[0015] The loading module is also used to load corresponding static resources in the HTML landing page;

[0016] A splicing module, used to splice the domain name and interface identifier of the Ajax request in the corresponding access environment using the static resources to obtain the interface in the corresponding access environment;

[0017] The sending module is used to send an Ajax request to the web application server corresponding to the access environment through the interface to implement the call of the Ajax request.

[0018] In a third aspect, an embodiment of the present invention provides an electronic device, including: at least one processor, a memory and a transceiver;

[0019] The processor, the memory and the transceiver are interconnected via a circuit;

[0020] The memory stores computer-executable instructions; the transceiver is used to send and receive data with the web application server;

[0021] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the method as described in any one of the first aspects.

[0022] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the method as described in any one of the first aspects.

[0023] In a fifth aspect, an embodiment of the present invention provides a computer program product, including a computer program, which implements any method described in the first aspect when executed by a processor.

[0024] The front-end and back-end asynchronous request calling method, device, equipment and medium provided by the embodiment of the present invention determine the corresponding access environment when calling the front-end and back-end asynchronous Ajax requests; load the corresponding hypertext markup language HTML landing page according to the access environment, and parse the domain name of the Ajax request under the corresponding access environment from the HTML landing page; load the corresponding static resources in the HTML landing page, and use the static resources to splice the domain name and interface identifier of the Ajax request under the corresponding access environment to obtain the interface under the corresponding access environment; send an Ajax request to the web application server of the corresponding access environment through the interface to implement the call of the Ajax request. Since loading the corresponding HTML landing page and static resources is a necessary step for calling the Ajax request, the domain name of the Ajax request under each access environment is directly written into the corresponding HTML landing page, and the domain name and interface identifier of the Ajax request are spliced ​​through the static resources to obtain the corresponding interface. There is no need to determine the correct domain name and interface by special modification, which effectively improves the efficiency of determining the correct domain name and interface. In addition, the domain name in each access environment is written into the corresponding HTML landing page in advance, so there will be no errors in the domain name and interface due to negligence or other reasons, thereby improving the accuracy of the domain name and interface when calling Ajax requests in different environments. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0026] Figure 1 It is a network architecture diagram in a pre-release environment that can implement the front-end and back-end asynchronous request calling method of an embodiment of the present invention;

[0027] Figure 2 It is a network architecture diagram in an online environment that can implement the front-end and back-end asynchronous request calling method of an embodiment of the present invention;

[0028] Figure 3 It is a flowchart of a front-end and back-end asynchronous request calling method provided by an embodiment of the present invention;

[0029] Figure 4 It is a flowchart of a front-end and back-end asynchronous request calling method provided by another embodiment of the present invention;

[0030] Figure 5It is a flowchart of step 201 in the front-end and back-end asynchronous request calling method provided by another embodiment of the present invention;

[0031] Figure 6 It is a flowchart of step 208 in the front-end and back-end asynchronous request calling method provided by another embodiment of the present invention;

[0032] Figure 7 It is a flowchart of step 209 in the front-end and back-end asynchronous request calling method provided by another embodiment of the present invention;

[0033] Figure 8 It is a flowchart of step 210 in the front-end and back-end asynchronous request calling method provided by another embodiment of the present invention;

[0034] Fig. 9 It is a flowchart of step 211 in the front-end and back-end asynchronous request calling method provided by another embodiment of the present invention;

[0035] Fig.10 It is a structural diagram of a front-end and back-end asynchronous request calling device provided by an embodiment of the present invention;

[0036] Fig.11 It is a structural schematic diagram of an electronic device used to implement the front-end and back-end asynchronous request calling method of an embodiment of the present invention;

[0037] Fig.12 The block diagram is a block diagram of an electronic device used to implement the front-end and back-end asynchronous request calling method of an embodiment of the present invention.

[0038] The above drawings show clear embodiments of the present disclosure, which will be described in more detail below. These drawings and text descriptions are not intended to limit the scope of the present disclosure in any way, but to illustrate the concepts of the present disclosure to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0039] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0040] First, the terms involved in the embodiments of the present invention are explained:

[0041] Asynchronous request between front-end and back-end: abbreviated as Ajax request. A kind of http interaction between the front-end and the server. During the interaction, the front-end needs to send an Ajax request. When sending an Ajax request, it is necessary to determine the uniform resource locator URL, also known as the interface for sending Ajax requests.

[0042] Front-end scaffolding: Front-end scaffolding can build a development environment for front-end projects, and can also package the entire front-end project according to certain rules.

[0043] Javascript: It is a front-end web page development language. It is a lightweight, interpreted or just-in-time compiled programming language with function priority. It is a scripting language for developing web pages.

[0044] It should be noted that the examples of the test domain name, test interface, online domain name and online interface illustrated in the embodiments of the present invention are not real, but are just examples in the form of domain names and interfaces.

[0045] In order to clearly understand the technical solution of the present application, the solution of the prior art is first introduced in detail.

[0046] Currently, when the front-end calls Ajax requests to obtain data from the server, the domain name and interface of the Ajax request are different in the pre-release environment and the online environment. The following examples illustrate the domain name and interface of the Ajax request in the pre-release environment and the online environment: In the pre-release environment, when calling Ajax requests, the test domain name of the Ajax request can be "http: / / beta-color.jdl.id", and the test interface URL can be "http: / / beta-color.jdl.id / getUser". In the online environment, when calling Ajax requests, the online domain name of the Ajax request can be "http: / / color.jdl.id", and the online interface URL can be "http: / / color.jdl.id / getUser".

[0047] There are currently two main solutions for calling Ajax requests. The first solution is to use the first domain name and interface in the pre-release environment. In the online environment, this can be achieved by manually changing the first domain name and interface to the second domain name and interface. The second solution is to use the front-end scaffolding and configure different packaging commands of the scaffolding in the pre-release environment and the online environment to modify the domain name and interface.

[0048] Specifically, in the first solution, when testing in the pre-release environment, the domain name of the Ajax request set in the front-end javascript code is "http: / / beta-color.jdl.id", which is the first domain name. Then use this domain name to splice the interface identifier to form the first interface, and then call the Ajax request. After the test is completed, in the online environment, manually modify the Ajax request domain name and interface set by the javascript code, change the domain name of the Ajax request to the second domain name, "http: / / color.jdl.id", and then use this request domain name to splice the interface identifier to form the second interface.

[0049] In the second solution, use the front-end scaffolding and configure the packaging command of the scaffolding. Before deploying the javascript code, enter different packaging commands to change the value of the ajax request domain name variable. For example, in the pre-release environment, enter the packaging command "npm run test" to change the value of the ajax request domain name variable in the javascript code, and finally assign this variable to "http: / / beta-color.jdl.id". Then, when the front end sends an ajax request, it will splice the value of this variable to achieve the result of the interface "http: / / beta-color.jdl.id / getUser". In the online environment, enter the packaging command "npm run build" to change the value of the ajax request domain name variable in the javascript code, and finally assign this variable to "http: / / color.jdl.id". Then, when the front end sends an ajax request, it will splice the value of this variable to achieve the result of the interface "http: / / color.jdl.id / getUser".

[0050] In the first solution, the domain name and interface need to be manually modified, which makes it less efficient to determine the correct domain name and interface. In the second solution, although the domain name and interface do not need to be manually modified, in order to adapt to the pre-release environment and the online environment, two commands need to be switched back and forth. This makes it difficult to avoid entering the packaging command of the pre-release environment due to negligence or other reasons when the online environment is about to be deployed, resulting in low accuracy of the domain name and interface when calling Ajax requests in different environments.

[0051] Therefore, when facing the technical problems of the prior art, the inventor discovered through creative research that although there are many types of current front-end development frameworks, after the final development is completed, they are generally packaged through webpack, and the main resource types formed after packaging are consistent. As for the Ajax request call link, the resources related to it are HTML landing pages (also known as: index.html) and static resources (also known as: js). Since after the demand development is completed, the HTML landing page is mainly responsible for some page attribute settings and the introduction of static resources, in the subsequent demand iterations, almost most of the code changes will eventually be packaged into new static resource files by webpack, but the HTML landing page is almost unchanged. Therefore, relying on the nature that the HTML landing page is rarely changed, the HTML landing pages of the pre-release environment and the online environment are distinguished, and the domain name of the Ajax request in the pre-release environment is written into the HTML landing page in the pre-release environment, and the domain name of the Ajax request in the online environment is written into the HTML landing page in the online environment. And the domain name and interface identifier of the corresponding Ajax request can be spliced ​​by using the static resources in the corresponding access environment to obtain the interface in the corresponding access environment, and then the Ajax request is sent to the web application server of the corresponding access environment through the interface to realize the call of the Ajax request. Since the domain name of the Ajax request in each access environment is written into the HTML landing page in the corresponding access environment. Therefore, even if the access environment is different, the domain name and interface of the Ajax request in the corresponding access environment can be obtained by loading the corresponding HTML landing page and static resources, and then the call of the Ajax request can be realized. Since loading the corresponding HTML landing page and static resources is a necessary link for calling the Ajax request, the domain name of the corresponding Ajax request in each access environment is directly written into the corresponding HTML landing page, and the domain name and interface identifier of the Ajax request are spliced ​​through static resources to obtain the corresponding interface, and there is no need to determine the correct domain name and interface by modification, which effectively improves the efficiency of determining the correct domain name and interface. In addition, the domain name in each access environment is written into the corresponding HTML landing page in advance, so there will be no errors in the domain name and interface due to negligence or other reasons, thereby improving the accuracy of the domain name and interface when calling Ajax requests in different environments.

[0052] Therefore, the inventors proposed a technical solution of the embodiment of the present invention based on the above creative discovery. The network architecture of the front-end and back-end asynchronous request calling method provided by the embodiment of the present invention in different access environments is introduced below.

[0053] Figure 1 : is a network architecture diagram that can implement the front-end and back-end asynchronous request calling method of the embodiment of the present invention in a pre-release environment, such as Figure 1As shown, the network architecture in the pre-release environment includes: an electronic device 1, an HTML landing page server 21 corresponding to the pre-release environment, a first HTML landing page code base 211, a static resource server 31 corresponding to the pre-release environment, a first static resource code base 311 and a web application server 41 corresponding to the pre-release environment. Among them, the first HTML landing page code base 211 is located in the HTML landing page server 21 corresponding to the pre-release environment, and is used to store the HTML landing page in the pre-release environment. The HTML landing page in the pre-release environment is the first HTML landing page. The first static resource code base 311 is located in the static resource server 31 corresponding to the pre-release environment, and is used to store the static resources in the pre-release environment. The static resources in the pre-release environment are the first static resources. The electronic device 1 is respectively communicated with the HTML landing page server 21 corresponding to the pre-release environment, the static resource server 31 corresponding to the pre-release environment and the web application server 41 corresponding to the pre-release environment. Then in the pre-release environment, when the electronic device 1 acts as a front end to send an Ajax request to the web application server 41 corresponding to the pre-release environment, the electronic device 1 loads the first HTML landing page from the first HTML landing page code library 211 of the HTML landing page server 21 corresponding to the pre-release environment. And parse the domain name of the Ajax request in the pre-release environment from the first HTML landing page. For example, the domain name of the Ajax request in the pre-release environment is: "http: / / beta-color.jdl.id". And load the first static resource from the first static resource code library 311 of the static resource server 31 corresponding to the pre-release environment, and load the first static resource into the HTML landing page. Use static resources to splice the domain name and interface identifier of the Ajax request in the pre-release environment to obtain the interface in the pre-release environment. Then the electronic device 1 sends an Ajax request to the web application server 41 of the pre-release environment through the interface to implement the call of the Ajax request.

[0054] Figure 2 This is a network architecture diagram that can implement the front-end and back-end asynchronous request calling method of the embodiment of the present invention in an online environment, such as Figure 2As shown, the network architecture in the online environment includes: an electronic device 1, an HTML landing page server 22 corresponding to the online environment, a second HTML landing page code base 221, a static resource server 32 corresponding to the online environment, a second static resource code base 321, and a web application server 42 corresponding to the online environment. Among them, the second HTML landing page code base 221 is located in the HTML landing page server 22 corresponding to the online environment, and is used to store the HTML landing page in the online environment. The HTML landing page in the online environment is the second HTML landing page. The second static resource code base 321 is located in the static resource server 32 corresponding to the online environment, and is used to store the static resources in the online environment. The static resources in the online environment are the second static resources. The electronic device 1 is respectively connected to the HTML landing page server 22 corresponding to the online environment, the static resource server 32 corresponding to the online environment, and the web application server 42 corresponding to the online environment. Then, in the online environment, when the electronic device 1 sends an Ajax request to the web application server 42 corresponding to the online environment as the front end, the electronic device 1 loads the second HTML landing page from the second HTML landing page code base 221 of the HTML landing page server 22 corresponding to the online environment. And parse the domain name of the Ajax request in the corresponding access environment from the second HTML landing page. For example, the domain name of the Ajax request in the online environment is: "http: / / color.jdl.id". And load the second static resource from the second static resource code library 321 of the static resource server 32 corresponding to the online environment, and load the second static resource into the HTML landing page. Use static resources to splice the domain name and interface identifier of the Ajax request in the online environment to obtain the interface in the online environment. Then the electronic device 1 sends an Ajax request to the web application server 42 of the online environment through the interface to implement the call of the Ajax request.

[0055] The technical solution of the present invention and how the technical solution of the present invention solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present invention will be described below in conjunction with the accompanying drawings.

[0056] Embodiment 1

[0057] Figure 3 FIG. 1 is a flow chart of a front-end and back-end asynchronous request calling method provided by an embodiment of the present invention. Figure 3 As shown, the execution subject of the front-end and back-end asynchronous request calling method provided in this embodiment is a front-end and back-end asynchronous request calling device, which is located in an electronic device, and the electronic device is a front-end device. The front-end and back-end asynchronous request calling method provided in this embodiment includes the following steps:

[0058] Step 101, determining the corresponding access environment when calling the front-end and back-end asynchronous Ajax requests.

[0059] The access environment may be a pre-release environment or an online environment, which is not limited in this embodiment.

[0060] In this embodiment, in the pre-release environment and the online environment, the server accessed by the electronic device as the front end is different. In the pre-release environment, the server accessed by the electronic device is the pre-release environment web application server. In the online environment, the server accessed by the electronic device is the online environment web application server. When the electronic device accesses the pre-release environment web application server, it is necessary to configure the host of the pre-release environment web application server and bind the host of the pre-release environment web application server to the domain name of the Ajax request. When the electronic device accesses the online environment web application server, it is not necessary to bind the host of the online environment web application server to the domain name of the Ajax request. Therefore, the electronic device can determine the corresponding access environment when calling the Ajax request by judging whether the host of the web application server is bound to the domain name of the Ajax request.

[0061] The host works according to the TCP / IP for Windows standard and includes the mapping between the IP address and the host name of the pre-release environment web application server.

[0062] Step 102, load the corresponding hypertext markup language HTML landing page according to the access environment, and parse the domain name of the Ajax request in the corresponding access environment from the HTML landing page.

[0063] Among them, Hypertext Markup Language is referred to as HTML. So the Hypertext Markup Language landing page is referred to as HTML landing page.

[0064] In this embodiment, the landing pages of different access environments are stored in different servers in advance, and the domain name of the Ajax request of the corresponding access environment is pre-written in the HTML landing page of each access environment. Therefore, after the access environment is determined, the HTML landing page is loaded from the HTML landing page server of the corresponding access environment, and the HTML landing page is parsed to obtain the domain name of the Ajax request in the corresponding access environment.

[0065] For example, in a pre-release environment, the domain name of the Ajax request pre-written in the corresponding HTML landing page may be "http: / / beta-color.jdl.id". In an online environment, the domain name of the Ajax request pre-written in the corresponding HTML landing page may be "http: / / color.jdl.id".

[0066] When the domain name of the Ajax request corresponding to the access environment is pre-written in the HTML landing page of each access environment, the domain name variable of the Ajax request can be defined first, and then the domain name variable of the Ajax request can be written by assigning a value. Or it can be written in other ways, which is not limited in this embodiment.

[0067] Step 103, load the corresponding static resources in the HTML landing page, and use the static resources to splice the domain name and interface identifier of the Ajax request in the corresponding access environment to obtain the interface in the corresponding access environment.

[0068] In this embodiment, when calling an Ajax request, not only does it need to load the HTML landing page, but it also needs to introduce the corresponding static resources into the HTML landing page. In each access environment, the static resources are stored in the corresponding server respectively, so the static resources are obtained from the corresponding server according to the access environment, and then the static resources are loaded into the corresponding HTML landing page. Specifically, the static resources can be loaded at the bottom of the HTML landing page.

[0069] In this embodiment, in each access environment, the static resource may include the interface identifier of the interface corresponding to the Ajax request. In addition, the HTML landing page also includes the domain name of the Ajax request corresponding to the access environment, so the static resource can be used to splice the domain name and interface identifier of the Ajax request in the corresponding access environment to form the interface in the corresponding access environment.

[0070] Continuing with step 102, an exemplary explanation is given: in the pre-release environment, the domain name of the Ajax request pre-written in the corresponding HTML landing page can be "http: / / beta-color.jdl.id", and the interface identifier is "getUser", then the interface of the Ajax request in the pre-release environment after splicing is: "http: / / beta-color.jdl.id / getUser". In the online environment, the domain name of the Ajax request pre-written in the corresponding HTML landing page can be "http: / / color.jdl.id", and the interface identifier is "getUser", then the interface of the Ajax request in the online environment after splicing is: "http: / / color.jdl.id / getUser".

[0071] Step 104: Send an Ajax request to the web application server corresponding to the access environment through the interface to implement the call of the Ajax request.

[0072] In this embodiment, after determining the interface under the corresponding access environment, the web application server of the corresponding access environment is accessed through the interface, that is, an Ajax request is sent to the web application server of the corresponding access environment through the interface, and then data is obtained from the web application server of the corresponding access environment and fed back to the electronic device.

[0073] The front-end and back-end asynchronous request calling method provided in this embodiment determines the corresponding access environment when calling the front-end and back-end asynchronous Ajax requests; loads the corresponding hypertext markup language HTML landing page according to the access environment, and parses the domain name of the Ajax request in the corresponding access environment from the HTML landing page; loads the corresponding static resources in the HTML landing page, and uses the static resources to splice the domain name and interface identifier of the Ajax request in the corresponding access environment to obtain the interface in the corresponding access environment; sends an Ajax request to the web application server of the corresponding access environment through the interface to implement the call of the Ajax request. Since loading the corresponding HTML landing page and static resources is a necessary step for calling the Ajax request, the domain name of the Ajax request in each access environment is directly written into the corresponding HTML landing page, and the domain name and interface identifier of the Ajax request are spliced ​​through the static resources to obtain the corresponding interface. There is no need to determine the correct domain name and interface by modification, which effectively improves the efficiency of determining the correct domain name and interface. In addition, the domain name in each access environment is written into the corresponding HTML landing page in advance, so there will be no errors in the domain name and interface due to negligence or other reasons, thereby improving the accuracy of the domain name and interface when calling Ajax requests in different environments.

[0074] Embodiment 2

[0075] Figure 4 FIG. 1 is a flow chart of a front-end and back-end asynchronous request calling method provided by another embodiment of the present invention. Figure 4 As shown, the front-end and back-end asynchronous request calling method provided in this embodiment is based on the front-end and back-end asynchronous request calling method provided in Example 1, and further refines steps 102-103, and also includes the steps of writing the domain name of the corresponding Ajax request to the HTML landing page corresponding to different access environments, storing and deploying the HTML landing page, and storing and deploying the static resources of different access environments. The front-end and back-end asynchronous request calling method provided in this embodiment includes the following steps:

[0076] Step 201, determine a first HTML landing page corresponding to a pre-release environment and a second HTML landing page corresponding to an online environment.

[0077] As an optional implementation, Figure 5As shown, in this embodiment, step 201 includes the following steps:

[0078] Step 2011, obtain the preset HTML landing page.

[0079] In this embodiment, after the web application is developed according to the requirements, even if the requirements are constantly iterating, the HTML landing page is rarely changed, so the HTML landing page after the web application is developed can be obtained as the preset HTML landing page.

[0080] Among them, the HTML landing page after the web application is developed can be obtained by packaging the developed Javascript code through webpack.

[0081] Step 2012, define the domain name variable of the Ajax request at the first preset position in the preset HTML landing page.

[0082] Step 2013, assign the domain name variable of the Ajax request to the domain name of the Ajax request corresponding to the pre-release environment to determine the first HTML landing page.

[0083] Step 2014, assign the domain name variable of the Ajax request to the domain name of the Ajax request corresponding to the online environment to determine the second HTML landing page.

[0084] In this embodiment, a first preset position is determined in the preset HTML landing page, and the domain name variable of the Ajax request is defined in the first preset position. Since the domain name of the Ajax request is different in different access environments, the Ajax request domain name variable in the preset HTML landing page in different access environments can be assigned different values ​​to form HTML landing pages in different access environments.

[0085] Specifically, in this embodiment, if the Ajax request domain name variable is "requestDomain", for example, assigning the Ajax request domain name variable to the domain name of the Ajax request corresponding to the pre-release environment can be expressed as: "requestDomain = 'http: / / beta-color.jdl.id'". Assigning the Ajax request domain name variable to the domain name of the Ajax request corresponding to the online environment can be expressed as: "requestDomain = 'http: / / color.jdl.id'".

[0086] After the domain name variable of the Ajax request is assigned to the domain name of the Ajax request corresponding to the pre-release environment, the preset HTML landing page is determined as the first HTML landing page. After the domain name variable of the Ajax request is assigned to the domain name of the Ajax request corresponding to the online environment, the preset HTML landing page is determined as the second HTML landing page.

[0087] Step 202: Store the first HTML landing page in a first HTML landing page code library corresponding to the pre-release environment, and store the second HTML landing page in a second HTML landing page code library corresponding to the online environment.

[0088] In this embodiment, since the domain names of the Ajax requests written in the first HTML landing page and the second HTML landing page are different, they represent the domain names of the Ajax requests in different access environments. Therefore, in order to quickly and accurately obtain the domain name of the Ajax request in the corresponding access environment, the first HTML landing page and the second HTML landing page are stored separately. Specifically, the first HTML landing page is stored in the HTML landing page code library corresponding to the pre-release environment, and the second HTML landing page is stored in the HTML landing page code library corresponding to the online environment.

[0089] The first HTML landing page code library is the HTML landing page code library corresponding to the pre-release environment, and the second HTML landing page code library is the HTML landing page code library corresponding to the online environment.

[0090] Step 203, deploy the first HTML landing page code library to the HTML landing page server corresponding to the pre-release environment, and deploy the second HTML landing page code library to the HTML landing page server corresponding to the online environment.

[0091] In this embodiment, the first HTML landing page code library is deployed to the HTML landing page server corresponding to the pre-release environment, and the second HTML landing page code library is deployed to the HTML landing page server corresponding to the online environment, which can more effectively isolate the first HTML landing page code library and the second HTML landing page code library.

[0092] Step 204: determine a first static resource corresponding to the pre-release environment and a second static resource corresponding to the online environment.

[0093] Among them, the static resources corresponding to the pre-release environment are the first static resources, and the static resources corresponding to the online environment are the second static resources.

[0094] In this embodiment, after the web application is pre-released, webpack packages the pre-released Javascript code to obtain the first static resource. Similarly, after the web application is launched, webpack packages the launched Javascript code to obtain the second static resource.

[0095] Step 205: Store the first static resource in a first static resource code library corresponding to the pre-release environment, and store the second static resource in a second static resource code library corresponding to the online environment.

[0096] Step 206: deploy the first static resource code library to the static resource server corresponding to the pre-release environment, and deploy the second static resource code library to the static resource server corresponding to the online environment.

[0097] In this embodiment, in order to distinguish the static resources of different access environments, the first static resource is stored in the static resource code library corresponding to the pre-release environment, and the first static resource code library is deployed to the static resource server corresponding to the pre-release environment. The second static resource is stored in the static resource code library corresponding to the online environment, and the second static resource code library is deployed to the static resource server corresponding to the online environment.

[0098] The first static resource code library is a static resource code library corresponding to the pre-release environment, and the second static resource code library is a static resource code library corresponding to the online environment.

[0099] Step 207, determining the access environment corresponding to the Ajax request.

[0100] In this embodiment, the implementation of step 207 is similar to the implementation of step 101 in the first embodiment, and will not be described in detail here.

[0101] Step 208, load the corresponding HTML landing page according to the access environment.

[0102] As an optional implementation, Figure 6 As shown, in this embodiment, step 208 includes the following steps:

[0103] Step 2081, determine the HTML landing page server that deploys the corresponding HTML landing page code library based on the access environment.

[0104] Step 2082, load the HTML landing page corresponding to the access environment from the HTML landing page code library in the HTML landing page server.

[0105] In this embodiment, since the HTML landing pages of different access environments are respectively stored in the HTML landing page code library of the corresponding HTML landing page server, the HTML landing page server of the corresponding access environment is accessed to obtain the corresponding HTML landing page from the corresponding code library.

[0106] It should be noted that when accessing the HTML landing page server in the pre-release environment, it is necessary to determine the IP address and host name of the HTML landing page server in the pre-release environment based on the host of the HTML landing page server in the pre-release environment to complete access to the HTML landing page server in the pre-release environment.

[0107] Step 209, parse the domain name of the Ajax request in the corresponding access environment from the HTML landing page.

[0108] As an optional implementation, Figure 7 As shown, in this embodiment, step 209 includes the following steps:

[0109] Step 2091, obtain the first preset position of the domain name variable that defines the Ajax request in the HTML landing page.

[0110] Step 2092: parse the domain name of the Ajax request in the corresponding access environment according to the first preset location.

[0111] In this embodiment, since the domain name variable of the Ajax request is defined in the first preset position when it is defined in the corresponding HTML landing page, the first preset position of the domain name variable of the Ajax request defined in the HTML landing page can be obtained, and the HTML landing page is parsed from the first preset position to obtain the domain name of the Ajax request in the corresponding access environment.

[0112] Step 210, load the corresponding static resources in the HTML landing page.

[0113] As an optional implementation, Figure 8 As shown, in this embodiment, step 210 includes the following steps:

[0114] Step 2101, determine the static resource server that deploys the corresponding static resource code library according to the access environment.

[0115] Step 2102, obtaining corresponding static resources from the static resource code library in the static resource server.

[0116] In this embodiment, since the static resources of different access environments are respectively stored in the static resource code base of the corresponding static resource server, the static resource server of the corresponding access environment is accessed to obtain the corresponding static resource from the corresponding code base.

[0117] It should be noted that when accessing the static resource server in the pre-release environment, it is necessary to determine the IP address and host name of the static resource server in the pre-release environment based on the host of the static resource server in the pre-release environment to complete the access to the static resource server in the pre-release environment.

[0118] Step 2103, load the static resources into the corresponding HTML landing page.

[0119] Specifically, in this embodiment, after the static resources are acquired, the static resources are loaded to the bottom of the HTML landing page of the corresponding access environment, so that the HTML landing page introduces the corresponding static resources, thereby completing the preparation work for calling the Ajax request in the corresponding access environment.

[0120] Step 211, using static resources to concatenate the domain name and interface identifier of the Ajax request in the corresponding access environment to obtain the interface in the corresponding access environment.

[0121] As an optional implementation, Fig. 9 As shown, in this embodiment, step 211 includes the following steps:

[0122] Step 2111, use static resources to obtain the domain name of the Ajax request in the HTML landing page under the corresponding access environment.

[0123] In this embodiment, since the static resources are loaded into the HTML landing page in the corresponding access environment, the domain name of the Ajax request can be obtained from the first preset location.

[0124] Step 2112: Obtain the interface identifier stored in the second preset location from the static resource.

[0125] In this embodiment, the interface identifier is stored in the static resource, and may be specifically stored in the second preset location, so the interface identifier may be obtained from the second preset location.

[0126] It should be noted that the interface identifier when calling the Ajax request in the pre-release environment and the online environment can be the same.

[0127] Step 2113: concatenate the domain name and interface identifier of the Ajax request using a preset separator to obtain an interface under a corresponding access environment.

[0128] In this embodiment, the preset separator may be “ / ”, or may be other preset separators agreed upon by the front end and the web application server, which is not limited in this embodiment.

[0129] Step 212: Send an Ajax request to the web application server corresponding to the access environment through the interface to implement the call of the Ajax request.

[0130] In this embodiment, the implementation of step 212 is similar to the implementation of step 104 in the first embodiment, and will not be described in detail here.

[0131] The front-end and back-end asynchronous request calling method provided in this embodiment obtains a preset HTML landing page when determining a first HTML landing page corresponding to a pre-release environment and a second HTML landing page corresponding to an online environment; defines a domain name variable of an Ajax request at a first preset position in the preset HTML landing page; assigns the domain name variable of the Ajax request to the domain name of the Ajax request corresponding to the pre-release environment to determine the first HTML landing page; assigns the domain name variable of the Ajax request to the domain name of the Ajax request corresponding to the online environment to determine the second HTML landing page. By assigning values ​​to variables, the domain name of the Ajax request can be quickly and accurately written into the HTML landing page of the corresponding access environment.

[0132] The front-end and back-end asynchronous request calling method provided in this embodiment determines the first HTML landing page corresponding to the pre-release environment and the second HTML landing page corresponding to the online environment; stores the first HTML landing page in the first HTML landing page code library corresponding to the pre-release environment, and stores the second HTML landing page in the second HTML landing page code library corresponding to the online environment; deploys the first HTML landing page code library to the HTML landing page server corresponding to the pre-release environment, and deploys the second HTML landing page code library to the HTML landing page server corresponding to the online environment. It can isolate the first HTML landing page code library and the second HTML landing page code library more effectively. Load the corresponding HTML landing page under different access environments to prepare for the distinction of Ajax request domain names under different access environments.

[0133] The front-end and back-end asynchronous request calling method provided in this embodiment uses the static resource to splice the domain name and interface identifier of the Ajax request in the corresponding access environment to obtain the interface in the corresponding access environment, and then uses the static resource to obtain the domain name of the Ajax request in the HTML landing page in the corresponding access environment; obtains the interface identifier stored in the second preset position from the static resource; splices the domain name of the Ajax request and the interface identifier using a preset separator to obtain the interface in the corresponding access environment, so that when the static resource obtains the domain name of the corresponding Ajax request, it is directly obtained from the corresponding HTML landing page without distinguishing the domain name of the Ajax request according to the access environment, thereby improving the splicing efficiency of the interface in the corresponding access environment.

[0134] Embodiment 3

[0135] Fig.10 is a schematic diagram of the structure of a front-end and back-end asynchronous request calling device provided by an embodiment of the present invention. Fig.10 As shown, the front-end and back-end asynchronous request calling device 30 provided in this embodiment includes: a determination module 31, a loading module 32, a parsing module 33, a splicing module 34, and a sending module 35.

[0136] Among them, the determination module 31 is used to determine the corresponding access environment when calling the front-end and back-end asynchronous Ajax requests. The loading module 32 is used to load the corresponding hypertext markup language HTML landing page according to the access environment. The parsing module 33 is used to parse the domain name of the Ajax request under the corresponding access environment from the HTML landing page. The loading module 32 is also used to load the corresponding static resources in the HTML landing page. The splicing module 34 is used to use static resources to splice the domain name and interface identifier of the Ajax request under the corresponding access environment to obtain the interface under the corresponding access environment. The sending module 35 is used to send an Ajax request to the web application server of the corresponding access environment through the interface to implement the call of the Ajax request.

[0137] Optionally, the access environment includes: a pre-release environment and an online environment. Accordingly, the front-end and back-end asynchronous request calling device 30 provided in this embodiment further includes: a storage module and a deployment module.

[0138] Among them, the determination module 31 is also used to determine the first HTML landing page corresponding to the pre-release environment and the second HTML landing page corresponding to the online environment. The storage module is used to store the first HTML landing page in the first HTML landing page code library corresponding to the pre-release environment, and store the second HTML landing page in the second HTML landing page code library corresponding to the online environment. The deployment module is used to deploy the first HTML landing page code library to the HTML landing page server corresponding to the pre-release environment, and deploy the second HTML landing page code library to the HTML landing page server corresponding to the online environment.

[0139] Optionally, the determination module 31, when determining the first HTML landing page corresponding to the pre-release environment and the second HTML landing page corresponding to the online environment, is specifically used to:

[0140] Get a preset HTML landing page; define a domain name variable of an Ajax request at a first preset position in the preset HTML landing page; assign the domain name variable of the Ajax request to the domain name of the Ajax request corresponding to the pre-release environment to determine the first HTML landing page; assign the domain name variable of the Ajax request to the domain name of the Ajax request corresponding to the online environment to determine the second HTML landing page.

[0141] Optionally, the loading module 32, when loading the corresponding HTML landing page according to the access environment, is specifically used to:

[0142] Determine the deployment of an HTML landing page server corresponding to the HTML landing page code library according to the access environment; load the HTML landing page corresponding to the access environment from the HTML landing page code library in the HTML landing page server.

[0143] Optionally, the parsing module 33 is specifically used to: obtain a first preset position of a domain name variable defining an Ajax request in an HTML landing page; and parse out the domain name of the Ajax request in a corresponding access environment according to the first preset position.

[0144] Optionally, the determination module 31 is also used to determine the first static resource corresponding to the pre-release environment and the second static resource corresponding to the online environment. The storage module is also used to store the first static resource in the first static resource code library corresponding to the pre-release environment, and store the second static resource in the second static resource code library corresponding to the online environment. The deployment module is also used to deploy the first static resource code library to the static resource server corresponding to the pre-release environment, and deploy the second static resource code library to the static resource server corresponding to the online environment.

[0145] Optionally, when loading corresponding static resources in an HTML landing page, the loading module 32 is specifically used to determine a static resource server that deploys a corresponding static resource code library according to an access environment; obtain corresponding static resources from the static resource code library in the static resource server; and load the static resources into the corresponding HTML landing page.

[0146] Optionally, the splicing module 34 is specifically used for:

[0147] Use static resources to obtain the domain name of the Ajax request in the HTML landing page under the corresponding access environment; obtain the interface identifier stored in the second preset location from the static resources; and concatenate the domain name and interface identifier of the Ajax request using a preset separator to obtain the interface under the corresponding access environment.

[0148] The front-end and back-end asynchronous request calling device provided in this embodiment can execute Figure 3-Figure 9 The technical solution of the method embodiment shown in the figure has the same implementation principle and technical effect as Figure 3-Figure 9 The method embodiments shown are similar and will not be described in detail here.

[0149] Embodiment 4

[0150] Fig.11 Schematic diagram of the structure of an electronic device used to implement the front-end and back-end asynchronous request calling method of an embodiment of the present invention, such as Fig.11 As shown, the electronic device 40 provided in this embodiment includes: a memory 41, a processor 42 and a transceiver 43.

[0151] The processor 42, the memory 41 and the transceiver 43 are interconnected via circuits;

[0152] The memory 41 stores computer-executable instructions; the transceiver 43 is used to send and receive data with the web application server;

[0153] At least one processor 42 executes the computer-executable instructions stored in the memory, so that the at least one processor executes the method in the above-mentioned embodiment 1 or embodiment 2.

[0154] Embodiment 5

[0155] Fig.12 is a block diagram of an electronic device for implementing the front-end and back-end asynchronous request calling method of an embodiment of the present invention, such as Fig.12 As shown, the electronic device 500 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0156] Among them, the electronic device 500 may include one or more of the following components: a processing component 502, a memory 504, a power component 506, a multimedia component 508, an audio component 510, an input / output (I / O) interface 512, a sensor component 514, and a communication component 516.

[0157] The processing component 502 generally controls the overall operation of the device 500, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 502 may include one or more processors 520 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 502 may include one or more modules to facilitate the interaction between the processing component 502 and other components. For example, the processing component 502 may include a multimedia module to facilitate the interaction between the multimedia component 508 and the processing component 502.

[0158] The memory 504 is configured to store various types of data to support operations on the device 500. Examples of such data include instructions for any application or method operating on the device 500, contact data, phone book data, messages, pictures, videos, etc. The memory 504 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0159] The power supply component 506 provides power to the various components of the device 500. The power supply component 506 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 500.

[0160] The multimedia component 508 includes a screen that provides an output interface between the device 500 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 508 includes a front camera and / or a rear camera. When the device 500 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0161] The audio component 510 is configured to output and / or input audio signals. For example, the audio component 510 includes a microphone (MIC), and when the device 500 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 504 or sent via the communication component 516. In some embodiments, the audio component 510 also includes a speaker for outputting audio signals.

[0162] I / O interface 512 provides an interface between processing component 502 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.

[0163] The sensor assembly 514 includes one or more sensors for providing various aspects of status assessment for the device 500. For example, the sensor assembly 514 can detect the open / closed state of the device 500, the relative positioning of components, such as the display and keypad of the device 500, the sensor assembly 514 can also detect the position change of the device 500 or a component of the device 500, the presence or absence of user contact with the device 500, the orientation or acceleration / deceleration of the device 500 and the temperature change of the device 500. The sensor assembly 514 can include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 514 can also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 514 can also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor or a temperature sensor.

[0164] The communication component 516 is configured to facilitate wired or wireless communication between the device 500 and other devices. The device 500 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 516 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 516 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0165] In an exemplary embodiment, the apparatus 500 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above methods.

[0166] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 504 including instructions, which can be executed by a processor 520 of the apparatus 500 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0167] A non-temporary computer-readable storage medium, when the instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to execute the front-end and back-end asynchronous request calling method provided in embodiment one or embodiment two.

[0168] In an exemplary embodiment, a computer program product is also provided, including a computer program, and the computer program is executed by a processor to execute the front-end and back-end asynchronous request calling method provided in the above-mentioned embodiment 1 or embodiment 2.

[0169] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be regarded as exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0170] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A front-end and back-end asynchronous request calling method, characterized in that: include: Determine the corresponding access environment when calling front-end and back-end asynchronous Ajax requests; Loading a corresponding hypertext markup language HTML landing page according to the access environment, and parsing the domain name of the Ajax request in the corresponding access environment from the HTML landing page; Load the corresponding static resources in the HTML landing page, and use the static resources to concatenate the domain name and interface identifier of the Ajax request in the corresponding access environment to obtain the interface in the corresponding access environment; Sending an Ajax request to a web application server corresponding to the access environment through the interface to implement the call of the Ajax request; The access environment includes: a pre-release environment and an online environment; Before loading the corresponding HTML landing page according to the access environment, the method further includes: Determine a first HTML landing page corresponding to the pre-release environment and a second HTML landing page corresponding to the online environment; The first HTML landing page is stored in a first HTML landing page code library corresponding to the pre-release environment, and the second HTML landing page is stored in a second HTML landing page code library corresponding to the online environment; The first HTML landing page code library is deployed to the HTML landing page server corresponding to the pre-release environment, and the second HTML landing page code library is deployed to the HTML landing page server corresponding to the online environment.

2. The method according to claim 1, characterized in that The determining of a first HTML landing page corresponding to the pre-release environment and a second HTML landing page corresponding to the online environment includes: Get the preset HTML landing page; Define a domain name variable for the Ajax request at a first preset position in the preset HTML landing page; Assigning the domain name variable of the Ajax request to the domain name of the Ajax request corresponding to the pre-release environment to determine the first HTML landing page; The domain name variable of the Ajax request is assigned to the domain name of the Ajax request corresponding to the online environment to determine the second HTML landing page.

3. The method according to claim 1, characterized in that The loading of the corresponding HTML landing page according to the access environment includes: Determine an HTML landing page server for deploying a corresponding HTML landing page code library according to the access environment; The HTML landing page corresponding to the access environment is loaded from the HTML landing page code library in the HTML landing page server.

4. The method according to claim 2, characterized in that: The step of parsing the domain name of the Ajax request in the corresponding access environment from the HTML landing page includes: Obtain a first preset location of a domain name variable defining an Ajax request in the HTML landing page; The domain name of the Ajax request in the corresponding access environment is parsed according to the first preset location.

5. The method according to claim 1, characterized in that: Before loading the corresponding static resources in the HTML landing page, the method further includes: Determine a first static resource corresponding to the pre-release environment and a second static resource corresponding to the online environment; The first static resource is stored in a first static resource code library corresponding to the pre-release environment, and the second static resource is stored in a second static resource code library corresponding to the online environment; The first static resource code library is deployed to the static resource server corresponding to the pre-release environment, and the second static resource code library is deployed to the static resource server corresponding to the online environment.

6. The method according to claim 5, characterized in that The loading of the corresponding static resources in the HTML landing page includes: Determine a static resource server for deploying a corresponding static resource code library according to the access environment; Acquire corresponding static resources from a static resource code library in the static resource server; Load the static resources into the corresponding HTML landing page.

7. The method according to any one of claims 1 to 6, characterized in that: The method of using the static resource to concatenate the domain name and interface identifier of the Ajax request in the corresponding access environment to obtain the interface in the corresponding access environment includes: Use static resources to obtain the domain name of the Ajax request in the HTML landing page under the corresponding access environment; Acquire the interface identifier stored in the second preset location from the static resource; The domain name of the Ajax request and the interface identifier are concatenated using a preset separator to obtain an interface under a corresponding access environment.

8. A front-end and back-end asynchronous request calling device, characterized in that: include: The determination module is used to determine the corresponding access environment when calling the front-end and back-end asynchronous Ajax requests; A loading module, used to load a corresponding hypertext markup language HTML landing page according to the access environment; A parsing module, used to parse the domain name of the Ajax request in the corresponding access environment from the HTML landing page; The loading module is also used to load corresponding static resources in the HTML landing page; A splicing module, used to splice the domain name and interface identifier of the Ajax request in the corresponding access environment using the static resources to obtain the interface in the corresponding access environment; A sending module, used to send an Ajax request to a web application server corresponding to the access environment through the interface, so as to implement the call of the Ajax request; The access environment includes: a pre-release environment and an online environment; the device also includes: a storage module and a deployment module; The determination module is further used to determine a first HTML landing page corresponding to the pre-release environment and a second HTML landing page corresponding to the online environment; The storage module is used to store the first HTML landing page in a first HTML landing page code library corresponding to the pre-release environment, and store the second HTML landing page in a second HTML landing page code library corresponding to the online environment; The deployment module is used to deploy the first HTML landing page code library to the HTML landing page server corresponding to the pre-release environment, and deploy the second HTML landing page code library to the HTML landing page server corresponding to the online environment.

9. The device according to claim 8, characterized in that The determination module, when determining the first HTML landing page corresponding to the pre-release environment and the second HTML landing page corresponding to the online environment, is specifically used to: Obtain a preset HTML landing page; define a domain name variable for an Ajax request at a first preset position in the preset HTML landing page; Assigning the domain name variable of the Ajax request to the domain name of the Ajax request corresponding to the pre-release environment to determine the first HTML landing page; The domain name variable of the Ajax request is assigned to the domain name of the Ajax request corresponding to the online environment to determine the second HTML landing page.

10. The device according to claim 8, characterized in that The loading module, when loading the corresponding HTML landing page according to the access environment, is specifically used to: Determine an HTML landing page server that deploys a corresponding HTML landing page code library according to the access environment; and load an HTML landing page corresponding to the access environment from the HTML landing page code library in the HTML landing page server.

11. The device according to claim 9, characterized in that The analysis module is specifically used for: Obtain a first preset location of a domain name variable defining an Ajax request in the HTML landing page; The domain name of the Ajax request in the corresponding access environment is parsed according to the first preset location.

12. The device according to any one of claims 8 to 11, characterized in that: The splicing module is specifically used for: Use static resources to obtain the domain name of the Ajax request in the HTML landing page under the corresponding access environment; Acquire the interface identifier stored in the second preset location from the static resource; The domain name of the Ajax request and the interface identifier are concatenated using a preset separator to obtain an interface under a corresponding access environment.

13. An electronic device, characterized in that: include: At least one processor, memory and transceiver; The processor, the memory and the transceiver are interconnected via a circuit; The memory stores computer-executable instructions; the transceiver is used to send and receive data with the web application server; The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the method according to any one of claims 1 to 7.

14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 7 when executed by a processor.

15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.