Data processing method, device and equipment

By setting up a first process with gateway function in the terminal device and sending a request message directly to the target service instance, the communication delay and low reliability caused by limited resources of the gateway cluster are solved, and the reliability and efficiency of network data transmission are improved.

CN113783914BActive Publication Date: 2025-01-10BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202010903498.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-01
Publication Date
2025-01-10
Estimated Expiration
2040-09-01

AI Technical Summary

Technical Problem

When existing gateway clusters process large number of terminal device requests, limited resources lead to low communication delay and reliability, and cannot effectively handle highly concurrent network data transmission.

Method used

The first process of installing an application in a terminal device, which has the gateway function. Through the first process, it generates and sends request messages directly to the target service instance, avoiding relying on a centralized gateway cluster, and implementing network address translation to adapt to different protocol.

Benefits of technology

It improves the reliability and efficiency of network data transmission, can process request messages stably under high concurrency, and reduces the risk of delay and interruption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113783914B_ABST
    Figure CN113783914B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a data processing method, device and equipment, the method comprising: a terminal device generates a first request message corresponding to a first service, the first service being any service in an application; the terminal device determines the address information of a target service instance corresponding to the first service through a first process; the terminal device sends the first request message to the target service instance through the first process according to the address information of the target service instance. The reliability of network data transmission is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of electronic communication technology, and in particular, to a data processing method, device and equipment. Background Art

[0002] Network data forwarding is a common network communication method. When the two parties cannot communicate directly in a point-to-point manner, for example, when the terminal device only supports the HTTP protocol and the server only receives a certain private protocol, a gateway needs to be added between the terminal device and the server. The gateway can first receive the request message of the terminal device according to the HTTP protocol, and then send the request message to the server according to the corresponding private protocol, thereby completing the network communication.

[0003] In the prior art, for the needs of high availability and performance expansion, gateways usually appear in the form of clusters, that is, multiple gateways are deployed to jointly process network communications between terminal devices and servers. Any gateway in the gateway cluster can receive different request messages from multiple terminal devices and send the request messages to the corresponding servers respectively.

[0004] However, each gateway has limited resources (for example, memory, network card, central processing unit, etc.). When multiple terminal devices send many request messages at the same time, it exceeds the processing capacity of the gateway, resulting in communication delays or even interruptions between some terminal devices and the server, and low reliability of network data transmission. Summary of the invention

[0005] The embodiments of the present application provide a data processing method, apparatus and device, which improve the reliability of network data transmission.

[0006] In a first aspect, an embodiment of the present application provides a data processing method, including:

[0007] The terminal device generates a first request message corresponding to a first service, where the first service is any service in the application;

[0008] The terminal device determines, through a first process, address information of a target service instance corresponding to the first service;

[0009] The terminal device sends the first request message to the target service instance through the first process according to the address information of the target service instance.

[0010] In a possible implementation manner, the terminal device determines, through the first process, address information of a target service instance corresponding to the first service, including:

[0011] The terminal device obtains a service instance list corresponding to the application, wherein the service instance list includes identifiers of multiple services included in the application, at least one service instance corresponding to each service, and address information of each service instance;

[0012] The terminal device determines the address information of the target service instance corresponding to the first service in the service instance list.

[0013] In a possible implementation, the terminal device obtains a service instance list corresponding to the application, including:

[0014] The terminal device sends a second request message to the first server, where the second request message includes an identifier of the application;

[0015] The terminal device receives the service instance list sent by the first server.

[0016] In a possible implementation manner, the terminal device determines, in the service instance list, address information of a target service instance corresponding to the first service, including:

[0017] The terminal device obtains at least one service instance corresponding to the first service in the service instance list;

[0018] The terminal device determines the target service instance from at least one service instance corresponding to the first service;

[0019] The terminal device obtains the address information corresponding to the target service instance in the service instance list.

[0020] In a possible implementation, the terminal device obtains a service instance list corresponding to the application, including:

[0021] The terminal device obtains a configuration file;

[0022] The terminal device obtains a preset identifier in the configuration file;

[0023] The terminal device obtains a service instance list corresponding to a corresponding version according to a preset identifier in the configuration file.

[0024] In a possible implementation, the terminal device obtains a service instance list corresponding to the application, including:

[0025] The terminal device obtains a configuration file;

[0026] The terminal device obtains a version parameter in the configuration file;

[0027] The terminal device obtains a service instance list corresponding to a corresponding version according to the version parameter in the configuration file.

[0028] In a possible implementation manner, the terminal device sending the first request message to the target service instance through the first process according to the address information of the target service instance includes:

[0029] The terminal device performs network address translation NAT on the first request message to redirect the request message to the first process;

[0030] The terminal device sends the first request message to the target service instance through the first process according to the address information of the target service instance.

[0031] In a possible implementation, the method further includes:

[0032] The terminal device downloads a file package corresponding to the application, wherein the file package includes process information of the first process, wherein the first process is run when the application is started.

[0033] In a possible implementation manner, after the terminal device sends the first request message to the target service instance through the first process according to the address information of the target service instance, the method further includes:

[0034] The terminal device receives a response message corresponding to the first request message through the first process.

