Service calling method, device and system and storage medium

By obtaining and replacing the domain name in the URL address with the domain name in the domain name pool in the terminal device, the problem of concurrency restriction of HTTP requests under the HTTP/1.1 protocol is solved, and high concurrency capability under the HTTP/1.1 protocol is achieved.

CN119172370APending Publication Date: 2024-12-20GUANGZHOU KINDLINK SOFTWARE TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411302432.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-18
Publication Date
2024-12-20

AI Technical Summary

Technical Problem

When using the HTTP/1.1 protocol, each domain name can only support concurrent HTTP requests, resulting in the problem of request blocking when the number of HTTP requests exceeds 6.

Method used

By obtaining the domain name pool corresponding to the first service in the terminal device, replacing the domain name in the URL address based on the domain name in the domain name pool, and generating a new URL address, thus supporting up to 6N HTTP request concurrency under the HTTP/1.1 protocol.

Benefits of technology

It effectively solves the problem of HTTP request blocking, and realizes that it supports up to 6N HTTP request concurrency under the HTTP/1.1 protocol, significantly improving concurrency capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119172370A_ABST
    Figure CN119172370A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a service calling method, device and system and a storage medium, after a terminal device obtains a domain name pool corresponding to a first service and a URL address corresponding to a first task, a domain name in the domain name pool can be adopted to replace a domain name included in the URL address so as to generate a new URL address. As the domain name pool comprises N domain names, at most 6N new URL addresses can be generated. Therefore, when the first service is called based on the HTTP / 1.1 protocol and the new URL address, 6N HTTP request concurrence can be supported at most, and compared with the condition that only 6 HTTP request concurrence can be supported in the prior art, the HTTP request concurrence method and device can solve the technical problem of HTTP request blocking.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a service calling method, device, system and storage medium. Background Art

[0002] Transmission Control Protocol (TCP) is a connection-oriented, reliable, byte-stream-based transport layer communication protocol. Hypertext Transfer Protocol (HTTP) is a simple request-response protocol that usually runs on top of a TCP connection. It specifies what messages a terminal device may send to a server and what responses it may receive.

[0003] The HTTP protocol includes multiple versions, including HTTP / 1.0, HTTP / 1.1, HTTP / 2.0 and HTTP / 3.0. When using the HTTP / 1.1 protocol, the same domain name is only allowed to establish 6 TCP connections at the same time, and each TCP connection can only support one HTTP request at most. Therefore, each domain name can only support 6 HTTP requests at the same time, which leads to a concurrent limit on the number of HTTP requests.

[0004] When using the HTTP / 1.0 protocol to call a service, if the number of HTTP requests generated using the service's domain name is greater than 6, a technical problem of HTTP request blocking will occur. Summary of the invention

[0005] In view of this, the embodiments of the present application provide a service calling method, device, system and storage medium, which can solve the technical problem of HTTP request blocking.

[0006] In a first aspect, an embodiment of the present application provides a service calling method, which is applied to a terminal device, and includes: receiving request information for requesting the execution of a first task; the first task is a task for calling a first service; obtaining a domain name pool corresponding to the first service and a uniform resource locator URL address corresponding to the first task; wherein the domain name pool includes N domain names, each domain name points to the first service; based on the domain names in the domain name pool, replacing the domain names included in the URL address to generate a new URL address; based on the HTTP / 1.1 protocol and the new URL address, sending an HTTP request to the first service to execute the first task.

[0007] Optionally, the request information includes a classification identifier of the first service;

[0008] The obtaining of the domain name pool corresponding to the first service includes: obtaining the domain name pool corresponding to the first service according to the classification identifier of the first service and a preset mapping relationship; wherein the mapping relationship is a mapping relationship between the classification identifier of the first service and the classification identifier of the domain name pool.

[0009] Optionally, before receiving the request information for executing the first task, the method further includes: sending a domain name pooling request for the first service to the server; the domain name pooling request includes the IP address of the first service; and receiving the domain name pool corresponding to the first service sent by the server.

[0010] Optionally, the domain name included in the URL address is replaced based on the domain name in the domain name pool to generate a new URL address, including: obtaining a first domain name in the domain name pool; querying a first count value corresponding to the first domain name; the first count value is used to indicate the number of HTTP requests currently occupying the first domain name; if the first count value is less than a preset threshold, replacing the domain name included in the URL address with the first domain name to generate a new URL address.

