Method for processing service request, vehicle and computer readable storage medium
By assigning a process ID to the downloader application in the vehicle and binding it to the network interface, the problem of incorrect use of the network card is solved, and flexible processing of requests and traffic in the vehicle and efficient and accurate use of the network interface are achieved.
Patent Information
- Application Number
- CN202310258893.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-16
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2043-03-16
AI Technical Summary
In the prior art, network cards in vehicles are prone to misuse when processing different types of traffic and requests, resulting in incorrect use of network interfaces and inefficient processing.
By creating multiple downloader applications and assigning a process ID to each downloader application and binding it to a specific network interface, the corresponding downloader application is called to process the business request based on the network interface ID and process ID in the business request, ensuring that the request and traffic are processed through the correct network interface.
This enables applications in the vehicle to flexibly process requests and traffic through different network interfaces, avoiding the situation where a single network interface handles multiple types of traffic, improving processing efficiency and accuracy, and ensuring the correct use of network interfaces.
Smart Images

Figure CN116319711B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of vehicle technology, and more specifically, to a method for processing a service request, a vehicle, and a computer-readable storage medium. Background Art
[0002] With the continuous upgrading of vehicle design, two or more network interface controllers (NICs) are usually installed in vehicles. One of the NICs is used to meet the needs of vehicle use, such as downloading vehicle system upgrade packages and vehicle firmware packages and other vehicle system resources, and the other NICs are used to meet the entertainment needs of users in the vehicle, such as downloading movies and browsing social networking sites and other entertainment resources.
[0003] In related technologies, an application's process ID can be bound to a specific network card or network interface, allowing traffic / requests from different types of applications to be handled by a specific network card. However, this can also lead to some applications requiring in-vehicle system resource downloads at one time and entertainment resources at another, potentially causing network card misuse. Summary of the Invention
[0004] The present application provides a method for processing a business request, a vehicle, and a computer-readable storage medium.
[0005] The service request processing method provided in this application is applied to a vehicle, wherein the vehicle includes at least two network interfaces, and different network interfaces are used to process requests and traffic of different service types. The method includes:
[0006] Create multiple downloader apps;
[0007] For each of the downloader applications, assign a process identifier to the downloader application, and bind the process identifier to one of the network interfaces, wherein the process identifiers of at least two of the downloader applications are bound to different network interfaces;
[0008] In response to a service request, based on the network interface identifier in the service request and the network interface bound to the process identifier of each downloader application, the corresponding downloader application is called to complete the service processing of the service request through the corresponding network interface.
[0009] In the method for processing business requests provided by the present application, multiple downloader applications are first created; then, for each downloader application, a process identifier is assigned to the downloader application, and the process identifier is bound to a network interface, so that each downloader application can be bound to each network interface; finally, when a business request is received, based on the network interface identifier in the business request and the network interface bound to the process identifier of each downloader application, the network interface that matches the network interface identifier in the business request is determined, and the downloader application corresponding to the process identifier bound to the matching network interface is determined, so that this downloader application completes the business processing of the business request through the bound network interface.
[0010] In this way, the present application enables applications in the vehicle to flexibly call different network interfaces through network interface identifiers to process their own requests and traffic; therefore, the present application also avoids the situation where one network interface may handle multiple types of traffic and requests due to the binding of the application's process number to the network port, thereby ensuring the correct use of the network interface.
[0011] The service request includes a data download service request, and the multiple downloader applications include a first downloader application and multiple second downloader applications;
[0012] The step of responding to the service request and calling the corresponding downloader application based on the network interface identifier in the service request and the network interface bound to the process identifier of each downloader application to complete the service processing of the service request through the corresponding network interface includes:
[0013] In response to the data download service request, performing interface identification identification on the data download service request based on the first downloader application;
[0014] If the network interface identifier is identified, determining a target network interface that matches the network interface identifier from all network interfaces bound to the second downloader application;
[0015] Among all the second downloader applications, one of the second downloader applications whose process identifier is bound to the target network interface is used as a first target downloader application;
[0016] The business processing of the data downloading business request is completed based on the network interface bound to the first target downloader application.
[0017] In this way, the implementation mode of the present application is based on the setting of the first downloader application and the second downloader application, so that each data download service request can be assigned to the correct first target downloader application, and avoids the situation where each downloader application needs to implement the network interface parsing function, thereby improving the processing efficiency of data download service requests and ensuring the processing accuracy of data download service requests.
[0018] Before completing the service processing of the data download service request based on the network interface bound to the first target downloader application, the method further includes:
[0019] If the network interface identifier is not recognized, the first downloader application is used as the first target downloader application.
[0020] In this way, the implementation method of the present application enables data download service requests that do not carry a network interface identifier to be effectively processed, thereby ensuring the robustness of the download function in the vehicle.
[0021] The method further comprises:
[0022] If the service corresponding to the data download service request is not processed within a preset time period, then using one of the second downloader applications other than the first target downloader application, the second downloader application whose process identifier is bound to the target network interface, as a new first target downloader application;
[0023] The business processing of the data downloading business request is completed based on the network interface bound to the new first target downloader application.
[0024] In this way, the implementation method of the present application enables the processing of data download service requests to be completed based on multiple downloader applications, reducing the probability of the first target downloader application running incorrectly due to an accident, thereby causing the failure of processing data download service requests, thereby ensuring the stable processing of data download service requests.
[0025] Each of the second downloader applications is configured with a corresponding priority;
[0026] If the service corresponding to the data download service request is not processed within a preset time period, using one of the second downloader applications other than the first target downloader application, the second downloader application whose process identifier is bound to the target network interface, as a new first target downloader application, including:
[0027] If the service corresponding to the data download service request is not processed within the preset time period, the second downloader application other than the first target downloader application, the second downloader with the highest priority and the process identifier bound to the target network interface, will be used as the new first target downloader application.
[0028] In this way, the implementation method of the present application ensures that if a data download service request is not processed within a preset time period, the data download service request will be processed based on the second downloader application with the highest priority, thereby increasing the probability that the data download service request will be processed normally and quickly.
[0029] The at least two network interfaces include a first network interface and a second network interface, the multiple downloader applications include a first downloader application and multiple second downloader applications, and the service request includes a non-data download service request;
[0030] Before, in response to the service request, calling the corresponding downloader application based on the network interface identifier in the service request and the network interface bound to the process identifier of each downloader application to complete the service processing of the service request through the corresponding network interface, the method further includes:
[0031] For each second downloader application, configure a corresponding proxy server for the second downloader application, and bind both the first network interface and the second network interface to the proxy server;
[0032] The step of responding to the service request and calling the corresponding downloader application based on the network interface identifier in the service request and the network interface bound to the process identifier of each downloader application to complete the service processing of the service request through the corresponding network interface includes:
[0033] In response to a non-data download service request, using one of the second downloader applications as a second target downloader application;
[0034] Determining a target proxy server corresponding to the second target downloader application;
[0035] Identifying, by the target proxy server, the first flow and the second flow corresponding to the non-data download service request;
[0036] The first traffic is processed based on the first network interface bound to the target proxy server, and the second traffic is processed based on the second network interface bound to the target proxy server.
[0037] In this way, when a business request corresponds to multiple types of traffic, the implementation method of the present application will complete the identification and division of the traffic based on the pre-configured proxy server in the second downloader application, and deliver different types of traffic to different types of network interfaces for processing, thereby ensuring the correct use of the network card.
[0038] The configuring a corresponding proxy server for each second downloader application and binding both the first network interface and the second network interface to the proxy server includes:
[0039] For each of the second downloader applications, binding the second downloader application to a port number;
[0040] Allocating each of the port numbers to one of the proxy servers, and binding both the first network interface and the second network interface to the proxy server;
[0041] The determining the target proxy server corresponding to the second target downloader application includes:
[0042] Among all the proxy servers, the proxy server bound to the port number bound to the second target downloader application is used as the target proxy server.
[0043] In this way, the embodiment of the present application implements the binding of the proxy server and the second downloader application through the port number, so that the second downloader application can accurately call the proxy server.
[0044] The method further comprises:
[0045] If the non-data download service request is not processed within a preset time period, selecting a second downloader application from other second downloader applications other than the second target downloader application as a new second target downloader application;
[0046] Based on the new second target downloader application, return to the step of determining the target proxy server corresponding to the second target downloader application.
[0047] In this way, this application allows non-data download service requests that are not processed normally due to unexpected errors to continue processing based on the newly selected second target downloader application, thereby increasing the probability of non-data download service requests being processed normally and ensuring the effective processing of non-data download service requests.
[0048] The present application also provides a vehicle, which includes a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the above-mentioned method for processing business requests is implemented.
[0049] The present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by one or more processors, the above-mentioned method for processing business requests is implemented.
[0050] In the vehicle and computer-readable storage medium provided by the present application, multiple downloader applications are first created; then, for each downloader application, a process identifier is assigned to the downloader application, and the process identifier is bound to a network interface, so that each downloader application can be bound to each network interface; finally, when a service request is received, based on the network interface identifier in the service request and the network interface bound to the process identifier of each downloader application, the network interface that matches the network interface identifier in the service request is determined, and the downloader application corresponding to the process identifier bound to the matching network interface is determined, so that this downloader application completes the service processing of the service request through the bound network interface.
[0051] In this way, the present application enables applications in the vehicle to flexibly call different network interfaces through network interface identifiers to process their own requests and traffic; therefore, the present application also avoids the situation where one network interface may handle multiple types of traffic and requests due to the binding of the application's process number to the network port, thereby ensuring the correct use of the network interface.
[0052] Additional aspects and advantages of the embodiments of the present application will be given in part in the description below, and in part will become obvious from the description below, or will be learned through practice of the embodiments of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0054] Figure 1 A flowchart of a method for processing a business request;
[0055] Figure 2 A flowchart of a method for processing a business request;
[0056] Figure 3 A flowchart of a method for processing a business request;
[0057] Figure 4 A flowchart of a method for processing a business request. DETAILED DESCRIPTION
[0058] The embodiments of the present application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals represent the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the embodiments of the present application, and should not be understood as limiting the embodiments of the present application.
[0059] In order to more clearly illustrate the various embodiments provided in this application, a brief description of the relevant technologies is given here, as follows:
[0060] With the continuous upgrading of vehicle design, two or more network interface controllers (NICs) are usually installed in vehicles. One of the NICs is used to meet the needs of vehicle use, such as downloading vehicle system upgrade packages and vehicle firmware packages and other vehicle system resources, and the other NICs are used to meet the entertainment needs of users in the vehicle, such as downloading movies and browsing social networking sites and other entertainment resources.
[0061] It is not difficult to understand that due to differences in data transmission speeds, billing rules, supported bus types, and other factors of different network cards, different network cards are often set to handle different types of traffic / requests, such as the network card used to download in-vehicle system resources and the network card used to download entertainment resources in the above content.
[0062] Furthermore, to ensure that a network card can only handle a specific type of traffic / request, the application's process ID can be bound to a specific network card / network interface. For example, the process ID (ProcessIdentification) of a gaming application can be bound to the entertainment resource network card (i.e., the network card used to download entertainment resources). Consequently, when a gaming application is launched, the gaming application's traffic and requests will be handled by the entertainment resource network card, thus enabling a single network card to handle a single type of traffic and request.
[0063] However, some applications need to download in-vehicle system resources at one time and entertainment resources at another time. For example, for in-vehicle system theme applications, if the in-vehicle system-related applications are bound to the system resource network card (i.e., the network card used to download in-vehicle system resources), when the in-vehicle system performs a system upgrade data package, the system resource network card will correctly handle the relevant requests and traffic of the system upgrade data package; and when the user wants to download wallpaper images, icon styles, startup music and other self-selected resources through the in-vehicle system-related applications, these self-selected resources should be classified as entertainment resources or non-in-vehicle system resources, but these self-selected resources will still complete the traffic and request processing through the system resource network card. In other words, there are cases where the network card is used incorrectly.
[0064] See also Figure 1 , Figure 1 This is a flow chart of the method for processing business requests of the present application, that is, the present application provides a method for processing business requests, which is applied to a vehicle, and the vehicle includes at least two network interfaces, and different network interfaces are used to process requests and traffic of different business types.
[0065] That is, the vehicle in the implementation mode of the present application will be installed with two or more network cards, and different network cards will be called through different network interfaces to process requests and traffic of different business types after being called.
[0066] It is readily understood that the relationship between each network card / network interface and requests and traffic of different service types in the embodiments of the present application can be configured based on actual circumstances. For example, a vehicle may include an entertainment resource network interface for downloading entertainment resources and a system resource network interface for downloading system resources. Furthermore, requests and traffic related to entertainment resources are processed by the entertainment resource network interface, while requests and traffic related to system resources are processed by the system resource network interface.
[0067] Based on the above settings, the method for processing a service request provided in the embodiments of this application includes:
[0068] 0110, Create multiple downloader applications.
[0069] It is easy to understand that in the related art, after the vehicle system is running, usually only one downloader application is started and running. However, in the embodiment of the present application, after the vehicle system is running, multiple downloader applications will be started / run / created, and different downloader applications are used to call different network interfaces.
[0070] It is understood that the number of downloader applications created can be set based on actual circumstances. For example, in some embodiments, because the vehicle has two network interfaces, the present application will create two downloader applications to respectively call the two network interfaces. In other embodiments, to process high-concurrency requests, when there are only two network interfaces in the vehicle, six downloader applications are created to collaboratively process high-concurrency requests.
[0071] It is also understood that the relationship between the various downloader applications created can also be set according to actual circumstances. For example, the multiple downloader applications created in this application may include a master node downloader application and multiple slave node downloader applications. After receiving requests and traffic, the master node downloader application will forward the requests and traffic to the corresponding one or more slave node downloader applications according to preset routing rules.
[0072] 0120. For each downloader application, assign a process ID to the downloader application and bind the process ID to a network interface, wherein the process IDs of at least two downloader applications are bound to different network interfaces.
[0073] That is, the embodiments of this application assign a different process ID to each downloader application, so that each downloader application can be called through its corresponding process ID. At the same time, the embodiments of this application also bind the process ID of each downloader application to each network interface. Thus, different downloader applications can be associated with different network interfaces through the process ID. It is easy to understand that each downloader application can be regarded as a dedicated calling channel for the network interface to which its process ID is bound.
[0074] It should be noted that although the process identifier in the implementation manner of the present application can represent the process run by the downloader application, it is not equivalent to the process number (Process Identification) and can be regarded as the user number (User Identification).
[0075] It should also be noted that the process identifier in the implementation mode of the present application is actually bound to the network interface identifier of the network interface. In other words, each downloader application binds itself to the network interface through the process identifier and the network interface identifier.
[0076] 0130. In response to the service request, based on the network interface identifier in the service request and the network interface bound to the process identifier of each downloader application, the corresponding downloader application is called to complete the service processing of the service request through the corresponding network interface.
[0077] That is, when an application needs to perform services such as adding, deleting, modifying, or other downloading services and generates corresponding service requests, it needs to specify which network interface it will use to complete the service processing. In other words, the service request generated by the application needs to include a network interface identifier to indicate the network interface corresponding to its own service.
[0078] Then, the vehicle of the method described in the present application will determine the network interface that matches the network interface identifier in the service request from the network interface identifiers of each network interface of the vehicle based on the network interface identifier in the service request.
[0079] Subsequently, since each network interface is bound to the process identifier of a downloader application, the vehicle of the implementation mode of the present application will determine the process identifier bound to it based on the above-mentioned matched network interface, and then obtain the downloader application corresponding to this process identifier, and use this downloader application as the downloader application corresponding to the business request.
[0080] Finally, the corresponding downloader application calls the network interface bound to its own process identifier, thereby completing the business processing corresponding to the business request.
[0081] Therefore, when certain applications need to process their own requests and traffic through one network interface at a certain moment, and need to process their own requests and traffic through another network interface at another moment, business requests containing different network interface identifiers can be generated at different moments, and then at different moments, the vehicle of the implementation mode of the present application will call different downloader applications so that the network interface specified by the business request completes the corresponding business processing.
[0082] In this way, the implementation method of the present application enables applications in the vehicle to flexibly process their own requests and traffic through different network interfaces; therefore, the implementation method of the present application also avoids the situation where one network interface may process multiple types of traffic and requests due to the binding of the application's process number to the network port, thereby ensuring the correct use of the network interface.
[0083] Optional, please refer to Figure 2 , Figure 2 A flowchart of a method for processing a service request, that is, the service request includes a data download service request, and the multiple downloader applications include a first downloader application and multiple second downloader applications;
[0084] Furthermore, the above 0130 includes:
[0085] 0131, in response to a data download service request, performing interface identification identification on the data download service request based on the first downloader application;
[0086] 0132. If the network interface identifier is identified, determine a target network interface that matches the network interface identifier from all network interfaces bound to the second downloader application;
[0087] 0133, among all the second downloader applications, a second downloader whose process identifier is bound to the target network interface is used as the first target downloader application;
[0088] 0134. Complete the business processing of the data downloading business request based on the network interface bound to the first target downloader application.
[0089] It should be noted that the first downloader application in the embodiment of the present application is mainly used to forward data download service requests. That is, the first downloader application is used to parse the data download service requests, thereby identifying the network interface identifier in the data download service requests, and determining the identifier that matches the above-identified network interface identifier from all network interface identifiers, and then obtaining the network interface corresponding to this identifier, that is, the target network interface. Moreover, after determining the target network interface, the first downloader application will use the second downloader application corresponding to the process identifier bound to the target network interface as the first target downloader, so that the first downloader application can complete the business processing of the data download service requests based on the target network interface bound to itself.
[0090] Furthermore, in the embodiments of the present application, the second downloader application is configured to, upon receiving a data download service request forwarded by the first downloader application, complete the data download service corresponding to the data download service request through itself and its bound network interface. It is readily understood that the first downloader application and each second downloader application can be considered a cluster, with the first downloader application being the master node in the cluster and each second downloader application being a slave node in the cluster.
[0091] Optionally, when developers of other applications installed in the vehicle write code, they usually implement the download function of the application based on the standard downloader call interface. In other words, the application will call the native / standard downloader application in the vehicle system through the standard downloader call interface. Therefore, the first downloader application can be the native downloader application of the vehicle system, and the second downloader application can be the downloader application generated by derivation and / or instantiation in the implementation method of this application. Therefore, other applications can directly use the service request processing method provided by this application without the need for corresponding adaptation processing, eliminating the adaptation cost and ensuring the input-output ratio.
[0092] It should also be noted that the data download service request in the implementation manner of this application refers to a service request for downloading specific files / data, such as downloading movies, music, font style resource packages, vehicle firmware upgrade packages, vehicle system upgrade packages and other data.
[0093] Furthermore, in the process of processing data download service requests in the embodiments of the present application, the vehicle will download one or more files / data of the same type / purpose from one or more network addresses. For example, based on a data download service request, multiple movie files are downloaded from multiple network addresses (i.e., distributed downloads). The downloaded movie files are used to integrate into a complete movie. The purpose of this movie and the above-mentioned multiple movie files is to "meet the user's entertainment needs." For another example, after downloading a vehicle firmware upgrade package from a network address, the vehicle firmware upgrade package is used to upgrade the firmware in the vehicle, that is, to "meet the vehicle's usage needs."
[0094] It is not difficult to imagine that one or more download files corresponding to a data download service request can all be downloaded through a network interface. Therefore, in the embodiment of the present application, for data download service requests, the first downloader will identify the network interface identifier in the data download service request, and forward the data download service request to the corresponding second downloader application (i.e., the first target downloader application) based on the identified network interface identifier, so that the second downloader application can complete the data download service through a network interface bound to itself.
[0095] In this way, the implementation mode of the present application is based on the setting of the first downloader application and the second downloader application, so that each data download service request can be assigned to the correct first target downloader application, and avoids the situation where each downloader application needs to implement the network interface parsing function, thereby improving the processing efficiency of data download service requests and ensuring the processing accuracy of data download service requests.
[0096] Optionally, to ensure effective processing of data download service requests, before step 0134, the method provided by this application further includes:
[0097] If the network interface identifier is not recognized, the first downloader application is used as the first target downloader application.
[0098] That is, for special data download service requests, that is, data download service requests that do not carry a network interface identifier, the implementation method of the present application sets up a corresponding processing method to ensure that data download service requests will be processed accordingly regardless of whether they carry a network interface identifier.
[0099] Specifically, when the first downloader application parses a data download service request but, after parsing, does not find a network interface identifier in the data download service request, or in other words, the parameter value corresponding to the network interface identifier is NULL, the embodiment of the present application will assume that the target network interface corresponding to the data download service request is the same as the network interface bound to the first downloader application. That is, when the network interface identifier is not carried, the data download service request is processed by the first downloader application by default. Furthermore, the first downloader application will identify itself as the first target downloader application corresponding to the data download service request and complete the corresponding data download based on the network interface bound to its own process identifier.
[0100] In this way, the implementation method of the present application enables data download service requests that do not carry a network interface identifier to be effectively processed, thereby ensuring the robustness of the download function in the vehicle.
[0101] Optional: To resolve unexpected situations that may cause business request processing failure or delay, please refer to Figure 3 , Figure 3 This is a flow chart of the method for processing the business request of this application. That is, the method for processing the business request provided by this application also includes:
[0102] 0140, if the service corresponding to the data download service request is not processed within the preset time period, then use a second downloader application other than the first target downloader application, whose process identifier is bound to the target network interface, as the new first target downloader application;
[0103] 0150. Complete the business processing of the data downloading business request based on the network interface bound to the new first target downloader application.
[0104] It is understood that in related technologies, after a service request is normally processed, a processing completion message is typically fed back to the request initiator. Therefore, in the embodiments of the present application, after sending a data download service request to the first target downloader application, the processing completion message corresponding to the data download service request is continuously detected. If a processing completion message is detected within a preset time period, it indicates that the data download service request was processed normally. If no processing completion message is detected within the preset time period, it indicates that the data download service request was not processed normally due to an unexpected error.
[0105] To address this situation, the embodiments of this application provide a corresponding remedial solution. Specifically, if a data download service request is not processed within a preset time period, the vehicle will select a second downloader application from among other second downloader applications other than the first target downloader application and use the selected second downloader application as the new first target downloader application. The new first target downloader application will then be used to process the previously unprocessed data download service request.
[0106] It is not difficult to understand that if the newly selected first target downloader application still cannot process data download service requests normally, that is, the data download service requests are still not processed within the new preset time period, then the implementation method of the present application will select a new second downloader application from other second downloader applications other than the first target downloader applications selected in the first two times as the new first target downloader.
[0107] In this way, the implementation method of the present application enables the processing of data download service requests to be completed based on multiple downloader applications, reducing the probability of the first target downloader application running incorrectly due to an accident, thereby causing the failure of processing data download service requests, thereby ensuring the stable processing of data download service requests.
[0108] In addition, it can be understood that the preset duration in the implementation manner of the present application is content that can be set according to actual conditions. For example, the preset duration is 1 minute, or the preset duration is 2 minutes.
[0109] Optionally, to further improve the efficiency of data download service requests, if a data download service request remains unprocessed within a preset time period, a downloader application other than the first target downloader application may be selected as the new first target downloader application. This means that network interface inconsistencies are no longer considered, with "prioritized service request completion" being the prerequisite.
[0110] Optionally, to avoid excessive consumption of system resources, if a data downloading service request has not completed the corresponding business processing within a long period of time, such as 3 minutes or 5 minutes, a request processing failure message will be sent directly to the initiator of the data downloading service request, and the relevant operations of this data downloading service request will be terminated.
[0111] Optionally, in order to quickly process data download service requests, each second downloader application is configured with a corresponding priority;
[0112] Furthermore, if the service corresponding to the data download service request is not processed within the preset time period, a second downloader application other than the first target downloader application, whose process identifier is bound to the target network interface, is used as a new first target downloader application, including:
[0113] If the service corresponding to the data download service request is not processed within the preset time period, the second downloader application with the highest priority and the process identifier bound to the target network interface among other second downloader applications outside the first target downloader application will be used as the new first target downloader application.
[0114] That is, the new first target downloader application will be selected / selected based on the priority, and the higher the priority, the more likely it is to be selected as the new first target downloader application.
[0115] It should be understood that in the embodiments of the present application, the priority can reflect the processing efficiency of the second downloader application to a certain extent. The higher the priority, the more computing resources and / or bandwidth resources the second downloader application occupies, and therefore the higher the processing efficiency of the second downloader application.
[0116] In this way, the implementation method of the present application ensures that if a data download service request is not processed within a preset time period, the data download service request will be processed based on the second downloader application with the highest priority, thereby increasing the probability that the data download service request will be processed normally and quickly.
[0117] Optionally, to further improve the processing efficiency of data download service requests, the first allocation of a first target downloader application for a data download service request will also be done based on priority. That is, the first downloader application will select the second downloader application with the highest priority from all second downloader applications, and whose process ID is bound to the target interface ID, as the first target downloader application.
[0118] In addition, it can be understood that any downloader application can only process a preset number of requests at the same time. Therefore, when the second downloader with the highest priority is already processing a preset number of requests, that is, the second downloader application is fully loaded, the implementation method of the present application will traverse each second downloader application in order of priority and load conditions to select a second downloader application with high priority and not fully loaded as the first target downloader application.
[0119] Optional, because some application business requests need to use two or more network interfaces to complete the processing, that is, the application business requests correspond to two or more types of traffic. In this case, the second downloader / first downloader bound to a single network interface may not be able to complete the request and traffic processing well. To solve the above problem, please refer to Figure 4 , Figure 4 Specifically, the at least two network interfaces include a first network interface and a second network interface, the multiple downloader applications include a first downloader application and multiple second downloader applications, and the service request includes a non-data download service request.
[0120] Furthermore, before the above 0130, the service request processing method provided by this application also includes:
[0121] 0160. For each second downloader application, configure a corresponding proxy server for the second downloader application, and bind both the first network interface and the second network interface to the proxy server.
[0122] Furthermore, the above 0130 includes:
[0123] 0135, in response to a non-data download service request, using one of all second downloader applications as a second target downloader application;
[0124] 0136, determining a target proxy server corresponding to the second target downloader application;
[0125] 0137, using the target proxy server to identify the first flow and the second flow corresponding to the non-data download service request;
[0126] 0138. Process the first traffic based on the first network interface bound to the target proxy server, and process the second traffic based on the second network interface bound to the target proxy server.
[0127] It should be noted that non-data download service requests refer to service requests that are not solely for downloading files or data. For example, requests related to browsing a webpage may include downloading and uploading resources, but when the webpage is closed, the previously downloaded resources will be deleted. Furthermore, non-data download service requests may require data to be obtained from different network interfaces, such as obtaining vehicle-related data from the system resource network interface and advertising-related data from the entertainment resource network interface, so that both vehicle-related content and advertising content can be displayed on the webpage.
[0128] To address this situation, the present application pre-configures a proxy server in each second downloader. Then, when the second downloader application needs to perform business processing, that is, when the second downloader application is selected as the second target downloader application, the proxy server bound to the second target downloader application through the port number will complete the uploading and downloading of relevant data.
[0129] Furthermore, since the proxy server in the embodiment of the present application is also bound to a first network interface and a second network interface, and the proxy server is also used to identify and divide different types of traffic corresponding to non-data download service requests, after the proxy server identifies the first traffic and second traffic corresponding to the non-data download service requests, it will complete the processing of the first traffic based on the first network interface bound to itself, and complete the processing of the second traffic based on the second network interface bound to itself.
[0130] It is understandable that the second downloader application in this application is actually bound to multiple network interfaces through a proxy server.
[0131] In addition, it should be understood that because the configuration of the proxy server for the native downloader application of the vehicle system is relatively complicated, in the implementation mode of the present application, the proxy server is only configured and applied to the second downloader application, that is, the new downloader application derived from the native downloader application / first downloader application, thereby reducing the difficulty of configuring and using the downloader application.
[0132] In addition, it is not difficult to understand that if the vehicle is equipped with a third network interface, and the non-data download service request includes a third flow, and the third flow needs to be processed through the third network interface, the proxy server will identify the first flow, the second flow and the third flow in the non-data download service request to complete the corresponding processing through the first network interface, the second network interface and the third network interface.
[0133] In addition, the first traffic may be system resource related traffic, the second traffic may be entertainment resource related traffic, the first network interface may be a system resource network interface, and the second network interface may be an entertainment resource network interface.
[0134] In this way, when a business request corresponds to multiple types of traffic, the implementation method of the present application will complete the identification and division of the traffic based on the pre-configured proxy server in the second downloader application, and deliver different types of traffic to different types of network interfaces for processing, thereby ensuring the correct use of the network card.
[0135] Optionally, the above 0160 includes:
[0136] For each second downloader application, binding the second downloader application to a port number;
[0137] Each port number is respectively assigned to a proxy server, and the first network interface and the second network interface are both bound to the proxy server.
[0138] Furthermore, the above 0136 includes:
[0139] Among all proxy servers, the proxy server bound to the port number bound to the second target downloader application is used as the target proxy server.
[0140] That is, the embodiment of the present application will use the port number of the proxy server to implement the binding of the proxy server and the second downloader, and then the second downloader will call the proxy server bound to itself through the port to complete the processing of the service request.
[0141] Specifically, the port number bound to the second downloader indicates that the second downloader will receive and upload data through the port-mapped network interface. When the port is bound to a proxy server, the second downloader will receive and upload data from multiple network interfaces bound to the proxy server. Furthermore, because the proxy server identifies and divides the traffic corresponding to non-data download service requests, different network interfaces will process different traffic and return different data.
[0142] In this way, the implementation method of the present application is based on the port number, so that the second target downloader application can accurately call the proxy server.
[0143] Optionally, the service request processing method provided by this application also includes:
[0144] If the non-data download service request is not processed within the preset time period, a second downloader application is selected from other second downloader applications outside the second target downloader application as a new second target downloader application;
[0145] Based on the new second target downloader application, return to the step of determining the target proxy server corresponding to the second target downloader application.
[0146] That is, similar to the completion timeout processing flow of the aforementioned data downloading requests, the implementation mode of the present application also provides a corresponding timeout processing flow for non-data downloading service requests, that is, when the completion feedback information of the non-data downloading service request is not detected within the preset time length, the implementation mode of the present application will again select a new second target downloader application to complete the previously unprocessed non-data downloading service request.
[0147] In this way, this application allows non-data download service requests that are not processed normally due to unexpected errors to continue to be processed based on the newly selected second target downloader application, thereby increasing the probability of non-data download service requests being processed normally and ensuring the effective processing of non-data download service requests.
[0148] In addition, the selection process of the second target downloader application and the new second target downloader application may also adopt a priority, that is, the higher the priority, the more likely the second downloader application is to be selected as the second target downloader application and / or the new second target downloader application. For specific details, please refer to the above content related to the first target downloader application and will not be repeated here.
[0149] An embodiment of the present application also provides a vehicle, which includes a memory and a processor. The memory stores a computer program, and when the computer program is executed by the processor, the above-mentioned method for processing business requests is implemented.
[0150] The embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by one or more processors, the method for processing the above-mentioned business request is implemented.
[0151] In the vehicle and computer-readable storage medium provided by the present application, multiple downloader applications are first created; then, for each downloader application, a process identifier is assigned to the downloader application, and the process identifier is bound to a network interface, so that each downloader application can be bound to each network interface; finally, when a service request is received, based on the network interface identifier in the service request and the network interface bound to the process identifier of each downloader application, the network interface that matches the network interface identifier in the service request is determined, and the downloader application corresponding to the process identifier bound to the matching network interface is determined, so that this downloader application completes the service processing of the service request through the bound network interface.
[0152] In this way, the present application enables applications in the vehicle to flexibly call different network interfaces through network interface identifiers to process their own requests and traffic; therefore, the present application also avoids the situation where one network interface may handle multiple types of traffic and requests due to the binding of the application's process number to the network port, thereby ensuring the correct use of the network interface.
[0153] In the description of this specification, the descriptions with reference to the terms "in an example", "exemplarily", etc. mean that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, unless they are contradictory.
[0154] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code comprising one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may be performed out of the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present application belong.
[0155] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations on the present application. Ordinary technicians in this field can change, modify, replace and modify the above embodiments within the scope of the present application.
Claims
1. A method for processing a service request, characterized in that: Applied to a vehicle, the vehicle includes at least two network interfaces, different network interfaces are used to process requests and traffic of different business types, the at least two network interfaces include a first network interface and a second network interface, and the method includes: creating a plurality of downloader applications, wherein the plurality of downloader applications includes a first downloader application and a plurality of second downloader applications; For each of the downloader applications, assign a process identifier to the downloader application, and bind the process identifier to one of the network interfaces, wherein the process identifiers of at least two of the downloader applications are bound to different network interfaces; For each of the second downloader applications, binding the second downloader application to a port number; Allocating each of the port numbers to a proxy server, and binding both the first network interface and the second network interface to the proxy server; In response to a service request, based on the network interface identifier in the service request and the network interface bound to the process identifier of each downloader application, calling the corresponding downloader application to complete the service processing of the service request through the corresponding network interface, wherein the service request includes a non-data download service request; The step of responding to the service request and calling the corresponding downloader application based on the network interface identifier in the service request and the network interface bound to the process identifier of each downloader application to complete the service processing of the service request through the corresponding network interface includes: In response to a non-data download service request, using one of the second downloader applications as a second target downloader application; The proxy server bound to the port number bound to the second target downloader application among all the proxy servers is used as the target proxy server; Identifying, by the target proxy server, the first flow and the second flow corresponding to the non-data download service request; The first traffic is processed based on the first network interface bound to the target proxy server, and the second traffic is processed based on the second network interface bound to the target proxy server.
2. The method for processing a service request according to claim 1, wherein: The service request includes a data download service request, and the multiple downloader applications include a first downloader application and multiple second downloader applications; The step of responding to the service request and calling the corresponding downloader application based on the network interface identifier in the service request and the network interface bound to the process identifier of each downloader application to complete the service processing of the service request through the corresponding network interface includes: In response to the data download service request, performing interface identification identification on the data download service request based on the first downloader application; If the network interface identifier is identified, determining a target network interface that matches the network interface identifier from all network interfaces bound to the second downloader application; Among all the second downloader applications, one of the second downloader applications whose process identifier is bound to the target network interface is used as a first target downloader application; The business processing of the data downloading business request is completed based on the network interface bound to the first target downloader application.
3. The method for processing a service request according to claim 2, wherein: Before completing the service processing of the data download service request based on the network interface bound to the first target downloader application, the method further includes: If the network interface identifier is not recognized, the first downloader application is used as the first target downloader application.
4. The method for processing a service request according to claim 2, wherein: The method further comprises: If the service corresponding to the data download service request is not processed within a preset time period, then using one of the second downloader applications other than the first target downloader application, the second downloader application whose process identifier is bound to the target network interface, as a new first target downloader application; The business processing of the data downloading business request is completed based on the network interface bound to the new first target downloader application.
5. The method for processing a service request according to claim 4, wherein: Each of the second downloader applications is configured with a corresponding priority; If the service corresponding to the data download service request is not processed within a preset time period, using one of the second downloader applications other than the first target downloader application, the second downloader application whose process identifier is bound to the target network interface, as a new first target downloader application, including: If the service corresponding to the data download service request is not processed within the preset time period, the second downloader application other than the first target downloader application, the second downloader with the highest priority and the process identifier bound to the target network interface, will be used as the new first target downloader application.
6. The method for processing a service request according to claim 1, wherein: The method further comprises: If the non-data download service request is not processed within a preset time period, selecting a second downloader application from other second downloader applications other than the second target downloader application as a new second target downloader application; Based on the new second target downloader application, return to the step of taking the proxy server bound to the port number bound to the second target downloader application among all the proxy servers as the target proxy server.
7. A vehicle, characterized in that: The vehicle includes a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the method for processing a business request according to any one of claims 1 to 6 is implemented.
8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by one or more processors, the method for processing a service request according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Method and device for controlling message processing threads
CN104572290A
Network interface management method and system, and network interface management server
CN105007192A