[0035] In a second aspect, an embodiment of the present application provides a data processing device, including:

[0036] A generating module, configured to generate a first request message corresponding to a first service, where the first service is any service in an application;

[0037] A determination module, configured to determine address information of a target service instance corresponding to the first service through a first process;

[0038] A sending module is used to send the first request message to the target service instance through the first process according to the address information of the target service instance.

[0039] In a possible implementation manner, the determining module is specifically configured to:

[0040] Obtaining a service instance list corresponding to the application, wherein the service instance list includes identifiers of multiple services included in the application, at least one service instance corresponding to each service, and address information of each service instance;

[0041] Determine the address information of the target service instance corresponding to the first service in the service instance list.

[0042] In a possible implementation manner, the determining module is specifically configured to:

[0043] Sending a second request message to the first server, where the second request message includes an identifier of the application;

[0044] Receive the service instance list sent by the first server.

[0045] In a possible implementation manner, the determining module is specifically configured to:

[0046] Acquire at least one service instance corresponding to the first service in the service instance list;

[0047] Determine the target service instance in at least one service instance corresponding to the first service;

[0048] Acquire the address information corresponding to the target service instance in the service instance list.

[0049] In a possible implementation manner, the determining module is specifically configured to:

[0050] Get the configuration file;

[0051] Obtaining a preset identifier in the configuration file;

[0052] The service instance list corresponding to the corresponding version is obtained according to the preset identifier in the configuration file.

[0053] In a possible implementation manner, the determining module is specifically configured to:

[0054] Get the configuration file;

[0055] Obtaining the version parameter in the configuration file;

[0056] Obtain a list of service instances corresponding to the corresponding version according to the version parameter in the configuration file.

[0057] In a possible implementation manner, the sending module is specifically configured to:

[0058] Performing network address translation (NAT) on the first request message to redirect the request message to the first process;

[0059] The first request message is sent to the target service instance through the first process according to the address information of the target service instance.

[0060] In a possible implementation, the device further includes:

[0061] A download module is used to download a file package corresponding to the application, wherein the file package includes process information of the first process, wherein the first process is run when the application is started.

[0062] In a possible implementation, the device further includes:

[0063] A receiving module is used to receive a response message corresponding to the first request message through the first process.

[0064] In a third aspect, an embodiment of the present application provides a data processing device, including: at least one processor and a memory;

[0065] The memory is used to store computer program instructions;

[0066] The at least one processor is used to execute computer program instructions stored in the memory, so that the terminal device executes the data processing method described in any one of the first aspects above.

[0067] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer program instructions. When a processor executes the computer program instructions, the data processing method as described in any one of the above-mentioned first aspects is executed.

[0068] The embodiment of the present application provides a data processing method, device and equipment, wherein an application is installed in a terminal device, and a first process is set in the application, and the first process has the function of a gateway, so that when the terminal device needs to access a service, the terminal device generates a first request message corresponding to the first service through the application, determines the address information of the target service instance corresponding to the first service through the first process, and the terminal device sends the first request message to the target service instance through the first process according to the address information of the target service instance. In the above process, the terminal device can send a request message to the target service instance through the first process without relying on the existing centralized distributed gateway cluster. When the number of terminal devices accessing the service through the application increases sharply, the request message can still be sent to the target service instance through the first process, thereby improving the reliability of network data transmission. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0070] Figure 1 An application scenario diagram of the data processing method provided in the embodiment of the present application;

[0071] Figure 2 A flowchart of a data processing method provided in an embodiment of the present application;

[0072] Figure 3 A schematic diagram of a process for sending a first request message provided in an embodiment of the present application;

[0073] Figure 4 A flowchart of another data processing method provided in an embodiment of the present application;

[0074] Figure 5 A flowchart of another data processing method provided in an embodiment of the present application;

[0075] Figure 6 A schematic diagram of the structure of a data processing device provided in an embodiment of the present application;

[0076] Figure 7 A schematic diagram of the structure of another data processing device provided in an embodiment of the present application;

[0077] Figure 8 A schematic diagram of the structure of another data processing device provided in an embodiment of the present application;

[0078] Fig. 9 A schematic diagram of the hardware structure of a data processing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0079] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0080] Figure 1 This is an application scenario diagram of the data processing method provided in the embodiment of the present application. Figure 1, including a terminal device 101, a first server 102 and a second server 103. The terminal device 101 can be a mobile terminal, a tablet computer, a desktop computer, etc., but is not limited thereto. The terminal device 101 can be installed with different applications, an application can provide a business, the business can be executed through a business logic process, the business can include at least one service, the terminal device can access at least one service through the application, for example, the terminal device can access product browsing, adding to a shopping cart, payment and other services through the application. The first server 102 can be used to provide an operating environment for the application, manage, control and maintain the application, etc., and the second server 103 can be used to provide services, wherein the first server 102 and the second server 103 can be the same or different, and this application does not make specific limitations on this. The second server 103 can receive an access service request message sent by the terminal device 101 through the network. Since the terminal device 101 and the second server 103 support different protocols, for example, the terminal device 101 only supports the HTTP protocol, and the second server 103 only supports a certain private protocol (such as the redis protocol), network data forwarding is required between the terminal device 101 and the second server 103 to complete network communication of different protocols.