[0011] Optionally, the domain name included in the URL address is replaced based on the domain name in the domain name pool to generate a new URL address, and also includes: if the first count value is equal to the preset threshold, obtaining a second domain name in the domain name pool; querying a second count value corresponding to the second domain name; the second count value is used to indicate the number of HTTP requests currently occupying the second domain name; if the second count value is less than the preset threshold, replacing the domain name included in the URL address with the second domain name to generate a new URL address.

[0012] Optionally, based on the HTTP / 1.1 protocol and the new URL address, an HTTP request is sent to the first service to execute the first task, including: based on the HTTP / 1.1 protocol and the new URL address, an HTTP request is sent to the first service once, and the first count value is updated; whether the updated first count value is less than the preset threshold value; if the updated first count value is less than the preset threshold value, based on the HTTP / 1.1 protocol and the new URL address, an HTTP request is sent to the first service again, and the first count value is updated.

[0013] Optionally, the sending of an HTTP request to the first service based on the HTTP / 1.1 protocol and the new URL address to execute the first task also includes: if the updated first count value is equal to the preset threshold, obtaining a third domain name in the domain name pool; querying a third count value corresponding to the third domain name; the third count value is used to indicate the number of HTTP requests currently occupying the third domain name; if the third count value is less than the preset threshold, replacing the first domain name with the third domain name to generate a first URL address; based on the HTTP / 1.1 protocol and the first URL address, sending an HTTP request to the first service again to execute the first task and update the third count value.

[0014] In a second aspect, an embodiment of the present application provides a domain name pooling method, which is applied to a server, including: receiving a domain name pooling request for a first service sent by a terminal device; generating N domain names corresponding to the first service; wherein each of the domain names points to the first service; creating a domain name pool, and storing the N domain names in the domain name pool; and sending the domain name pool to the terminal device.

[0015] Optionally, the domain name pooling request includes the IP address of the first service; generating N domain names corresponding to the first service includes: combining N port numbers with the IP address of the first service to form N domain names, and establishing a mapping relationship between the N domain names and the first service.

[0016] Optionally, the domain name pooling request includes a classification identifier of the first service; after creating the domain name pool and storing the N domain names in the domain name pool, the method further includes: creating a classification identifier of the domain name pool; and establishing a mapping relationship between the classification identifier of the domain name pool and the classification identifier of the first service.

[0017] In a third aspect, an embodiment of the present application provides a service calling device, which is arranged in a terminal device, and includes: a first receiving module, used to receive request information for requesting the execution of a first task; the first task is a task for calling a first service; an acquisition module, used to obtain a domain name pool corresponding to the first service and a URL address corresponding to the first task; wherein the domain name pool includes N domain names, each domain name points to the first service; a replacement module, used to replace the domain name included in the URL address based on the domain name in the domain name pool to generate a new URL address; a first sending module, used to send an HTTP request to the first service based on the HTTP / 1.1 protocol and the new URL address to execute the first task.

[0018] In a fourth aspect, an embodiment of the present application provides a domain name pooling device, which is arranged on a server, and includes: a second receiving module, used to receive a domain name pooling request for a first service sent by a terminal device; a generating module, used to generate N domain names corresponding to the first service; wherein each of the domain names points to the first service; a creating module, used to create a domain name pool, and store the N domain names in the domain name pool; a second sending module, used to send the domain name pool to the terminal device.

[0019] In a fifth aspect, an embodiment of the present application provides a terminal device for executing any of the aforementioned service calling methods.

[0020] In a sixth aspect, an embodiment of the present application provides a server for executing any of the aforementioned domain name pooling methods.

[0021] In a seventh aspect, an embodiment of the present application provides a service calling system, comprising any of the aforementioned terminal devices and any of the aforementioned servers.

[0022] In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the computer program implements any of the aforementioned service calling methods or any of the aforementioned domain name pooling methods.

[0023] The embodiments of the present application provide a service calling method, apparatus, system and storage medium. After the terminal device obtains the domain name pool corresponding to the first service and the URL address corresponding to the first task, the domain name in the domain name pool can be used to replace the domain name included in the URL address to generate a new URL address. Since the domain name pool includes N domain names, up to 6N new URL addresses can be generated. Therefore, when calling the first service based on the HTTP / 1.1 protocol and the new URL address, up to 6N HTTP requests can be supported concurrently. Compared with the prior art that can only support 6 HTTP requests concurrently, the present application can solve the technical problem of HTTP request blocking. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0025] Figure 1 A structural diagram of a service calling system provided in an embodiment of the present application;

[0026] Figure 2Another structural diagram of the service calling system provided in the embodiment of the present application;

[0027] Figure 3 A flowchart of a domain name pooling method provided in an embodiment of the present application;

[0028] Figure 4 A flow chart of a service calling method provided in an embodiment of the present application;

[0029] Figure 5 A schematic diagram of the structure of a domain name pooling device provided in an embodiment of the present application;

[0030] Figure 6 A schematic diagram of the structure of a service calling device provided in an embodiment of the present application;

[0031] Figure 7 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0032] The term "and / or" in this article is a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The symbol " / " in this article indicates that the associated objects are in an or relationship, for example, A / B means A or B.

[0033] The terms "first" and "second" in the specification and claims herein are used to distinguish different objects rather than to describe a specific order of the objects. For example, a first response message and a second response message are used to distinguish different response messages rather than to describe a specific order of the response messages.

[0034] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0035] In the description of the embodiments of the present application, unless otherwise specified, "multiple" means two or more than two. For example, multiple processors means two or more processors, etc.; multiple elements means two or more elements, etc.

[0036] In the current related technology, when using the HTTP / 1.1 protocol, each domain name can only support 6 concurrent HTTP requests at most. Therefore, when using the HTTP / 1.0 protocol to call a service, when the number of HTTP requests generated by the domain name of the service is greater than 6, the technical problem of HTTP request blocking will occur.

[0037] In view of this, the embodiments of the present application provide a service calling method, device, system and storage medium. After the terminal device obtains the domain name pool corresponding to the first service and the Uniform Resource Locator (URL) address corresponding to the first task, the domain name in the domain name pool can be used to replace the domain name included in the URL address to generate a new URL address. Since the domain name pool includes N domain names, up to 6N new URL addresses can be generated. Therefore, when an HTTP request is initiated based on the HTTP / 1.1 protocol and the new URL address to call the first service, up to 6N HTTP requests can be supported concurrently. Compared with the prior art that can only support 6 HTTP requests concurrently, the present application can solve the technical problem of HTTP request blocking.

[0038] The present application embodiment provides a service calling system, such as Figure 1 As shown, the service calling system 1 may include a terminal device 11 and a server 12. A first program and a first service may be deployed in the terminal device 11, and the embodiment of the present application does not limit the type of the first program. Exemplarily, the first program may be a Web application. A domain name pooling service may be deployed in the server 12.

[0039] In addition, the first service may also be deployed not on the terminal device 11, but on an electronic device 13 that is communicatively connected to the terminal device 11, such as Figure 2 As shown in the embodiment of the present application Figure 1 The service calling system 1 shown in FIG. 1 is taken as an example for detailed description.

[0040] After we deploy the first service on the terminal device 11, the first program can call the first service to implement certain tasks. For example, the first service can be a video streaming service, and the Web application can send an HTTP request to the video streaming service based on the HTTP / 1.1 protocol to implement the call to the video streaming service. However, after a TCP connection is established between the Web application and the video streaming service, when the number of HTTP requests sent by the Web application to the video streaming service exceeds 6, a technical problem of HTTP request blocking will occur.

[0041] In one example, a campus scene including 20 cameras is displayed on the display page of the digital twin platform's web application. When it is necessary to display 8 real-time surveillance videos corresponding to cameras 1 to 8, the web application can send 8 HTTP requests to the video streaming service. However, when the HTTP / 1.1 protocol is used, only 6 concurrent HTTP requests can be supported at most, so only 6 real-time surveillance videos of cameras can be displayed at most at the same time.

[0042] In order to solve the above technical problems, the embodiment of the present application provides a domain name pooling method executed by the server 12 and a service calling method executed by the terminal device 11. The domain name pooling method executed by the server 12 includes the following steps S301 to S304, such as Figure 3 As shown, the service calling method executed by the terminal device 11 includes the following steps S305 to S308, as shown in FIG. Figure 4 shown.

[0043] The following first introduces the domain name pooling method performed by the server 12. The domain name pooling method may include the following steps:

[0044] S301, the terminal device 11 sends a domain name pooling request for a first service to the server 12. Correspondingly, the server 12 receives the domain name pooling request for the first service sent by the terminal device.

[0045] In this step, the first program on the terminal device 11 may send a domain name pooling request for the first service to the server 12. The present application does not limit the specific type and function of the first service. For example, the first service may be a video streaming service.

[0046] S302, the server 12 generates N domain names corresponding to the first service, wherein each domain name points to the first service.

[0047] In this step, the domain name pooling service in the server 12 can generate one or more domain names corresponding to the first service. Each domain name points to the first service, that is, each domain name has a mapping relationship with the first service. The first service can be called through any of these domain names to implement the corresponding function. Exemplarily, the first service can be a video streaming service. By calling the video streaming service, video stream data can be pulled and played. This process involves the transmission, decoding and playback of video data.