[0081] In the prior art, a gateway is usually deployed between the terminal device 101 and the second server 103 to realize network data forwarding. The gateway can receive the request message of the terminal device 101 according to the HTTP protocol, and then forward the request message to the second server 103 according to the corresponding private protocol. In the actual application process, multiple terminal devices 101 access services through applications. Since the hardware resources of a single gateway are limited, multiple gateways are usually deployed to jointly complete the process of network data forwarding. However, when the number of terminal devices 101 accessing services through applications increases sharply, the existing gateway cannot forward all service access request messages, resulting in delays or even interruptions in network data transmission, and low transmission reliability. In this regard, the present application improves the method of network data transmission.

[0082] In order to solve the above technical problems, in the present application, an application is installed in the terminal device 101, and the configuration file of the application includes process information of the first process. The first process has the function of a gateway. In this way, when the terminal device 101 starts the application, the terminal device starts the first process and can send a request message to the second server 103 through the first process without relying on the existing centralized distributed gateway cluster. When the number of terminal devices 101 accessing the second server through the application increases sharply, the request message can still be forwarded through the first process, thereby improving the reliability of network data transmission.

[0083] The first process runs in the terminal device 101, and the terminal device 101 can receive a request message for accessing a service transmitted according to a first protocol through the first process, and then forward the request message to the server according to a second protocol.

[0084] Next, the process of setting the first process in the application is described.

[0085] The first server 102 can modify the resource files and configuration information files of the application program through the HOOK module. For example, the first server 102 can add the resource files of the first process to the resource files of the application program through the HOOK module, and add the configuration information files of the first process to the configuration information files of the application program, thereby obtaining new resource files and configuration information files, and packaging the new resource files and configuration information files to obtain an installation package of the application program containing the first process information, and the first server 102 publishes the installation package, for example, the first server 102 can publish the installation package on the network.

[0086] When the terminal device 101 needs to access the service, it can first download the installation package through the network and install it. When the terminal device 101 starts the application, the first process starts.

[0087] In the actual application process, the first server 102 can obtain a list of service instances corresponding to the application. It should be noted that the terminal device 101 has at least one service accessed through the application, and each service may include multiple service instances, and the multiple service instances are respectively deployed at different addresses of the second server 103. For example, the address may be an IP (Internet Protocol Address) and a port PORT. For example, the services accessed by the terminal device 101 through the application may include browsing the product details page, adding a shopping cart, and paying for products. For a service such as product payment, there are multiple service instances corresponding to the service, which are respectively deployed at different addresses of the server. For example, the address of the service instance on the second server 103 can be expressed as: 192.168.1.1:135, where 192.168.1.1 is the IP address of the second server 103, and 135 is a port of the second server 103.

[0088] The first server 102 can obtain the service instance list corresponding to the application through the following feasible implementation method: the second server 103 sends the address information of the service instance to the registration module of the first server 102 in real time or periodically, the control module of the first server 102 obtains the address information of the service instance through the registration module, and updates the service instance list in real time or periodically.

[0089] For example, when a new service instance 34 is added, the address information of the service instance 34 on the second server 103 can be expressed as: 192.168.0.1:100. The second server 103 can send the address information to the registration module of the first server 102. Optionally, the second server 103 can send the address information to the registration module of the first server 102 in real time, or periodically send the address information to the registration module of the first server 102. For example, the sending period can be 1s.

[0090] The control module of the first server 102 stores service instance list information, and the service instance list may include identifiers of multiple services included in the application, at least one service instance corresponding to each service, and address information of each service instance, etc. Optionally, the service instance list may be as shown in Table 1:

[0091] Table 1

[0092]

[0093] The control module of the first server 102 obtains the address information of the newly added service instance 34 through the registration module, and updates the service instance list in real time or periodically. The updated service instance list may be as shown in Table 2:

[0094] Table 2

[0095]

[0096]

[0097] It should be noted that the above is only an example of a possible application scenario and is not intended to limit the application scenario.

[0098] The technical solution shown in the present application is described in detail below through specific embodiments. It should be noted that the following specific embodiments can be combined with each other, and the same or similar contents will not be repeatedly described in different embodiments.

[0099] Figure 2 A flowchart of a data processing method provided in an embodiment of the present application. Figure 2 , the method may include:

[0100] S201. The terminal device generates a first request message corresponding to a first service.

[0101] The terminal device may be a smart phone, tablet computer, desktop computer or other terminal device.

[0102] The first service is any service in the application, for example, the first service may be product browsing, adding to a shopping cart, product payment, etc. The application is a computer program running on the operating system of the terminal device, for example, the application may be a shopping application, an application may provide a service, the service may be executed by the terminal device through the service logic process corresponding to the application, the service may include at least one service, and the terminal device may access at least one service through the application.

[0103] The first request message is a request message generated by the terminal device through an application program, and is used to access the first service. Optionally, the first request message may be transmitted according to a first protocol, for example, the first protocol may be an HTTP protocol.