[0048] In a specific implementation, the domain name pooling request in step S301 may include the IP address of the first service, and the IP address of the first service is specifically the IP address of the computer where the first service is located, and the computer may be Figure 2The terminal device 11 shown in Figure 3 The electronic device 13 shown in FIG. 1 is communicatively connected to the terminal device 11 .

[0049] The domain name pooling service in the server 12 can combine N idle port numbers with the IP address of the first service to form N domain names for use in subsequent steps. Each domain name is then bound to the first service to establish a mapping relationship. In this way, the first service can be called through any of the above domain names. It can be understood that an idle port number is a port number that has not established a corresponding relationship with a specific service.

[0050] In detail, the main function of the port number is to indicate the service provided by a specific process in a computer. The computer in the network is represented by its IP address, which can only represent a specific computer, but a computer can provide many services at the same time, such as database services, file transfer protocol services, Web services, video streaming services, and audio streaming services. By assigning different port numbers to different services, these different services provided by the same computer can be distinguished. In order to distinguish the ports, each port is numbered, which is the port number. The port number ranges from 0 to 65535.

[0051] Exemplarily, the IP address of the video streaming service is 159.14.189.30, and the domain name pooling service can select idle port numbers 31000, 31001, 31002, 31003, 31004, 31005, 31006, 31007, 31008, and 31009 and allocate them to the video streaming service.

[0052] The domain name pooling service can combine the IP address 159.14.189.30 of the video streaming service with the above port number to form 10 domain names, namely "159.14.189.30:31000", "159.14.189.30:31001", "159.14.189.30:31002", "159.14.189.30:31003", "159.14.189.30:31004", "159.14.189.30:31005", "159.14.189.30:31006", "159.14.189.30:31007", "159.14.189.30:31008", "159.14.189.30:31009", " 003","159.14.189.30:31004","159.14.189.30:31005","159.14.189.30:31006","159.14.189.30:31007","159.14.189.30:31008",and"159.14.189.30:31009".

[0053] Next, the domain name pooling service can establish a mapping relationship between the video streaming service and the above 10 domain names. In this way, in the subsequent steps, the first program can send a corresponding HTTP request to the video streaming service through the above domain names.

[0054] Specifically, the domain name pooling service may include a domain name mapping module, and the domain name mapping module may perform the above operations.

[0055] S303, the server 12 creates a domain name pool, and stores the N domain names in the domain name pool.

[0056] In this step, the domain name pooling service in the server 12 may create a domain name pool and store the N domain names generated in step S302 in the domain name pool.

[0057] S304, the server 12 sends the domain name pool to the terminal device 11. Accordingly, the terminal device 11 receives the domain name pool and stores the domain name pool so as to use the domain names in the domain name pool in subsequent steps. For details, please refer to the following steps.

[0058] In one implementation, in order to facilitate accurate acquisition of the domain name pool corresponding to the first service when calling the first service in subsequent steps, a correspondence between the first service and the domain name pool can be established. Specifically, the domain name pooling request in step S301 can include a classification identifier of the first service. Accordingly, between step S303 and step S304, the domain name pooling service in server 12 can create a classification identifier for the domain name pool, and establish a mapping relationship between the classification identifier of the domain name pool and the classification identifier of the first service, so that in the subsequent process, the domain name pool corresponding to the first service can be accurately obtained based on the identifiers of the two, avoiding confusion with other domain name pools and errors.

[0059] Exemplarily, the first service is a video streaming service, and its classification identifier is video. Therefore, the domain name pooling service can also set the classification identifier of the domain name pool to video, and the logic of the mapping relationship can be that there is a corresponding relationship between classification identifiers of the same name. In the subsequent steps, the domain name pool with the same classification identifier as the video streaming service can be queried based on the classification identifier video.

[0060] Based on the above steps S301 to S304, the server 12 may generate a domain name pool corresponding to the first service, so that the terminal device 11 can use the domain names in the above domain name pool when calling the first service.

[0061] The above describes how the server 12 generates a domain name pool corresponding to the first service through the domain name pooling method. On this basis, the following describes how the terminal device 11 uses the aforementioned domain name pool to call the first service through a service calling method. The service calling method may include the following steps:

[0062] S305: The terminal device 11 receives request information for executing the first task.

[0063] In this step, the first task is a task of calling the first service. For example, the first service is a video streaming service, and the first task is a task of displaying real-time monitoring videos of one or more cameras.