[0104] Optionally, the terminal device can generate a first request message corresponding to the first service in the following manner: when the terminal device needs to access the first service, the terminal device starts the application and receives the user's operation on the application's controls through the application. Optionally, the operation can be the user clicking on a corresponding control on the display page of the application. For example, the display page of the first mall application includes a control for the first product. When the user needs to browse the details of the first product, the user can click on the control for the first product. After the terminal device receives the user's operation, it generates a first request message corresponding to browsing the first product accordingly.

[0105] S202: The terminal device determines address information of a target service instance corresponding to the first service through a first process.

[0106] Optionally, the terminal device may generate a first request message through the business logic process of the application, and send it to the Sidecar process through the business logic process according to the first protocol. Optionally, the first protocol may be the HTTP protocol.

[0107] The terminal device may receive a request message for accessing a service transmitted according to a first protocol through a first process, and forward the request message to a server according to a second protocol.

[0108] The first process may be a sidecar process. Sidecar is a container deployment mode in a container cluster management platform. The sidecar process and the business logic process may be deployed in a 1:1 ratio. A container is a lightweight virtualization module, and a terminal device may be configured with at least one container. The container cluster management platform may manage at least one container of a terminal device. The container cluster management platform may be Kubernetes, which is an open source platform for deploying, updating, and maintaining containerized applications on terminal devices.

[0109] The first service is any one of multiple services provided by the application. The first service may include multiple service instances, and the multiple service instances may be respectively deployed on different IP / PORTs of the server.

[0110] The target service instance is any one of multiple service instances. The terminal device can determine the address information of the target service instance corresponding to the first service through the first process, wherein the address information of the target service instance can be the IP / PORT address information of the target service instance on the server. For example, the address information of the target service instance can be: 172.168.0.0:8080, wherein 172.168.0.0 is the IP address of the server corresponding to the target service instance, and 8080 is the port number assigned by the server to the target service instance.

[0111] Optionally, the address information of the target service instance corresponding to the first service can be determined by the first process in the following feasible implementation method: the terminal device obtains the service instance list corresponding to the application; the terminal device determines the address information of the target service instance corresponding to the first service in the service instance list. The service instance list can be as shown in Table 1 above, which will not be described in detail here.

[0112] Optionally, the service instance list corresponding to the application can be obtained in the following manner: the terminal device can send a second request message to the first server, the second request message can include the identification of the application, after the first server receives the second request message, it sends the service instance list to the terminal device according to the second request message, and the terminal device receives the service instance list sent by the first server.

[0113] Optionally, the terminal device may determine the address information of the target service instance corresponding to the first service in the service instance list in the following manner: the terminal device obtains at least one service instance corresponding to the first service in the service instance list; the terminal device determines the target service instance among the at least one service instance corresponding to the first service; the terminal device obtains the address information corresponding to the target service instance in the service instance list.

[0114] Below, the service instance list shown in Table 1 is taken as an example to illustrate how the terminal device determines the address information of the target service instance corresponding to the first service through the first process.

[0115] When the terminal device needs to determine the address information of the target service instance corresponding to service 1 through the first process, the terminal device sends a second request message to the first server. The second request message may include the identifier of the application. After receiving the second request message, the first server sends a service instance list corresponding to the application to the terminal device according to the second request message. The terminal device receives the service instance list sent by the first server through the first process. The terminal device obtains the service instances corresponding to service 1 in the service instance list through the first process, which are: service instance 11, service instance 12, and service instance 13. The target service instance is determined from these three service instances. Optionally, the method for determining the target service instance may include a random algorithm, a polling algorithm, etc., which is not specifically limited in the embodiments of the present application. For example, the target service instance is determined to be service instance 12 through a random algorithm, and the terminal device obtains the IP / PORT information corresponding to the target service instance 12 in the service instance list as: 192.168.0.0:456.

[0116] S203: The terminal device sends a first request message to the target service instance through a first process according to the address information of the target service instance.

[0117] Optionally, the terminal device sends a first request message to the target service instance through the first process according to the IP / PORT information of the target service instance. Optionally, the first request message sent to the target service instance through the first process can be transmitted according to a second protocol. For example, the second protocol can be a Redis private protocol.

[0118] Optionally, the terminal device may send a first request message to the target service instance through the first process according to the address information of the target service instance in the following manner: the terminal device performs network address translation NAT on the first request message to redirect the request message to the first process; the terminal device sends the first request message to the target service instance through the first process according to the address information of the target service instance.

[0119] Next, combine Figure 3 , a process in which a terminal device sends a first request message to a target service instance through a first process is described in detail.

[0120] Figure 3 A schematic diagram of the process of sending a first request message provided in an embodiment of the present application. Figure 3 After the terminal device generates the first request message, the terminal device can obtain the first request message through the redirection module. The terminal device performs NAT on the first request message through the redirection module to redirect the request message to the first process; the terminal device sends the first request message to the target service instance through the first process according to the address information of the target service instance.

[0121] The redirection module is set on the terminal device and is used for terminal device configuration and control of the behavior of the TCP / IP protocol stack of the operating system kernel. Optionally, the redirection module can be Iptables.

[0122] Since the business logic process and the redirection module share the hardware resources of the terminal device, specifically, the TCP / IP protocol stack of the terminal device, the redirection module can obtain the first request message faster than the traditional gateway. After obtaining the first request message, the terminal device can perform NAT on the first request message through the redirection module to redirect the first request message to the first process. The terminal device sends the first request message to the target service instance through the first process according to the IP / PORT information of the target service instance.

[0123] A data processing method provided by an embodiment of the present application is that an application is installed in a terminal device, and a first process is set in the application, and the first process has the function of a gateway, so that when the terminal device needs to access a service, the terminal device generates a first request message corresponding to the first service through the application, determines the address information of the target service instance corresponding to the first service through the first process, and the terminal device sends the first request message to the target service instance through the first process according to the address information of the target service instance. In the above process, the terminal device implements the forwarding of the access service request message through the first process, without relying on the existing centralized distributed gateway cluster, and when the number of terminal devices accessing the service through the application increases sharply, the request message can still be sent to the target service instance through the first process, thereby improving the reliability of network data transmission.

[0124] Based on any of the above embodiments, Figure 4 The embodiment shown is used to illustrate the above data processing method.

[0125] Figure 4 A flowchart of another data processing method provided in an embodiment of the present application. Figure 4 , the method may include:

[0126] S401. The terminal device generates a first request message corresponding to a first service.

[0127] It should be noted that the execution process of S401 can refer to the execution process of S201, and will not be repeated here.

[0128] S402: The terminal device obtains a configuration file.

[0129] The configuration file is a file used by the terminal device to configure different services. The terminal device can obtain the configuration file of the first service through the first process.

[0130] Optionally, the terminal device may obtain the configuration file through the following feasible implementation method: the first server defines the first configuration file and the second configuration file through the control module, wherein the first configuration file and the second configuration file are configuration files related to service management and can be used to manage the first service. The first server sends the first configuration file and the second configuration file to the terminal device, and optionally, the first server may send the first configuration file and the second configuration file to the first process of the terminal device through the xDS protocol.

[0131] Below, taking grayscale management as an example, the process of a terminal device obtaining a configuration file is described in detail.

[0132] Gray management means that a preset number of terminal devices can access the services provided by the first version of the application, and terminal devices beyond the preset number can access the services provided by other versions of the application. Optionally, the other versions of the application may include at least one version of the application, wherein at least one version may include the second version. The first version of the application is used for testing and verifying new functions. Before the first version of the application is released, a preset number of terminal devices access the service through the first version of the application to verify whether the functions of the first version of the application are normal, thereby avoiding the release of problematic applications.

[0133] Below, taking the second version as an example, the process of the terminal device obtaining the configuration file is described in detail.

[0134] The first service may be service1, and accordingly, the identifier of the first configuration file may be represented as "service1.destinationrule.yaml". The first configuration file "service1.destinationrule.yaml" may be defined in the following feasible implementation manners:

[0135]

[0136]

[0137] The first configuration file specifies that the terminal device can access service1 through the first version of the application and the second version of the application. The first server can generate the first configuration file through the deployment platform, the deployment platform can be the Istio platform, and the first configuration file can be transmitted according to the third protocol, for example, the third protocol can be the xDS protocol.

[0138] The identifier of the second configuration file may be represented as "service1.virtualservice.yaml". A second configuration file "service1.virtualservice.yaml" may be defined in the following feasible implementation manner:

[0139]

[0140]

[0141] The second configuration file specifies that the access parameters of the business logic process of the second version of the application include the "lab: canary" identifier, and the access parameters of the business logic process of the first version of the application do not include the "lab: canary" identifier. The first server can generate the second configuration file through a deployment platform, which can be an Istio platform, and the second configuration file can be transmitted according to a third protocol, for example, the third protocol can be an xDS protocol.

[0142] Optionally, the terminal device may obtain the configuration file in the following feasible implementation manner: the terminal device receives, through a first process, a first configuration file and a second configuration file transmitted by a first server according to a third protocol, where the third protocol may be an xDS protocol.

[0143] Optionally, before the terminal device obtains the configuration file, the terminal device may obtain different versions of the application program through the network. Specifically, the terminal device may download a first installation package from a first location and a second installation package from a second location through the network, wherein the first installation package is an installation package of the first version of the application program and the second installation package is an installation package of the second version of the application program. The terminal device installs the application program according to the installation package.

[0144] S403: The terminal device obtains a preset identifier in the configuration file.

[0145] The preset identifier is used to distinguish different versions of applications. Optionally, the preset identifier and the version correspond according to a preset correspondence, wherein the preset correspondence may include multiple preset identifiers and a version corresponding to each preset identifier. Optionally, the preset correspondence may be as shown in Table 3:

[0146] Table 3

[0147] Preset Logo Version Preset logo 1 Version 1 Preset logo 2 Version 2 Preset logo 3 Version 3 Preset logo 4 Version 4 …… ……

[0148] It should be noted that Table 3 is only an example of the preset correspondence between the preset identifier and the version, and does not limit the preset correspondence between the preset identifier and the version.