[0064] Using the previous example, the first program is a web application of the digital twin platform. The web application shows a display interface of a campus, where 20 cameras are deployed. Correspondingly, 20 cameras are displayed in the display interface, namely camera 1 to camera 20.

[0065] When the user selects camera 1 to camera 8 on the display interface of the Web application, a task request will be generated. The task request is specifically a request to display the real-time monitoring videos of camera 1 to camera 8.

[0066] S306, the terminal device 11 obtains the domain name pool corresponding to the first service and the URL address corresponding to the first task.

[0067] In this step, the first program of the terminal device 11 can obtain the domain name pool corresponding to the first service, which may include multiple domain names, each of which points to the first service, that is, each domain name has a mapping relationship with the first service, and the first service can be called through each domain name.

[0068] In one implementation, there is a preset mapping relationship between the classification identifier of the first service and the classification identifier of the domain name pool. The first program can determine the classification identifier of the domain name pool corresponding to the first service based on the classification identifier of the first service and the aforementioned mapping relationship, so that the corresponding domain name pool can be obtained based on the identifier. In this way, the domain name pool corresponding to the first service can be accurately obtained to avoid errors. For example, the logic of the mapping relationship can be that there is a corresponding relationship between classification identifiers of the same name. Therefore, based on the classification identifier of the video streaming service, video deo, a domain name pool with the same classification identifier can be obtained.

[0069] After receiving the request information for executing the first task, the first program can send it to the first service. After receiving the request information, the first service can generate a URL address corresponding to the first task based on its own original domain name, and send the URL address corresponding to the first task to the first program. In this way, the first program can obtain the URL address of the first task.

[0070] S307: The terminal device 11 replaces the domain name included in the URL address based on the domain name in the domain name pool to generate a new URL address.

[0071] In this step, the first program in the terminal device 11 can replace the domain name included in the URL address with the domain name in the domain name pool to generate a new URL address. The domain name in the new URL address points to the first service, so the new URL address can also be used to call the first service.

[0072] Exemplarily, the URL address corresponding to the first task is http: / / 159.14.189.30:8085 / mc-l i ve / l ve / 4302367935.flv. After the domain name 159.14.189.30:8085 is replaced with 159.14.189.30:30000 in the domain name pool, the new URL address is http: / / 159.14.189.30:30000 / mc-l i ve / l ve / 4302367935.flv. 159.14.189.30:30000 points to the video streaming service. Therefore, the video streaming service can also be called using the new URL address.

[0073] In a specific implementation, a Web application can obtain a domain name (recorded as a first domain name) in a domain name pool. For example, the first domain name can be 159.14.189.30:30000. Then, a count value corresponding to the first domain name is queried (recorded as a first count value). The first count value is used to represent the number of HTTP requests currently occupying the first domain name.

[0074] Specifically, a counter can be set for the domain name pool, and a count value can be set for each domain name in the counter. When a HTTP request is initiated using a certain domain name, the Web application can add one to the count value corresponding to the domain name. When the HTTP request is terminated, the Web application can parse the domain name from the URL address in the HTTP request and subtract one from the count value corresponding to the domain name, so that the count value of the domain name can represent the number of HTTP requests currently occupying the first domain name.

[0075] If the first count value is less than 6, it indicates that HTTP requests can still be sent based on the domain name. For example, if the count value is 4, it indicates that 2 HTTP requests can still be sent based on the domain name. Therefore, the Web application can use the first domain name to replace the domain name included in the URL address to generate a new URL address.

[0076] If the first count value is equal to 6, it means that if the HTTP request continues to be sent based on the domain name, HTTP request blocking will occur. Therefore, the Web application can query the count value (recorded as the second count value) corresponding to another domain name (recorded as the second domain name) in the domain name pool. Exemplarily, the second domain name can be 159.14.189.30:30001. The second count value is used to characterize the number of HTTP requests currently occupying the second domain name. The same method as in the above description is used to determine whether the second count value is less than 6. If it is less than 6, the second domain name can be used to replace the domain name included in the URL address to generate a new URL address.

[0077] If the second count value is equal to 6, by querying whether the count value corresponding to another domain name (not the first domain name and the second domain name) is less than 6, it is determined whether the domain name can be used to replace the domain name included in the URL address. For example, the domain name can be 159.14.189.30:30002.

[0078] If the count values ​​of all domain names in the domain name pool are 6, it indicates that the domain name included in the URL address cannot be replaced with the domain name in the domain name pool. In this case, the Web application can send a domain name pooling request to the server 12 again to obtain more domain names pointing to the video streaming service, and add these domain names to the domain name pool, so that the domain name included in the URL address can be replaced with the newly added domain name. Exemplarily, the number of newly added domain names is M, and 6M HTTP requests can be initiated using these domain names.

[0079] S308: The terminal device 11 sends an HTTP request to the first service based on the HTTP / 1.1 protocol and the new URL address to execute the first task.

[0080] In this step, the HTTP request includes three parts, namely, the request line, the request header, and the request body. The request line includes the URL address and the HTTP protocol version. In the embodiment of the present application, the first program sets the HTTP protocol version to the HTTP / 1.1 protocol, the URL address to the new URL address generated in the above steps, generates an HTTP request, and sends it to the first service to execute the first task.

[0081] Since the domain name pool includes N domain names, a maximum of 6N new URL addresses can be generated. Therefore, when the first program initiates an HTTP request based on the HTTP / 1.1 protocol and the new URL address and calls the first service, a maximum of 6N concurrent HTTP requests can be supported. Compared with the prior art that can only support 6 concurrent HTTP requests, the embodiment of the present application can solve the technical problem of HTTP request blocking.

[0082] In a specific implementation, the first program can send an HTTP request to the first service based on the HTTP / 1.1 protocol and the new URL address, and update the first count value. Then, it is determined whether the updated first count value is less than a preset threshold value (specifically 6). If the updated first count value is less than the preset threshold value, it indicates that the HTTP request can continue to be sent based on the first domain name and will not cause HTTP request blocking. Therefore, the first program can send an HTTP request to the first service again based on the HTTP / 1.1 protocol and the new URL address, and update the first count value.

[0083] In this way, when the first count value is less than 6, the first program can send one or more HTTP requests to the first service based on the HTTP / 1.1 protocol and the new URL address until the first count value reaches 6.

[0084] For example, using the previous example, the first task is to display the real-time monitoring videos of cameras 1 to 8, and the number of HTTP requests is 8, namely HTTP request 1 to HTTP request 8. The initial value of the first count value is 0. The first program can send HTTP request 1 to the first service based on the HTTP / 1.1 protocol and the new URL address, and update the first count value, so that the first count value changes from the initial value 0 to 1.

[0085] Then, the first program determines whether the updated first count value is less than 6. Since the updated first count value is 1, which is less than 6, the first program can send HTTP request 2 to the first service based on the HTTP / 1.1 protocol and the new URL address, and update the first count value again, so the first count value changes from 1 to 2.

[0086] By analogy, after the first program sends HTTP request 3 to the first service, the first count value changes from 2 to 3. After the first program sends HTTP request 4 to the first service, the first count value changes from 3 to 4. After the first program sends HTTP request 5 to the first service, the first count value changes from 4 to 5. After the first program sends HTTP request 6 to the first service, the first count value changes from 5 to 6.

[0087] Next, if the first program determines that the updated first count value is equal to 6, it indicates that if the first domain name is continued to be used to initiate a new HTTP request, HTTP request blocking will occur. Therefore, the first program can obtain another domain name in the domain name pool (recorded as the third domain name) and query the count value corresponding to the third domain name (recorded as the third count value). If the third count value is less than the preset threshold (specifically 6), it indicates that a new HTTP request can be generated using the third domain name, so the first domain name in the URL address is replaced with the third domain name to generate a new URL address (recorded as the first URL address). Then, based on the HTTP / 1.1 protocol and the first URL address, the first program sends an HTTP request to the first service again to continue executing the first task and update the third count value.

[0088] In this way, when the third count value is less than 6, the first program can send one or more HTTP requests to the first service based on the HTTP / 1.1 protocol and the first URL address.

[0089] Exemplarily, using the previous example, the initial value of the third count value is 0. The web application can determine that the third count value is less than 6, so the web application can replace the first domain name in the new URL address with the third domain name to generate the first URL address. Exemplarily, the first domain name can be 159.14.189.30:31000, and the third domain name can be 159.14.189.30:31007.

[0090] Then, the Web application may send an HTTP request 7 to the video streaming service based on the HTTP / 1.1 protocol and the first URL address, and update the third count value, so that the third count value changes from 0 to 1.

[0091] Next, the Web application determines whether the updated third count value is less than 6. Since the updated third count value is 1, which is less than 6, the Web application can send an HTTP request 8 to the video streaming service based on the HTTP / 1.1 protocol and the new URL address, and update the third count value again, and the third count value changes from 1 to 2.