[0149] Optionally, taking the above-mentioned second configuration file as an example, the preset identifier may be "lab:canary", and accordingly, the configuration file of the second version of the application includes the preset identifier "lab:canary", while the configuration file of the first version of the application does not include the preset identifier "lab:canary".

[0150] S404: The terminal device obtains a service instance list corresponding to a corresponding version according to a preset identifier in the configuration file.

[0151] Optionally, the first server may classify at least one service instance of the first service through the control module. The following uses versions v1 and v2 as an example to illustrate the classification process in conjunction with Table 4.

[0152] Table 4

[0153]

[0154] As shown in Table 4, service1 is a service provided by the server. Service1 may include 10 service instances, namely service instance 10 to service instance 19. These 10 service instances correspond to 10 IP / PORTs of the server respectively. Among them, service instance 10 to service instance 16 correspond to the first version (v1) of the application, and service instance 17 to service instance 19 correspond to the second version (v2) of the application.

[0155] It should be noted that the above is only an example to illustrate a possible service instance classification method, and is not intended to limit the service instance classification method.

[0156] Optionally, the terminal device may obtain the service instance list corresponding to the corresponding version according to the preset identifier in the configuration file in the following manner: for the first version among the different versions, the terminal device sends a third request message to the first server, the third request message includes the identifier of the first version application; the terminal device receives the service instance list corresponding to the first version sent by the first server. Accordingly, the service instance list corresponding to the first version obtained is shown in Table 5.

[0157] Table 5

[0158]

[0159] S405: The terminal device determines the address information of the target service instance corresponding to the first service in the service instance list.

[0160] It should be noted that the execution process of S405 can refer to the execution process of S202, which will not be described in detail here.

[0161] S406: The terminal device sends a first request message to the target service instance through the first process according to the address information of the target service instance.

[0162] It should be noted that the execution process of S406 can refer to the execution process of S203, which will not be described in detail here.

[0163] S407. The terminal device receives a response message corresponding to the first request message through the first process.

[0164] Optionally, after receiving the first request message through the target service instance, the server packages the resource files and configuration files corresponding to the target service instance and generates a response message corresponding to the first request message.

[0165] Optionally, the terminal device may receive a response message corresponding to the first request message through the first process in the following manner: the server determines the IP / PORT information of the terminal device, and sends a response message corresponding to the first request message to the terminal device according to the second protocol based on the IP / PORT information of the terminal device; the terminal device receives the response message corresponding to the first request message through the first process according to the first protocol.

[0166] Based on any of the above embodiments, Figure 5 The embodiment shown is used to illustrate the above data processing method.

[0167] Figure 5 A flowchart of another data processing method provided in the embodiment of the present application. Figure 5 , the method may include:

[0168] S501. The terminal device generates a first request message corresponding to a first service.

[0169] It should be noted that the execution process of S501 can refer to the execution process of S201, which will not be described in detail here.

[0170] S502: The terminal device obtains a configuration file.

[0171] The following describes in detail the process of a terminal device obtaining a configuration file, taking traffic management as an example.

[0172] Traffic management means that the terminal device can achieve the access ratio of different versions of service instances through the control module. Among them, different versions may include the first version, the second version, the third version, etc., which is not specifically limited in the present invention. For example, when the service instance may include the first version of the service instance and the second version of the service instance, a preset ratio of terminal devices can access the first version of the service instance, and terminal devices outside the preset ratio can access the second version of the service instance. Therefore, the terminal device can achieve the ratio of accessing the service instance through the first version of the application and the second version of the application.

[0173] The first service may be service1, and accordingly, the identifier of the first configuration file may be represented as "service1.destinationrule.yaml". The first configuration file "service1.destinationrule.yaml" may be defined in the following feasible implementation manners:

[0174]

[0175]

[0176] The first configuration file specifies that the terminal device can access service1 through the first version of the application and the second version of the application. The first server can generate the first configuration file through the deployment platform, the deployment platform can be the Istio platform, and the first configuration file can be transmitted according to the third protocol, for example, the third protocol can be the xDS protocol.

[0177] The identifier of the second configuration file may be represented as "service1.virtualservice.yaml". The second configuration file "service1.virtualservice.yaml" may be defined in the following feasible implementation manners:

[0178]

[0179] The second configuration file specifies that the terminal device accesses the service instance through the first version of the application and the second version of the application in a ratio of 70:30.

[0180] S503: The terminal device obtains a version parameter in the configuration file.

[0181] The version parameter is used to set the weights of different versions of applications accessing the service instance. For example, different versions may include the first version, the second version, the third version, and the like.

[0182] Optionally, taking the second configuration file shown above as an example, different versions may include a first version (v1) and a second version (v2). When the version parameter is "weight: 70", the weight of the service instance that the terminal device can access through the application of this version is 70%.

[0183] S504: The terminal device obtains a service instance list corresponding to a corresponding version according to the version parameter in the configuration file.

[0184] Optionally, the first server may classify at least one service instance of the first service through the control module. The classification process is described below in conjunction with Table 6.

[0185] Table 6

[0186]