[0092] After receiving HTTP request 1, the video streaming service can perform corresponding processing according to the request content and generate an HTTP response after the processing is completed. After receiving the HTTP response, the web application can perform relevant processing according to the content of the HTTP response to obtain the real-time monitoring video of camera 1. Similarly, the web application program can also obtain the real-time monitoring videos of cameras 2 to 8 in the same way. In this way, the web application can display the 8-channel real-time monitoring videos corresponding to cameras 1 to 8 on the display interface.

[0093] It can be understood that the number of HTTP requests being 8 is only an example. When the number of HTTP requests is other values, the implementation principle is the same as the above description and will not be described in detail here.

[0094] like Figure 5 As shown, an embodiment of the present application also provides a domain name pooling device, which is arranged in a server, and includes: a second receiving module 51, used to receive a domain name pooling request for a first service sent by a terminal device; a generating module 52, used to generate N domain names corresponding to the first service; wherein each of the domain names points to the first service; a creating module 53, used to create a domain name pool, and store the N domain names in the domain name pool; a second sending module 54, used to send the domain name pool to the terminal device.

[0095] like Figure 6 As shown, an embodiment of the present application also provides a service calling device, which is arranged in a terminal device, and includes: a first receiving module 55, used to receive request information for requesting the execution of a first task; the first task is a task for calling a first service; an acquisition module 56, used to obtain a domain name pool corresponding to the first service and a URL address corresponding to the first task; wherein the domain name pool includes N domain names, each domain name points to the first service; a replacement module 57, used to replace the domain name included in the URL address based on the domain name in the domain name pool to generate a new URL address; a first sending module 58, used to send an HTTP request to the first service based on the HTTP / 1.1 protocol and the new URL address to execute the first task.

[0096] like Figure 7 As shown, the present application also provides a terminal device, the terminal device includes a memory and a processor, the memory is used to store a computer program, when the computer program is executed by the processor, the service calling method as described above can be implemented, and the details can be referred to the description of the above embodiment. The terminal device is the terminal device 11 in the above embodiment.

[0097] Specifically, at the hardware level, the device may include a processor, an internal bus, and a memory. The memory may include a memory and a non-volatile memory. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it. It can be understood by those skilled in the art that Figure 7 The structure shown is only for illustration and does not limit the structure of the above device. Figure 7 More or fewer components shown in the figure may also include other processing hardware, such as a GPU (Graphics Processing Unit), or an external communication port, etc. Of course, in addition to the software implementation, this application does not exclude other implementations, such as logic devices or a combination of software and hardware, etc.

[0098] In this embodiment, the processor may include a central processing unit (CPU) or a graphics processing unit (GPU), and of course may also include other single-chip microcomputers, logic gate circuits, integrated circuits, etc. with logic processing capabilities, or appropriate combinations thereof. The memory described in this embodiment may be a memory device for storing information. In a digital system, a device that can store binary data may be a memory; in an integrated circuit, a circuit with a storage function without a physical form may also be a memory, such as a RAM, a FIFO, etc.; in a system, a storage device with a physical form may also be called a memory, etc. When implemented, the memory may also be implemented in the form of a cloud storage, and the specific implementation method is not limited in this specification.

[0099] It should be noted that the specific implementation of the server in this specification can refer to the description of the method implementation method, and will not be described in detail here.

[0100] The present application also provides a server. The specific structure of the server is the same as the specific structure of the terminal device in the above embodiment. For details, please refer to Figure 7 , which will not be described in detail here. The only difference is that when the computer program in the terminal device is executed by the processor, the aforementioned domain name pooling method is implemented instead of the service calling method. For details, please refer to the description of the aforementioned embodiment. The server is the server 12 in the aforementioned embodiment.

[0101] The present application also provides a service calling system, and the service calling system 1 may include the terminal device 11 in the aforementioned embodiment, and the server 12 in the aforementioned embodiment.

[0102] The present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, any one of the above-mentioned domain name pooling methods or any one of the above-mentioned service calling methods can be implemented.

[0103] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0104] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A service calling method, characterized in that: Applied to terminal equipment, including: Receive request information for executing a first task, wherein the first task is a task for invoking a first service; Obtain a domain name pool corresponding to the first service and a uniform resource locator URL address corresponding to the first task; wherein the domain name pool includes N domain names, each of which points to the first service; Based on the domain names in the domain name pool, the domain name included in the URL address is replaced to generate a new URL address; Based on the HTTP / 1.1 protocol and the new URL address, an HTTP request is sent to the first service to execute the first task.

2. The service calling method according to claim 1, characterized in that: The request information includes a classification identifier of the first service; The obtaining the domain name pool corresponding to the first service includes: According to the classification identifier of the first service and a preset mapping relationship, a domain name pool corresponding to the first service is obtained; wherein the mapping relationship is a mapping relationship between the classification identifier of the first service and the classification identifier of the domain name pool.

3. The service calling method according to claim 1, characterized in that: Before receiving request information for executing the first task, the method further includes: Sending a domain name pooling request for a first service to a server; the domain name pooling request includes an IP address of the first service; The domain name pool corresponding to the first service sent by the receiving server.

4. The service calling method according to claim 1, characterized in that: The replacing the domain name included in the URL address based on the domain name in the domain name pool to generate a new URL address includes: Obtaining a first domain name in the domain name pool; Querying a first count value corresponding to the first domain name; the first count value is used to indicate the number of HTTP requests currently occupying the first domain name; If the first count value is less than a preset threshold, the domain name included in the URL address is replaced with the first domain name to generate a new URL address.

5. The service calling method according to claim 4, characterized in that: The replacing the domain name included in the URL address based on the domain name in the domain name pool to generate a new URL address also includes: If the first count value is equal to the preset threshold, obtaining a second domain name in the domain name pool; Querying a second count value corresponding to the second domain name; the second count value is used to indicate the number of HTTP requests currently occupying the second domain name; If the second count value is smaller than the preset threshold, the domain name included in the URL address is replaced with the second domain name to generate a new URL address.

6. The service calling method according to claim 4, characterized in that: The sending an HTTP request to the first service based on the HTTP / 1.1 protocol and the new URL address to execute the first task includes: Based on the HTTP / 1.1 protocol and the new URL address, send an HTTP request to the first service, and update the first count value; Determining whether the updated first count value is less than the preset threshold; If the updated first count value is less than the preset threshold, based on the HTTP / 1.1 protocol and the new URL address, an HTTP request is sent to the first service again, and the first count value is updated.

7. The service calling method according to claim 6, characterized in that: The sending of an HTTP request to the first service based on the HTTP / 1.1 protocol and the new URL address to execute the first task further includes: If the updated first count value is equal to the preset threshold, obtaining a third domain name in the domain name pool; Querying a third count value corresponding to the third domain name; the third count value is used to indicate the number of HTTP requests currently occupying the third domain name; If the third count value is less than the preset threshold, replacing the first domain name with the third domain name to generate a first URL address; Based on the HTTP / 1.1 protocol and the first URL address, an HTTP request is sent to the first service again to execute the first task and update the third count value.

8. A domain name pooling method, characterized in that: Applicable to servers, including: Receiving a domain name pooling request for a first service sent by a terminal device; Generate N domain names corresponding to the first service; wherein each of the domain names points to the first service; Creating a domain name pool, and storing the N domain names in the domain name pool; Send the domain name pool to the terminal device.

9. The method according to claim 8, characterized in that The domain name pooling request includes the IP address of the first service; The generating N domain names corresponding to the first service includes: N port numbers are combined with the IP address of the first service to form N domain names, and a mapping relationship is established between the N domain names and the first service.

10. The method according to claim 8 or 9, characterized in that: The domain name pooling request includes a classification identifier of the first service; After creating the domain name pool and storing the N domain names in the domain name pool, the method further includes: Creating a classification identifier for the domain name pool; A mapping relationship between the classification identifier of the domain name pool and the classification identifier of the first service is established.

11. A service calling device, characterized in that: Set in the terminal device, including: A first receiving module is used to receive request information for requesting to execute a first task; the first task is a task for calling a first service; An acquisition module, used to acquire a domain name pool corresponding to the first service and a URL address corresponding to the first task; wherein the domain name pool includes N domain names, each of which points to the first service; A replacement module, used to replace the domain name included in the URL address based on the domain name in the domain name pool to generate a new URL address; The first sending module is used to send an HTTP request to the first service based on the HTTP / 1.1 protocol and the new URL address to execute the first task.

12. A domain name pooling device, characterized in that: Set on the server, including: A second receiving module, configured to receive a domain name pooling request for the first service sent by a terminal device; A generating module, configured to generate N domain names corresponding to the first service; wherein each of the domain names points to the first service; A creation module, used to create a domain name pool and store the N domain names in the domain name pool; The second sending module is used to send the domain name pool to the terminal device.

13. A terminal device, characterized in that: Used to execute the service calling method described in any one of claims 1 to 7.

14. A server, characterized in that: Used to execute the domain name pooling method described in any one of claims 7 to 10.

15. A service calling system, characterized in that: Includes the terminal device described in claim 13 and the server described in claim 14.

16. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the service calling method according to any one of claims 1 to 7 or the domain name pooling method according to any one of claims 8 to 10 is implemented.