[0187] As shown in Table 6, service1 is a service provided by the server. Service1 may include 10 service instances, namely service instance 10 to service instance 19. These 10 service instances correspond to 10 IP / PORTs of the server respectively. These 10 service instances are classified according to the first parameter of the first version and the second parameter of the second version. Among them, service instance 10 to service instance 16 correspond to the first version (v1) application, and service instance 17 to service instance 19 correspond to the second version (v2) application.

[0188] It should be noted that the above is only an example to illustrate a possible service instance classification method, and is not intended to limit the service instance classification method.

[0189] It should be noted that the manner in which the terminal device obtains the service instance list corresponding to the corresponding version according to the version parameter in the configuration file can be found in the execution process of S404, which will not be described in detail here.

[0190] S505: The terminal device determines the address information of the target service instance corresponding to the first service in the service instance list.

[0191] It should be noted that the execution process of S505 may refer to the execution process of S202, which will not be described in detail here.

[0192] S506: The terminal device sends a first request message to the target service instance through the first process according to the address information of the target service instance.

[0193] It should be noted that the execution process of S506 can refer to the execution process of S203, which will not be described in detail here.

[0194] S507. The terminal device receives a response message corresponding to the first request message through the first process.

[0195] It should be noted that the execution process of S507 may refer to the execution process of S408, which will not be described in detail here.

[0196] A data processing method provided by an embodiment of the present application is that an application is installed in a terminal device, and a first process is set in the application, and the first process has the function of a gateway, so that when the terminal device needs to access a service, the terminal device generates a first request message corresponding to the first service through the application, determines the address information of the target service instance corresponding to the first service through the first process, and the terminal device sends the first request message to the target service instance through the first process according to the address information of the target service instance. In the above process, the terminal device can send a request message to the target service instance through the first process without relying on the existing centralized distributed gateway cluster. When the number of terminal devices accessing the service through the application increases sharply, the request message can still be sent to the target service instance through the first process, which improves the reliability of network data transmission. At the same time, the terminal device can access the services provided by different versions of the application through the first process, realizing traffic management and gray management, and further improving the reliability of network data transmission.

[0197] Figure 6 This is a schematic diagram of the structure of a data processing device provided in an embodiment of the present application. Figure 6 , the data processing device 100 comprises:

[0198] A generating module 110, configured to generate a first request message corresponding to a first service, where the first service is any service in an application;

[0199] A determination module 120, configured to determine address information of a target service instance corresponding to the first service through a first process;

[0200] The sending module 130 is used to send the first request message to the target service instance through the first process according to the address information of the target service instance.

[0201] In a possible implementation manner, the determining module 120 is specifically configured to:

[0202] Obtaining a service instance list corresponding to the application, wherein the service instance list includes identifiers of multiple services included in the application, at least one service instance corresponding to each service, and address information of each service instance;

[0203] Determine the address information of the target service instance corresponding to the first service in the service instance list.

[0204] In a possible implementation manner, the determining module 120 is specifically configured to:

[0205] Sending a second request message to the first server, where the second request message includes an identifier of the application;

[0206] Receive the service instance list sent by the first server.

[0207] In a possible implementation manner, the determining module 120 is specifically configured to:

[0208] Acquire at least one service instance corresponding to the first service in the service instance list;

[0209] Determine the target service instance in at least one service instance corresponding to the first service;

[0210] Acquire the address information corresponding to the target service instance in the service instance list.

[0211] In a possible implementation manner, the determining module 120 is specifically configured to:

[0212] Get the configuration file;

[0213] Obtaining a preset identifier in the configuration file;

[0214] The service instance list corresponding to the corresponding version is obtained according to the preset identifier in the configuration file.

[0215] In a possible implementation manner, the determining module 120 is specifically configured to:

[0216] Get the configuration file;

[0217] Obtaining the version parameter in the configuration file;

[0218] Obtain a list of service instances corresponding to the corresponding version according to the version parameter in the configuration file.

[0219] In a possible implementation manner, the sending module 130 is specifically configured to:

[0220] Performing network address translation (NAT) on the first request message to redirect the request message to the first process;

[0221] The first request message is sent to the target service instance through the first process according to the address information of the target service instance.

[0222] The data processing device 100 provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0223] Figure 7 A schematic diagram of the structure of another data processing device provided in an embodiment of the present application, in Figure 5 Based on the examples shown, see Figure 7 , the device further comprises:

[0224] The download module 140 is used to download a file package corresponding to the application, wherein the file package includes process information of the first process, wherein the first process is run when the application is started.

[0225] Figure 8 A schematic diagram of the structure of another data processing device provided in an embodiment of the present application, Figure 7 Based on the examples shown, see Figure 8 , the device further comprises:

[0226] The receiving module 150 is used to receive a response message corresponding to the first request message through the first process.

[0227] A data processing device 100 provided in an embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0228] Fig. 9 This is a hardware structure diagram of the data processing device provided in the embodiment of the present application. Fig. 9 , the data processing device 200 may include: a processor 201 and a memory 202, wherein the processor 201 and the memory 202 can communicate; illustratively, the processor 201 and the memory 202 communicate via a communication bus 203, the memory 202 is used to store program instructions, and the processor 201 is used to call the program instructions in the memory to execute the data processing method shown in any of the above method embodiments.

[0229] Optionally, the data processing device 200 may further include a communication interface, which may include a transmitter and / or a receiver.

[0230] Optionally, the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the present application may be directly implemented as being executed by a hardware processor, or may be implemented by a combination of hardware and software modules in the processor.

[0231] An embodiment of the present application provides a readable storage medium, on which a computer program is stored; the computer program is used to implement the data processing method described in any of the above embodiments.

[0232] An embodiment of the present application provides a computer program product, which includes instructions. When the instructions are executed, a computer executes the above data processing method.

[0233] All or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a readable memory. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned memory (storage medium) includes: read-only memory (English: read-only memory, abbreviated: ROM), RAM, flash memory, hard disk, solid state drive, magnetic tape (English: magnetic tape), floppy disk (English: floppy disk), optical disc (English: optical disc) and any combination thereof.

[0234] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processing unit of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0235] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0236] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0237] Obviously, those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

[0238] In the present application, the term "include" and its variations may refer to non-restrictive inclusion; the term "or" and its variations may refer to "and / or". The terms "first", "second", etc. in the present application are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. In the present application, "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previously associated objects are in an "or" relationship.

Claims

1. A data processing method, characterized in that: include: The terminal device generates a first request message corresponding to a first service, where the first service is any service in the application; The terminal device determines address information of a target service instance corresponding to the first service through a first process, where the first process has a gateway function; The terminal device sends the first request message to the target service instance through the first process according to the address information of the target service instance; The method further comprises: The terminal device downloads a file package corresponding to the application from a first server, wherein the file package includes process information of the first process, wherein the first process is run when the application is started, and the process information of the first process includes a resource file of the first process added by the first server to the resource file of the application and a configuration information file of the first process added to the configuration information file of the application.

2. The method according to claim 1, characterized in that The terminal device determines, through a first process, address information of a target service instance corresponding to the first service, including: The terminal device obtains a service instance list corresponding to the application, wherein the service instance list includes identifiers of multiple services included in the application, at least one service instance corresponding to each service, and address information of each service instance; The terminal device determines the address information of the target service instance corresponding to the first service in the service instance list.

3. The method according to claim 2, characterized in that The terminal device obtains a service instance list corresponding to the application, including: The terminal device sends a second request message to the first server, where the second request message includes an identifier of the application; The terminal device receives the service instance list sent by the first server.

4. The method according to claim 2 or 3, characterized in that: The terminal device determines, in the service instance list, address information of a target service instance corresponding to the first service, including: The terminal device obtains at least one service instance corresponding to the first service in the service instance list; The terminal device determines the target service instance from at least one service instance corresponding to the first service; The terminal device obtains the address information corresponding to the target service instance in the service instance list.

5. The method according to any one of claims 2 to 4, characterized in that: The terminal device obtains a service instance list corresponding to the application, including: The terminal device obtains a configuration file; The terminal device obtains a preset identifier in the configuration file; The terminal device obtains a service instance list corresponding to a corresponding version according to a preset identifier in the configuration file.

6. The method according to any one of claims 2 to 4, characterized in that: The terminal device obtains a service instance list corresponding to the application, including: The terminal device obtains a configuration file; The terminal device obtains a version parameter in the configuration file; The terminal device obtains a service instance list corresponding to a corresponding version according to the version parameter in the configuration file.

7. The method according to any one of claims 1 to 6, characterized in that: The terminal device sends the first request message to the target service instance through the first process according to the address information of the target service instance, including: The terminal device performs network address translation NAT on the first request message to redirect the request message to the first process; The terminal device sends the first request message to the target service instance through the first process according to the address information of the target service instance.

8. The method according to any one of claims 1 to 7, characterized in that: After the terminal device sends the first request message to the target service instance through the first process according to the address information of the target service instance, the method further includes: The terminal device receives a response message corresponding to the first request message through the first process.

9. A data processing device, characterized in that: include: A generating module, configured to generate a first request message corresponding to a first service, where the first service is any service in an application; A determination module, configured to determine address information of a target service instance corresponding to the first service through a first process, wherein the first process has a gateway function; A sending module, configured to send the first request message to the target service instance through the first process according to the address information of the target service instance; The device also includes a download module; The download module is used to download a file package corresponding to the application from a first server, wherein the file package includes process information of the first process, wherein the first process is run when the application is started, and the process information of the first process includes a resource file of the first process added by the first server to the resource file of the application and a configuration information file of the first process added to the configuration information file of the application.

10. A data processing device, characterized in that: include: at least one processor and memory; The memory stores computer-executable instructions; The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the data processing method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the processor executes the computer-executable instructions, the data processing method according to any one of claims 1 to 8 is implemented.

12. A computer program product, characterized in that The computer program product comprises instructions, and when the instructions are executed by a processor, the computer executes the data processing method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Data requesting method, device, storage medium and electronic equipment

    CN108011927A

  • Service request transmission method and device

    CN111049854A

  • Service instance configuration method, device and system

    CN111309380A