[go: up one dir, main page]

CN116800858A - Mini program IPv6 protocol conversion method, device and electronic equipment - Google Patents

Mini program IPv6 protocol conversion method, device and electronic equipment Download PDF

Info

Publication number
CN116800858A
CN116800858A CN202310814823.7A CN202310814823A CN116800858A CN 116800858 A CN116800858 A CN 116800858A CN 202310814823 A CN202310814823 A CN 202310814823A CN 116800858 A CN116800858 A CN 116800858A
Authority
CN
China
Prior art keywords
protocol version
access request
mini program
initial access
applet
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310814823.7A
Other languages
Chinese (zh)
Inventor
杨国良
李伟波
石琳皓
何坚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Reyzar Technology Co ltd
Original Assignee
Reyzar Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Reyzar Technology Co ltd filed Critical Reyzar Technology Co ltd
Priority to CN202310814823.7A priority Critical patent/CN116800858A/en
Publication of CN116800858A publication Critical patent/CN116800858A/en
Pending legal-status Critical Current

Links

Landscapes

  • Computer And Data Communications (AREA)

Abstract

本发明提供了一种小程序IPv6协议转换方法、装置及电子设备,涉及信息处理技术领域,应用于协议版本为IPv6的小程序客户端和协议版本为IPv4的小程序服务端的协议版本转换场景,该方法通过初始访问请求对应的小程序客户端协议版本对初始访问请求进行协议版本转换,得到目标访问请求,再将目标访问请求发送至小程序服务端,接收小程序服务端基于目标访问请求反馈的初始访问响应,通过初始访问响应对应的小程序服务端协议版本对初始访问响应进行版本转换,得到目标访问响应,将目标访问响应发送至小程序客户端。实现了小程序服务端在不更改网络协议栈以及应用层数据的情况下,可以被小程序客户端直接访问。

The invention provides a mini program IPv6 protocol conversion method, device and electronic equipment, which relates to the field of information processing technology and is applied to the protocol version conversion scenario of the mini program client whose protocol version is IPv6 and the mini program server whose protocol version is IPv4. This method converts the protocol version of the initial access request through the mini program client protocol version corresponding to the initial access request, obtains the target access request, then sends the target access request to the mini program server, and receives feedback from the mini program server based on the target access request. Initial access response, perform version conversion on the initial access response through the mini program server protocol version corresponding to the initial access response, obtain the target access response, and send the target access response to the mini program client. It realizes that the mini program server can be directly accessed by the mini program client without changing the network protocol stack and application layer data.

Description

小程序IPv6协议转换方法、装置及电子设备Mini program IPv6 protocol conversion method, device and electronic equipment

技术领域Technical field

本发明涉及信息处理技术领域,尤其是涉及一种小程序IPv6协议转换方法、装置及电子设备。The present invention relates to the field of information processing technology, and in particular to an applet IPv6 protocol conversion method, device and electronic equipment.

背景技术Background technique

小程序是APP(Application,应用程序)内嵌的一种类网站的小型半开放性应用,一个小程序通常绑定一个固定的域名,小程序服务端通过该域名给小程序客户端提供后端数据,当小程序的客户端处于纯IPv6协议环境,小程序服务端处于纯IPv4(InternetProtocol Version 4,互联网协议第4版)环境,IPv4的小程序服务端无法被IPv6(InternetProtocol Version 6,互联网协议第6版)小程序客户端直接访问。A mini program is a small, semi-open application embedded in an APP (Application). A mini program is usually bound to a fixed domain name. The mini program server provides back-end data to the mini program client through the domain name. , when the mini program client is in a pure IPv6 protocol environment and the mini program server is in a pure IPv4 (Internet Protocol Version 4, Internet Protocol version 4) environment, the IPv4 mini program server cannot be IPv6 (Internet Protocol Version 6, Internet Protocol version 4) Version 6) Direct access via mini program client.

在相关技术中,为了使IPv4的小程序服务端可以被IPv6小程序客户端直接访问,通常需要更改小程序服务端的网络协议栈、通过小程序服务端的域名的HTTPS(HypertextTransfer Protocol Secure,以安全为目标的HTTP通道)证书来更改其应用层数据等,改造的力度和成本都比较大。In related technologies, in order to enable the IPv4 mini program server to be directly accessed by the IPv6 mini program client, it is usually necessary to change the network protocol stack of the mini program server and HTTPS (HypertextTransfer Protocol Secure) through the domain name of the mini program server, with security as the priority. (HTTP channel) certificate of the target to change its application layer data, etc. The intensity and cost of transformation are relatively large.

发明内容Contents of the invention

有鉴于此,本发明的目的在于提供一种小程序IPv6协议转换方法、装置及电子设备,通过对小程序客户端反馈的初始访问请求进行协议版本转换,以及对小程序服务端反馈的初始访问响应进行协议版本转换,实现了小程序服务端在不更改小程序服务端的网络协议栈以及应用层数据的情况下,可以被小程序客户端直接访问。In view of this, the purpose of the present invention is to provide a mini program IPv6 protocol conversion method, device and electronic equipment, which performs protocol version conversion through the initial access request fed back by the mini program client, and the initial access feedback from the mini program server The protocol version conversion is performed in response, so that the mini program server can be directly accessed by the mini program client without changing the network protocol stack and application layer data of the mini program server.

第一方面,本发明实施例提供了一种小程序IPv6协议转换方法,应用于协议版本为IPv6的小程序客户端和协议版本为IPv4的小程序服务端的协议版本转换场景,包括:接收小程序客户端反馈的初始访问请求;基于初始访问请求对应的小程序客户端协议版本对初始访问请求进行协议版本转换,得到目标访问请求;小程序客户端协议版本为IPv6;将目标访问请求发送至小程序服务端,接收小程序服务端基于目标访问请求反馈的初始访问响应;基于初始访问响应对应的小程序服务端协议版本对初始访问响应进行协议版本转换,得到目标访问响应;将目标访问响应发送至小程序客户端;小程序服务端协议版本为IPv4。In a first aspect, embodiments of the present invention provide a mini program IPv6 protocol conversion method, which is applied to the protocol version conversion scenario of a mini program client whose protocol version is IPv6 and a mini program server whose protocol version is IPv4, including: receiving the mini program The initial access request fed back by the client; the protocol version of the initial access request is converted based on the mini program client protocol version corresponding to the initial access request, and the target access request is obtained; the mini program client protocol version is IPv6; the target access request is sent to the mini program The program server receives the initial access response based on the target access request feedback from the mini program server; converts the protocol version of the initial access response based on the protocol version of the mini program server corresponding to the initial access response to obtain the target access response; sends the target access response To the mini program client; the protocol version of the mini program server is IPv4.

在本发明较佳的实施例中,上述基于初始访问请求对应的小程序客户端协议版本对初始访问请求进行协议版本转换,得到目标访问请求,包括:确定是否存在进行协议版本转换的通信流;若存在,则基于通信流对初始访问请求进行协议版本转换,得到目标访问请求。In a preferred embodiment of the present invention, the above-mentioned protocol version conversion of the initial access request based on the applet client protocol version corresponding to the initial access request to obtain the target access request includes: determining whether there is a communication flow for protocol version conversion; If it exists, the protocol version of the initial access request is converted based on the communication flow to obtain the target access request.

在本发明较佳的实施例中,通信流中记录有小程序客户端协议版本的四元组与小程序服务端协议版本的四元组之间的对应关系,上述基于通信流对初始访问请求进行协议版本转换,得到目标访问请求,包括:基于通信流和小程序客户端协议版本的四元组确定小程序服务端协议版本的四元组;基于小程序服务端协议版本的四元组对初始访问请求进行协议版本转换,得到目标访问请求。In a preferred embodiment of the present invention, the correspondence between the four-tuple of the applet client protocol version and the four-tuple of the applet server protocol version is recorded in the communication flow. The above-mentioned initial access request is based on the communication flow. Perform protocol version conversion to obtain the target access request, including: a four-tuple that determines the applet server protocol version based on the communication flow and the applet client protocol version; a four-tuple pair based on the applet server protocol version The initial access request undergoes protocol version conversion to obtain the target access request.

在本发明较佳的实施例中,上述确定是否存在进行协议版本转换的通信流之后,方法还包括:若不存在,则确定小程序服务端对应的协议版本地址;基于小程序服务端对应的协议版本地址对初始访问请求进行协议版本转换,得到目标访问请求,并建立基于小程序客户端协议版本的四元组与小程序服务端协议版本的四元组的通信流。In a preferred embodiment of the present invention, after the above-mentioned determination of whether there is a communication flow for protocol version conversion, the method further includes: if not, determining the protocol version address corresponding to the mini program server; based on the corresponding protocol version address of the mini program server; The protocol version address performs protocol version conversion on the initial access request, obtains the target access request, and establishes a communication flow based on the quadruple of the mini program client protocol version and the quadruple of the mini program server protocol version.

在本发明较佳的实施例中,上述基于小程序服务端对应的协议版本地址对初始访问请求进行协议版本转换,得到目标访问请求,包括:基于小程序服务端对应的协议版本地址对小程序客户端协议版本的四元组进行转换,确定小程序服务端协议版本的四元组;基于小程序服务端协议版本的四元组对初始访问请求进行协议版本转换,得到目标访问请求。In a preferred embodiment of the present invention, the above-mentioned protocol version conversion of the initial access request based on the protocol version address corresponding to the mini program server to obtain the target access request includes: converting the mini program based on the protocol version address corresponding to the mini program server The quadruple of the client protocol version is converted to determine the quadruple of the mini program server protocol version; the protocol version of the initial access request is converted based on the quadruple of the mini program server protocol version to obtain the target access request.

在本发明较佳的实施例中,上述基于初始访问响应对应的小程序服务端协议版本对初始访问响应进行协议版本转换,得到目标访问响应,包括:确定是否存在小程序客户端协议版本与小程序服务端协议版本的通信流;若存在,则基于通信流对初始访问响应进行协议版本转换,得到目标访问响应。In a preferred embodiment of the present invention, the above-mentioned protocol version conversion is performed on the initial access response based on the mini program server protocol version corresponding to the initial access response to obtain the target access response, which includes: determining whether there is a mini program client protocol version consistent with the mini program client protocol version. The communication flow of the protocol version of the program server; if it exists, the protocol version of the initial access response is converted based on the communication flow to obtain the target access response.

在本发明较佳的实施例中,上述基于通信流对初始访问响应进行协议版本转换,得到目标访问响应,包括:基于通信流和小程序服务端协议版本的四元组确定小程序客户端协议版本的四元组;基于小程序客户端协议版本的四元组对初始访问响应进行协议版本转换,得到目标访问响应。In a preferred embodiment of the present invention, the above-mentioned protocol version conversion of the initial access response based on the communication flow to obtain the target access response includes: determining the applet client protocol based on the four-tuple of the communication flow and the applet server protocol version The four-tuple of the version; perform protocol version conversion on the initial access response based on the four-tuple of the applet client protocol version to obtain the target access response.

第二方面,本发明实施例还提供一种小程序IPv6协议转换装置,应用于协议版本转换平台,包括:协议版本转换模块,用于接收小程序客户端反馈的初始访问请求;基于初始访问请求对应的小程序客户端协议版本对初始访问请求进行协议版本转换,得到目标访问请求;小程序客户端协议版本为IPv6;初始访问响应接收模块,用于将目标访问请求发送至小程序服务端,接收小程序服务端基于目标访问请求反馈的初始访问响应;目标访问响应发送模块,用于基于初始访问响应对应的小程序服务端协议版本对初始访问响应进行协议版本转换,得到目标访问响应;将目标访问响应发送至小程序客户端;小程序服务端协议版本为IPv4。In a second aspect, embodiments of the present invention also provide a mini program IPv6 protocol conversion device, which is applied to a protocol version conversion platform, including: a protocol version conversion module for receiving an initial access request fed back by the mini program client; based on the initial access request The corresponding mini program client protocol version performs protocol version conversion on the initial access request to obtain the target access request; the mini program client protocol version is IPv6; the initial access response receiving module is used to send the target access request to the mini program server. Receive the initial access response based on the target access request feedback from the mini program server; the target access response sending module is used to perform protocol version conversion on the initial access response based on the protocol version of the mini program server corresponding to the initial access response to obtain the target access response; The target access response is sent to the mini program client; the mini program server protocol version is IPv4.

第三方面,本发明实施例还提供一种电子设备,包括处理器和存储器,存储器存储有能够被处理器执行的计算机可执行指令,处理器执行计算机可执行指令以实现上述第一方面的小程序IPv6协议转换方法。In a third aspect, embodiments of the present invention further provide an electronic device, including a processor and a memory. The memory stores computer-executable instructions that can be executed by the processor. The processor executes the computer-executable instructions to implement the above-mentioned small steps of the first aspect. Program IPv6 protocol conversion method.

第四方面,本发明实施例还提供一种计算机可读存储介质,计算机可读存储介质存储有计算机可执行指令,计算机可执行指令在被处理器调用和执行时,计算机可执行指令促使处理器实现上述第一方面的小程序IPv6协议转换方法。In a fourth aspect, embodiments of the present invention further provide a computer-readable storage medium. The computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are called and executed by the processor, the computer-executable instructions prompt the processor to Implement the above-mentioned first aspect of the mini program IPv6 protocol conversion method.

本发明实施例带来了以下有益效果:The embodiments of the present invention bring the following beneficial effects:

本发明实施例提供了一种小程序IPv6协议转换方法、装置及电子设备,应用于协议版本为IPv6的小程序客户端和协议版本为IPv4的小程序服务端的协议版本转换场景,通过初始访问请求对应的小程序客户端协议版本对初始访问请求进行协议版本转换,得到目标访问请求,再将目标访问请求发送至小程序服务端,接收小程序服务端基于目标访问请求反馈的初始访问响应,通过初始访问响应对应的小程序服务端协议版本对初始访问响应进行版本转换,得到目标访问响应,将目标访问响应发送至小程序客户端。通过对小程序客户端反馈的初始访问请求进行协议版本转换,以及对小程序服务端反馈的初始访问响应进行协议版本转换,实现了小程序服务端在不更改网络协议栈以及应用层数据的情况下,可以被小程序客户端直接访问。Embodiments of the present invention provide a mini program IPv6 protocol conversion method, device and electronic equipment, which are applied to the protocol version conversion scenario of the mini program client whose protocol version is IPv6 and the mini program server whose protocol version is IPv4. Through the initial access request The corresponding mini program client protocol version converts the protocol version of the initial access request to obtain the target access request, then sends the target access request to the mini program server, receives the initial access response based on the feedback of the target access request from the mini program server, and passes The mini program server protocol version corresponding to the initial access response performs version conversion on the initial access response, obtains the target access response, and sends the target access response to the mini program client. By converting the protocol version of the initial access request fed back by the mini program client, and converting the protocol version of the initial access response fed back by the mini program server, the mini program server is realized without changing the network protocol stack and application layer data. , can be directly accessed by the mini program client.

本公开的其他特征和优点将在随后的说明书中阐述,或者,部分特征和优点可以从说明书推知或毫无疑义地确定,或者通过实施本公开的上述技术即可得知。Other features and advantages of the present disclosure will be set forth in the subsequent description, or some of the features and advantages may be inferred or unambiguously determined from the description, or may be learned by practicing the above-mentioned techniques of the present disclosure.

为使本公开的上述目的、特征和优点能更明显易懂,下文特举较佳实施例,并配合所附附图,作详细说明如下。In order to make the above-mentioned objects, features and advantages of the present disclosure more obvious and understandable, preferred embodiments are given below and described in detail with reference to the accompanying drawings.

附图说明Description of the drawings

为了更清楚地说明本发明具体实施方式或现有技术中的技术方案,下面将对具体实施方式或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施方式,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly explain the specific embodiments of the present invention or the technical solutions in the prior art, the accompanying drawings that need to be used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings in the following description The drawings illustrate some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without exerting any creative effort.

图1为本发明实施例提供的一种小程序IPv6协议转换方法的流程图;Figure 1 is a flow chart of a small program IPv6 protocol conversion method provided by an embodiment of the present invention;

图2为本发明实施例提供的另一种小程序IPv6协议转换方法的流程图;Figure 2 is a flow chart of another applet IPv6 protocol conversion method provided by an embodiment of the present invention;

图3为本发明实施例提供的另一种小程序IPv6协议转换方法的流程图;Figure 3 is a flow chart of another applet IPv6 protocol conversion method provided by an embodiment of the present invention;

图4为本发明实施例提供的一种小程序IPv6协议转换装置的结构示意图;Figure 4 is a schematic structural diagram of an applet IPv6 protocol conversion device provided by an embodiment of the present invention;

图5为本发明实施例提供的一种电子设备的结构示意图。FIG. 5 is a schematic structural diagram of an electronic device provided by an embodiment of the present invention.

具体实施方式Detailed ways

为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合附图对本发明的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of them. Embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of the present invention.

小程序是APP(Application,应用程序)内嵌的一种类网站的小型半开放性应用,一个小程序通常绑定一个固定的域名,小程序服务端通过该域名给小程序客户端提供后端数据,当小程序的客户端处于纯IPv6协议环境,小程序服务端处于纯IPv4(InternetProtocol Version 4,互联网协议第4版)环境,IPv4的小程序服务端无法被IPv6(InternetProtocol Version 6,互联网协议第6版)小程序客户端直接访问。A mini program is a small, semi-open application embedded in an APP (Application). A mini program is usually bound to a fixed domain name. The mini program server provides back-end data to the mini program client through the domain name. , when the mini program client is in a pure IPv6 protocol environment and the mini program server is in a pure IPv4 (Internet Protocol Version 4, Internet Protocol version 4) environment, the IPv4 mini program server cannot be IPv6 (Internet Protocol Version 6, Internet Protocol version 4) Version 6) Direct access via mini program client.

在相关技术中,为了使IPv4的小程序服务端可以被IPv6小程序客户端直接访问,通常需要更改小程序服务端的网络协议栈、通过小程序服务端的域名的HTTPS(HypertextTransfer Protocol Secure,以安全为目标的HTTP通道)证书来更改其应用层数据等,改造的力度和成本都比较大。In related technologies, in order to enable the IPv4 mini program server to be directly accessed by the IPv6 mini program client, it is usually necessary to change the network protocol stack of the mini program server and HTTPS (HypertextTransfer Protocol Secure) through the domain name of the mini program server, with security as the priority. (HTTP channel) certificate of the target to change its application layer data, etc. The intensity and cost of transformation are relatively large.

基于此,本发明实施例提供的一种小程序IPv6协议转换方法、装置及电子设备,可以通过初始访问请求对应的小程序客户端协议版本对初始访问请求进行协议版本转换,得到目标访问请求,再将目标访问请求发送至小程序服务端,接收小程序服务端基于目标访问请求反馈的初始访问响应,通过初始访问响应对应的小程序服务端协议版本对初始访问响应进行版本转换,得到目标访问响应,将目标访问响应发送至小程序客户端。通过对小程序客户端反馈的初始访问请求进行协议版本转换,以及对小程序服务端反馈的初始访问响应进行协议版本转换,实现了小程序服务端在不更改网络协议栈以及应用层数据的情况下,可以被小程序客户端直接访问。Based on this, the mini program IPv6 protocol conversion method, device and electronic device provided by embodiments of the present invention can perform protocol version conversion on the initial access request through the mini program client protocol version corresponding to the initial access request, and obtain the target access request. Then send the target access request to the mini program server, receive the initial access response based on the feedback of the target access request from the mini program server, and perform version conversion on the initial access response through the mini program server protocol version corresponding to the initial access response to obtain the target access Response, send the target access response to the applet client. By converting the protocol version of the initial access request fed back by the mini program client, and converting the protocol version of the initial access response fed back by the mini program server, the mini program server is realized without changing the network protocol stack and application layer data. , can be directly accessed by the mini program client.

为便于对本实施例进行理解,首先对本发明实施例所公开的一种小程序IPv6协议转换方法进行详细介绍。In order to facilitate understanding of this embodiment, a small program IPv6 protocol conversion method disclosed in the embodiment of the present invention is first introduced in detail.

实施例1Example 1

本发明实施例提供一种小程序IPv6协议转换方法,应用于协议版本为IPv6的小程序客户端和协议版本为IPv4的小程序服务端的协议版本转换场景,图1为本发明实施例提供的一种小程序IPv6协议转换方法的流程图。Embodiments of the present invention provide a mini program IPv6 protocol conversion method, which is applied to the protocol version conversion scenario of a mini program client whose protocol version is IPv6 and a mini program server whose protocol version is IPv4. Figure 1 is a diagram provided by an embodiment of the present invention. A flow chart of the IPv6 protocol conversion method of a small program.

如图1所示,该小程序IPv6协议转换方法可以包括如下步骤:As shown in Figure 1, the IPv6 protocol conversion method of this applet can include the following steps:

步骤S101,接收小程序客户端反馈的初始访问请求;基于初始访问请求对应的小程序客户端协议版本对初始访问请求进行协议版本转换,得到目标访问请求。Step S101: Receive the initial access request fed back by the mini program client; perform protocol version conversion on the initial access request based on the mini program client protocol version corresponding to the initial access request to obtain the target access request.

其中,小程序客户端协议版本为IPv6,初始访问请求可以包括小程序客户端对小程序服务端域名的协议版本地址的访问请求,具体通过网络报文进行访问请求,网络报文中包括网络层、传输层以及应用层。Among them, the mini program client protocol version is IPv6. The initial access request may include an access request from the mini program client to the protocol version address of the mini program server domain name. Specifically, the access request is made through a network message, and the network message includes the network layer. , transport layer and application layer.

其中,可以通过协议版本转换平台进行协议版本转换,基于初始访问请求对应的小程序客户端协议版本对初始访问请求进行协议版本转换,可以通过NAT(Net AddressTranslation,网络地址转换)技术进行协议版本的转换,具体地,将初始访问请求的第一协议版本网络报文中的网络层的第一协议版本报文头更改为第二协议版本报文头,不更改传输层的报文头中除源端口以外的字段,以及不更改应用层的数据,协议版本进行转换后得到的初始访问请求即为目标访问请求,通过对报文头的更改,可以对访问的协议版本地址以及发送网络报文的源端口进行更改,其中,第一协议版本为IPv6,第二协议版本为IPv4。Among them, the protocol version can be converted through the protocol version conversion platform. The protocol version of the initial access request can be converted based on the applet client protocol version corresponding to the initial access request. The protocol version can be converted through NAT (Net Address Translation, Network Address Translation) technology. Conversion, specifically, changing the first protocol version message header of the network layer in the first protocol version network message of the initial access request to the second protocol version message header, without changing the source of the message header of the transport layer For fields other than the port, and without changing the application layer data, the initial access request obtained after the protocol version is converted is the target access request. By changing the message header, the accessed protocol version address and the address of the network message sent can be modified. The source port is changed, where the first protocol version is IPv6 and the second protocol version is IPv4.

在实际应用中,协议版本转换平台可以为IPv6到IPv4转换平台,初始访问请求可以包括IPv6小程序客户端对IPv6小程序服务端的域名的地址的访问请求,在进行协议版本转换时,可以通过将IPv6网络地址转换成IPv4网络地址的NAT64技术,将初始访问请求的IPv6网络报文中的网络层的IPv6报文头更改为IPv4报文头,不更改传输层的报文头除源端口以外的字段以及应用层的数据,通过将IPv6报文头更改为IPv4报文头可以将访问的IPv6地址更改为源IPv4地址,其中,源IPv4地址为协议版本转换平台随机公网IPv4地址,源端口为协议版本转换平台的随机端口,转换之后的协议报文可以访问IPv4小程序服务端。In practical applications, the protocol version conversion platform can be an IPv6 to IPv4 conversion platform. The initial access request can include an access request from the IPv6 applet client to the domain name address of the IPv6 applet server. When performing protocol version conversion, it can be The NAT64 technology that converts an IPv6 network address into an IPv4 network address changes the IPv6 header of the network layer in the IPv6 network message of the initial access request to an IPv4 header without changing the header of the transport layer except the source port. field and application layer data, by changing the IPv6 packet header to an IPv4 packet header, the accessed IPv6 address can be changed to the source IPv4 address, where the source IPv4 address is a random public IPv4 address of the protocol version conversion platform, and the source port is A random port of the protocol version conversion platform. The converted protocol packets can access the IPv4 applet server.

步骤S102,将目标访问请求发送至小程序服务端,接收小程序服务端基于目标访问请求反馈的初始访问响应。Step S102: Send the target access request to the applet server, and receive an initial access response based on feedback from the applet server based on the target access request.

其中,目标访问请求中可以包括转换后得到的协议版本地址,通过该协议版本地址可以访问小程序服务端。Among them, the target access request may include the protocol version address obtained after conversion, through which the applet server can be accessed.

其中,在小程序服务端接收到目标访问请求后,会对目标访问请求做出响应,所以会发送基于目标访问请求反馈的初始访问响应。Among them, after the mini program server receives the target access request, it will respond to the target access request, so it will send an initial access response based on the target access request feedback.

步骤S103,基于初始访问响应对应的小程序服务端协议版本对初始访问响应进行协议版本转换,得到目标访问响应;将目标访问响应发送至小程序客户端。Step S103: Convert the initial access response to a protocol version based on the mini program server protocol version corresponding to the initial access response to obtain a target access response; send the target access response to the mini program client.

其中,小程序服务端协议版本为IPv4,基于初始访问响应对应的小程序服务端协议版本对初始访问响应进行协议版本转换,可以通过NAT技术进行协议版本的转换,具体地,将初始访问响应的第二协议版本网络报文中的网络层的第二协议版本报文头更改为第一协议版本报文头,不更改传输层的报文头除源端口以外的字段以及不更改应用层的数据,协议版本进行转换后得到的初始访问响应即为目标访问响应,通过对报文头的更改,可以对响应的协议版本地址进行更改。Among them, the mini program server protocol version is IPv4. The initial access response is converted to a protocol version based on the mini program server protocol version corresponding to the initial access response. The protocol version conversion can be performed through NAT technology. Specifically, the initial access response is converted to IPv4. The second protocol version header of the network layer in the second protocol version network message is changed to the first protocol version header, and the fields of the transport layer header except the source port are not changed and the application layer data is not changed. , the initial access response obtained after the protocol version is converted is the target access response. By changing the message header, the response protocol version address can be changed.

本发明实施例提供的小程序IPv6协议转换方法,通过初始访问请求对应的小程序客户端协议版本对初始访问请求进行协议版本转换,得到目标访问请求,再将目标访问请求发送至小程序服务端,接收小程序服务端基于目标访问请求反馈的初始访问响应,通过初始访问响应对应的小程序服务端协议版本对初始访问响应进行版本转换,得到目标访问响应,将目标访问响应发送至小程序客户端。通过对小程序客户端反馈的初始访问请求进行协议版本转换,以及对小程序服务端反馈的初始访问响应进行协议版本转换,实现了小程序服务端在不更改网络协议栈以及应用层数据的情况下,可以被小程序客户端直接访问。The mini program IPv6 protocol conversion method provided by the embodiment of the present invention converts the protocol version of the initial access request through the mini program client protocol version corresponding to the initial access request, obtains the target access request, and then sends the target access request to the mini program server. , receive the initial access response based on the target access request feedback from the mini program server, perform version conversion on the initial access response through the mini program server protocol version corresponding to the initial access response, obtain the target access response, and send the target access response to the mini program client end. By converting the protocol version of the initial access request fed back by the mini program client, and converting the protocol version of the initial access response fed back by the mini program server, the mini program server is realized without changing the network protocol stack and application layer data. , can be directly accessed by the mini program client.

实施例2Example 2

本发明实施例还提供另一种小程序IPv6协议转换方法;该方法在上述实施例方法的基础上实现;该方法重点描述基于访问请求对应的小程序客户端协议版本对访问请求进行协议版本转换,得到目标访问请求的具体实现方式。The embodiment of the present invention also provides another mini program IPv6 protocol conversion method; this method is implemented on the basis of the method of the above embodiment; this method focuses on describing the protocol version conversion of the access request based on the mini program client protocol version corresponding to the access request , get the specific implementation method of the target access request.

图2为本发明实施例提供的另一种小程序IPv6协议转换方法的流程图,如图2所示,该小程序IPv6协议转换方法可以包括如下步骤:Figure 2 is a flow chart of another applet IPv6 protocol conversion method provided by an embodiment of the present invention. As shown in Figure 2, the applet IPv6 protocol conversion method may include the following steps:

步骤S201,判断是否存在进行协议版本转换的通信流。Step S201: Determine whether there is a communication flow for protocol version conversion.

可以通过第一协议版本网络报文的四元组查找是否存在一条NAT64转换的通信流,例如第一协议版本网络报文的四元组可以是IPv6网络报文的四元组,其中,四元组包括源IP(Internet Protocol,网际互联协议)、源端口、目的IP和目的端口。具体地,若存在与该四元组中的信息对应的通信流,则可以认为存在进行协议版本转换的通信流。You can search whether there is a NAT64-converted communication flow through the quadruple of the first protocol version network message. For example, the quadruple of the first protocol version network message can be the quadruple of the IPv6 network message, where the quadruple The group includes source IP (Internet Protocol), source port, destination IP and destination port. Specifically, if there is a communication flow corresponding to the information in the four-tuple, it can be considered that there is a communication flow for protocol version conversion.

示例性地,在实际应用过程中,若步骤S201的判断结果为是,即存在进行协议版本转换的通信流,则执行步骤S202,若步骤S201的判断结果为否,即不存在进行协议版本转换的通信流,则执行步骤S203。For example, in the actual application process, if the judgment result of step S201 is yes, that is, there is a communication flow for protocol version conversion, then step S202 is executed. If the judgment result of step S201 is no, that is, there is no protocol version conversion. communication flow, then execute step S203.

步骤S202,基于通信流对初始访问请求进行协议版本转换,得到目标访问请求。Step S202: Convert the protocol version of the initial access request based on the communication flow to obtain the target access request.

具体地,通信流中记录有小程序客户端协议版本的四元组与小程序服务端协议版本的四元组之间的对应关系,基于通信流对初始访问请求进行协议版本转换,得到目标访问请求可以包括:基于通信流和小程序客户端协议版本的四元组确定小程序服务端协议版本的四元组;基于小程序服务端协议版本的四元组对初始访问请求进行协议版本转换,得到目标访问请求。Specifically, the communication flow records the correspondence between the four-tuple of the applet client protocol version and the four-tuple of the applet server protocol version. Based on the communication flow, the protocol version of the initial access request is converted to obtain the target access The request may include: determining a quadruple of the applet server protocol version based on the communication flow and a quadruple of the applet client protocol version; performing protocol version conversion on the initial access request based on a quadruple of the applet server protocol version, Get target access request.

其中,在DNS(Domain Name Syste,域名系统)服务器上,会给小程序服务端的域名添加AAAA记录,该AAAA记录包括协议版本转换平台提供的协议版本地址,该协议版本地址为初始访问请求中小程序客户端对小程序服务端域名的协议版本地址进行访问请求的地址,例如,在DNS权威服务器上,会在IPv4小程序服务端的域名中添加了AAAA记录,该AAAA记录中记录了IPv6小程序客户端要访问的IPv6地址与该IPv4小程序服务端的域名的地址的映射关系,所以可以理解的是,每个服务端的域名的协议版本地址与客户端要访问的协议版本地址都有唯一映射关系。Among them, on the DNS (Domain Name System, Domain Name System) server, an AAAA record will be added to the domain name of the mini program server. The AAAA record includes the protocol version address provided by the protocol version conversion platform. The protocol version address is the initial access request for the mini program. The address of the client's access request to the protocol version address of the mini program server domain name. For example, on the DNS authoritative server, an AAAA record will be added to the domain name of the IPv4 mini program server. The IPv6 mini program client is recorded in this AAAA record. There is a mapping relationship between the IPv6 address that the client wants to access and the domain name address of the IPv4 applet server. Therefore, it can be understood that the protocol version address of the domain name of each server has a unique mapping relationship with the protocol version address that the client wants to access.

其中,协议版本转换平台可以支持IPv4协议栈、IPv6协议栈、公网IPv4网络以及公网IPv6网络。Among them, the protocol version conversion platform can support IPv4 protocol stack, IPv6 protocol stack, public IPv4 network and public IPv6 network.

步骤S203,确定小程序服务端对应的协议版本地址。Step S203: Determine the protocol version address corresponding to the applet server.

其中,协议版本转换平台中记录了小程序客户端要访问的协议版本地址和小程序服务端对应的协议版本地址的映射关系,通过该映射关系可以确定小程序服务端对应的协议版本地址。Among them, the protocol version conversion platform records the mapping relationship between the protocol version address to be accessed by the mini program client and the protocol version address corresponding to the mini program server. Through this mapping relationship, the protocol version address corresponding to the mini program server can be determined.

例如,协议版本转换平台记录了IPv6小程序客户端要访问的IPv6地址和IPv4小程序服务端的IPv4地址的映射关系。For example, the protocol version conversion platform records the mapping relationship between the IPv6 address to be accessed by the IPv6 applet client and the IPv4 address of the IPv4 applet server.

步骤S204,基于小程序服务端对应的协议版本地址对初始访问请求进行协议版本转换,得到目标访问请求,并建立基于客户端协议版本的四元组与服务端协议版本的四元组的通信流。Step S204, perform protocol version conversion on the initial access request based on the protocol version address corresponding to the mini program server, obtain the target access request, and establish a communication flow based on the quadruple of the client protocol version and the quadruple of the server protocol version. .

具体地,基于小程序服务端对应的协议版本地址对初始访问请求进行协议版本转换,得到目标访问请求可以包括:基于小程序服务端对应的协议版本地址对小程序客户端协议版本的四元组进行转换,确定小程序服务端协议版本的四元组;基于小程序服务端协议版本的四元组对初始访问请求进行协议版本转换,得到目标访问请求。Specifically, performing protocol version conversion on the initial access request based on the protocol version address corresponding to the mini program server, and obtaining the target access request may include: converting a four-tuple of the protocol version of the mini program client based on the protocol version address corresponding to the mini program server. Convert to determine the quadruple of the mini program server protocol version; perform protocol version conversion on the initial access request based on the quadruple of the mini program server protocol version to obtain the target access request.

例如,小程序服务端对应的协议版本地址可以是IPv4小程序服务端对应的IPv4地址,小程序客户端协议版本的四元组为IPv6网络报文的四元组,小程序服务端协议版本的四元组为转换后IPv4网络报文的四元组,其中,四元组中的信息均可以利用NAT技术进行转换,上述实施例已经进行详细描述,此处不作赘述。For example, the protocol version address corresponding to the mini program server can be the IPv4 address corresponding to the IPv4 mini program server. The four-tuple of the protocol version of the mini program client is the quadruple of the IPv6 network message. The protocol version of the mini program server is The four-tuple is a four-tuple of the converted IPv4 network message, in which the information in the four-tuple can be converted using NAT technology. The above embodiment has been described in detail and will not be described again here.

其中,可以通过小程序服务端协议版本的四元组以及转换前小程序客户端协议版本的四元组建立一条NAT64转换的通信流,通过该通信流对初始访问请求进行协议版本转换,得到目标访问请求。Among them, a communication flow of NAT64 conversion can be established through the quadruple of the mini program server protocol version and the quadruple of the mini program client protocol version before conversion, and the protocol version of the initial access request is converted through this communication flow to obtain the target Access request.

其中,转换前小程序客户端协议版本的四元组为IPv6网络报文的四元组。Among them, the four-tuple of the applet client protocol version before conversion is the four-tuple of the IPv6 network message.

本发明实施例提供的小程序IPv6协议转换方法,通过在存在进行协议版本转换的通信流时,基于该通信流对初始访问请求进行协议版本转换,以及在不存在进行协议版本转换的通信流时,基于小程序服务端协议版本的四元组以及转换前小程序客户端协议版本的四元组建立一条通信流,再基于该通信流对初始访问请求进行协议版本转换,保证了初始访问请求的顺利转换,以及在不更改网络协议栈以及应用层数据的情况下可以使得小程序服务端接收到初始访问请求。The applet IPv6 protocol conversion method provided by the embodiment of the present invention performs protocol version conversion on the initial access request based on the communication flow when there is a communication flow for protocol version conversion, and when there is no communication flow for protocol version conversion. , establish a communication flow based on the four-tuple of the applet server protocol version and the four-tuple of the applet client protocol version before conversion, and then perform protocol version conversion on the initial access request based on this communication flow, ensuring that the initial access request is Smooth conversion allows the mini program server to receive the initial access request without changing the network protocol stack and application layer data.

实施例3Example 3

本发明实施例还提供另一种小程序IPv6协议转换方法;该方法在上述实施例方法的基础上实现;该方法重点描述基于初始访问响应对应的小程序服务端协议版本对初始访问响应进行协议版本转换,得到目标访问响应的具体实现方式。Embodiments of the present invention also provide another mini program IPv6 protocol conversion method; this method is implemented on the basis of the method in the above embodiment; this method focuses on protocolizing the initial access response based on the mini program server protocol version corresponding to the initial access response. Version conversion to obtain the specific implementation method of the target access response.

图3为本发明实施例提供的另一种小程序IPv6协议转换方法的流程图,如图3所示,该小程序IPv6协议转换方法可以包括如下步骤:Figure 3 is a flow chart of another applet IPv6 protocol conversion method provided by an embodiment of the present invention. As shown in Figure 3, the applet IPv6 protocol conversion method may include the following steps:

步骤S301,确定是否存在小程序客户端协议版本与小程序服务端协议版本的通信流。Step S301: Determine whether there is a communication flow between the applet client protocol version and the applet server protocol version.

其中,可以通过第一协议版本响应网络报文的四元组查找是否存在一条NAT64转换的通信流,例如第一协议版本响应网络报文的四元组可以是IPv4小程序服务端的响应IPv4网络报文的四元组。Among them, the four-tuple of the response network message of the first protocol version can be used to find whether there is a NAT64 converted communication flow. For example, the four-tuple of the response network message of the first protocol version can be the response IPv4 network message of the IPv4 applet server. Quadruple of text.

步骤S302,若存在,则基于通信流对初始访问响应进行协议版本转换,得到目标访问响应。Step S302: If it exists, perform protocol version conversion on the initial access response based on the communication flow to obtain the target access response.

具体地,基于通信流对初始访问响应进行协议版本转换,得到目标访问响应可以包括:基于通信流和小程序服务端协议版本的四元组确定小程序客户端协议版本的四元组;基于小程序客户端协议版本的四元组对初始访问响应进行协议版本转换,得到目标访问响应。Specifically, performing protocol version conversion on the initial access response based on the communication flow to obtain the target access response may include: determining the four-tuple of the applet client protocol version based on the communication flow and the four-tuple of the applet server protocol version; The program client protocol version quadruple converts the protocol version of the initial access response to obtain the target access response.

其中,基于小程序服务端协议版本的四元组确定是否存在匹配的通信流;若存在,则基于该通信流基于小程序客户端协议版本的四元组对初始访问响应进行协议版本转换,得到目标访问响应;若不存在,则可以认为该初始访问响应与目标访问请求并不对应,则将该初始访问响应丢弃。Among them, it is determined whether there is a matching communication flow based on the four-tuple of the applet server protocol version; if there is a matching communication flow, the protocol version of the initial access response is converted based on the communication flow based on the four-tuple of the applet client protocol version, and we get Target access response; if it does not exist, it can be considered that the initial access response does not correspond to the target access request, and the initial access response will be discarded.

需要说明的是将初始访问响应进行协议版本转换得到目标访问响应的过程,与将初始访问请求进行协议版本转换得到目标访问请求的过程类似,具体可以参考上述实施例的具体描述。It should be noted that the process of converting the protocol version of the initial access response to obtain the target access response is similar to the process of converting the protocol version of the initial access request to obtain the target access request. For details, please refer to the detailed description of the above embodiment.

本发明实施例提供的小程序IPv6协议转换方法,通过在存在小程序客户端协议版本与小程序服务端协议版本的通信流时对初始访问响应进行转换,可以对目标访问请求进行反馈,实现在不更改网络协议栈以及应用层数据的情况下完成小程序客户端对小程序服务端的访问,在不存在小程序客户端协议版本与小程序服务端协议版本的通信流时对初始访问响应进行丢弃,保证了目标访问请求与目标访问响应的对应性,避免了小程序客户端接收到与目标访问请求无关的访问响应。The mini program IPv6 protocol conversion method provided by the embodiment of the present invention can provide feedback to the target access request by converting the initial access response when there is a communication flow between the mini program client protocol version and the mini program server protocol version. Complete the applet client's access to the applet server without changing the network protocol stack and application layer data, and discard the initial access response when there is no communication flow between the applet client protocol version and the applet server protocol version. , ensuring the correspondence between the target access request and the target access response, and preventing the applet client from receiving an access response that is unrelated to the target access request.

实施例4Example 4

对应于上述方法实施例,本发明实施例提供了一种小程序IPv6协议转换装置,应用于协议版本为IPv6的小程序客户端和协议版本为IPv4的小程序服务端的协议版本转换场景,图4为本发明实施例提供的一种小程序IPv6协议转换装置的结构示意图,如图4所示,该小程序IPv6协议转换装置可以包括:Corresponding to the above method embodiments, embodiments of the present invention provide a mini program IPv6 protocol conversion device, which is applied to the protocol version conversion scenario of the mini program client whose protocol version is IPv6 and the mini program server whose protocol version is IPv4, Figure 4 This is a schematic structural diagram of a mini program IPv6 protocol conversion device provided by an embodiment of the present invention, as shown in Figure 4. The mini program IPv6 protocol conversion device may include:

协议版本转换模块401,用于接收小程序客户端反馈的初始访问请求;基于初始访问请求对应的小程序客户端协议版本对初始访问请求进行协议版本转换,得到目标访问请求;小程序客户端协议版本为IPv6。The protocol version conversion module 401 is used to receive the initial access request fed back by the applet client; perform protocol version conversion on the initial access request based on the applet client protocol version corresponding to the initial access request, and obtain the target access request; the applet client protocol The version is IPv6.

初始访问响应接收模块402,用于将目标访问请求发送至小程序服务端,接收小程序服务端基于目标访问请求反馈的初始访问响应。The initial access response receiving module 402 is used to send the target access request to the applet server, and receive the initial access response based on the feedback of the target access request from the applet server.

目标访问响应发送模块403,用于基于初始访问响应对应的小程序服务端协议版本对初始访问响应进行协议版本转换,得到目标访问响应;将目标访问响应发送至小程序客户端;小程序服务端协议版本为IPv4。The target access response sending module 403 is used to convert the initial access response to a protocol version based on the applet server protocol version corresponding to the initial access response to obtain a target access response; send the target access response to the applet client; the applet server The protocol version is IPv4.

本发明实施例提供的小程序IPv6协议转换装置,可以通过初始访问请求对应的小程序客户端协议版本对初始访问请求进行协议版本转换,得到目标访问请求,再将目标访问请求发送至小程序服务端,接收小程序服务端基于目标访问请求反馈的初始访问响应,通过初始访问响应对应的小程序服务端协议版本对初始访问响应进行版本转换,得到目标访问响应,将目标访问响应发送至小程序客户端。通过对小程序客户端反馈的初始访问请求进行协议版本转换,以及对小程序服务端反馈的初始访问响应进行协议版本转换,实现了小程序服务端在不更改网络协议栈以及应用层数据的情况下,可以被小程序客户端直接访问。The applet IPv6 protocol conversion device provided by the embodiment of the present invention can convert the protocol version of the initial access request through the applet client protocol version corresponding to the initial access request, obtain the target access request, and then send the target access request to the applet service. terminal, receives the initial access response based on the target access request feedback from the mini program server, performs version conversion on the initial access response through the mini program server protocol version corresponding to the initial access response, obtains the target access response, and sends the target access response to the mini program client. By converting the protocol version of the initial access request fed back by the mini program client, and converting the protocol version of the initial access response fed back by the mini program server, the mini program server is realized without changing the network protocol stack and application layer data. , can be directly accessed by the mini program client.

在一些实施例中,协议版本转换模块,还用于确定是否存在进行协议版本转换的通信流;若存在,则基于通信流对初始访问请求进行协议版本转换,得到目标访问请求。In some embodiments, the protocol version conversion module is also used to determine whether there is a communication flow for protocol version conversion; if there is, perform protocol version conversion on the initial access request based on the communication flow to obtain the target access request.

在一些实施例中,通信流中记录有小程序客户端协议版本的四元组与小程序服务端协议版本的四元组之间的对应关系,协议版本转换模块,还用于基于通信流和小程序客户端协议版本的四元组确定小程序服务端协议版本的四元组;基于小程序服务端协议版本的四元组对初始访问请求进行协议版本转换,得到目标访问请求。In some embodiments, the correspondence between the four-tuple of the applet client protocol version and the four-tuple of the applet server protocol version is recorded in the communication flow. The protocol version conversion module is also used to convert the protocol version based on the communication flow and The quadruple of the mini program client protocol version determines the quadruple of the mini program server protocol version; based on the quadruple of the mini program server protocol version, the protocol version of the initial access request is converted to obtain the target access request.

在一些实施例中,协议版本转换模块,还用于若不存在,则确定小程序服务端对应的协议版本地址;基于小程序服务端对应的协议版本地址对初始访问请求进行协议版本转换,得到目标访问请求;并建立基于小程序客户端协议版本的四元组与小程序服务端协议版本的四元组的通信流。In some embodiments, the protocol version conversion module is also used to determine the protocol version address corresponding to the mini program server if it does not exist; perform protocol version conversion on the initial access request based on the protocol version address corresponding to the mini program server, to obtain Target access request; and establish a communication flow based on the four-tuple of the applet client protocol version and the four-tuple of the applet server protocol version.

在一些实施例中,协议版本转换模块,还用于版本的四元组;基于小程序服务端协议版本的四元组对初始访问请求进行协议版本转换,得到目标访问请求。In some embodiments, the protocol version conversion module is also used for version quadruples; it performs protocol version conversion on the initial access request based on the quadruples of the applet server protocol version to obtain the target access request.

在一些实施例中,目标访问响应发送模块,还用于确定是否存在小程序客户端协议版本与小程序服务端协议版本的通信流;若存在,则基于通信流对初始访问响应进行协议版本转换,得到目标访问响应。In some embodiments, the target access response sending module is also used to determine whether there is a communication flow between the applet client protocol version and the applet server protocol version; if there is, perform protocol version conversion on the initial access response based on the communication flow. , get the target access response.

在一些实施例中,目标访问响应发送模块,还用于基于通信流和小程序服务端协议版本的四元组确定小程序客户端协议版本的四元组;基于小程序客户端协议版本的四元组对初始访问响应进行协议版本转换,得到目标访问响应。In some embodiments, the target access response sending module is also used to determine the four-tuple of the applet client protocol version based on the communication flow and the four-tuple of the applet server protocol version; The tuple performs protocol version conversion on the initial access response to obtain the target access response.

本发明实施例所提供的装置,其实现原理及产生的技术效果和前述方法实施例相同,为简要描述,装置实施例部分未提及之处,可参考前述方法实施例中相应内容。The implementation principles and technical effects of the device provided by the embodiments of the present invention are the same as those of the foregoing method embodiments. This is a brief description. For matters not mentioned in the device embodiments, please refer to the corresponding content in the foregoing method embodiments.

实施例5Example 5

本发明实施例还提供了一种电子设备,用于运行上述小程序IPv6协议转换方法;参见图5所示的一种电子设备的结构示意图,该电子设备包括存储器500和处理器501,其中,存储器500用于存储一条或多条计算机指令,一条或多条计算机指令被处理器501执行,以实现上述小程序IPv6协议转换方法。An embodiment of the present invention also provides an electronic device for running the above-mentioned applet IPv6 protocol conversion method; see Figure 5 for a schematic structural diagram of an electronic device. The electronic device includes a memory 500 and a processor 501, wherein, The memory 500 is used to store one or more computer instructions, and the one or more computer instructions are executed by the processor 501 to implement the above-mentioned applet IPv6 protocol conversion method.

进一步地,图5所示的电子设备还包括总线502和通信接口503,处理器501、通信接口503和存储器500通过总线502连接。Further, the electronic device shown in FIG. 5 also includes a bus 502 and a communication interface 503. The processor 501, the communication interface 503 and the memory 500 are connected through the bus 502.

其中,存储器500可能包含高速随机存取存储器(RAM,Random Access Memory),也可能还包括非不稳定的存储器(non-volatile memory),例如至少一个磁盘存储器。通过至少一个通信接口503(可以是有线或者无线)实现该系统网元与至少一个其他网元之间的通信连接,可以使用互联网,广域网,本地网,城域网等。总线502可以是ISA总线、PCI总线或EISA总线等。总线可以分为地址总线、数据总线、控制总线等。为便于表示,图4中仅用一个双向箭头表示,但并不表示仅有一根总线或一种类型的总线。The memory 500 may include high-speed random access memory (RAM), or may also include non-volatile memory (non-volatile memory), such as at least one disk memory. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 503 (which can be wired or wireless), and the Internet, wide area network, local network, metropolitan area network, etc. can be used. The bus 502 may be an ISA bus, a PCI bus, an EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of presentation, only one bidirectional arrow is used in Figure 4, but it does not mean that there is only one bus or one type of bus.

处理器501可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器501中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器501可以是通用处理器,包括中央处理器(Central Processing Unit,简称CPU)、网络处理器(Network Processor,简称NP)等;还可以是数字信号处理器(DigitalSignal Processor,简称DSP)、专用集成电路(Application Specific IntegratedCircuit,简称ASIC)、现场可编程门阵列(Field-Programmable Gate Array,简称FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本发明实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本发明实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器500,处理器501读取存储器500中的信息,结合其硬件完成前述实施例的方法的步骤。The processor 501 may be an integrated circuit chip with signal processing capabilities. During the implementation process, each step of the above method can be completed by instructions in the form of hardware integrated logic circuits or software in the processor 501 . The above-mentioned processor 501 can be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU for short), a network processor (Network Processor, NP for short), etc.; it can also be a digital signal processor (DigitalSignal Processor, DSP for short). , Application Specific Integrated Circuit (ASIC for short), Field-Programmable Gate Array (FPGA for short) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components. Each method, step and logical block diagram disclosed in the embodiment of the present invention can be implemented or executed. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present invention can be directly implemented by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module can be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other mature storage media in this field. The storage medium is located in the memory 500. The processor 501 reads the information in the memory 500 and completes the steps of the method in the aforementioned embodiment in combination with its hardware.

本发明实施例还提供了一种计算机可读存储介质,该计算机可读存储介质存储有计算机可执行指令,该计算机可执行指令在被处理器调用和执行时,计算机可执行指令促使处理器实现上述小程序IPv6协议转换方法,具体实现可参见方法实施例,在此不再赘述。Embodiments of the present invention also provide a computer-readable storage medium that stores computer-executable instructions. When the computer-executable instructions are called and executed by the processor, the computer-executable instructions prompt the processor to implement The specific implementation of the IPv6 protocol conversion method of the above applet can be found in the method embodiments, and will not be described again here.

本发明实施例所提供的进行小程序IPv6协议转换方法的计算机程序产品,包括存储了处理器可执行的非易失的程序代码的计算机可读存储介质,所述程序代码包括的指令可用于执行前面方法实施例中所述的方法,具体实现可参见方法实施例,在此不再赘述。The computer program product for performing an IPv6 protocol conversion method for an applet provided by an embodiment of the present invention includes a computer-readable storage medium that stores non-volatile program code executable by a processor. The instructions included in the program code can be used to execute For the method described in the previous method embodiment, please refer to the method embodiment for specific implementation, and will not be described again here.

所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be described again here.

在本发明所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,又例如,多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些通信接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or can be integrated into another system, or some features can be ignored, or not implemented. On the other hand, the coupling or direct coupling or communication connection between each other shown or discussed may be through some communication interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or they may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit.

所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个处理器可执行的非易失的计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present invention essentially or the part that contributes to the existing technology or the part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program code. .

最后应说明的是:以上所述实施例,仅为本发明的具体实施方式,用以说明本发明的技术方案,而非对其限制,本发明的保护范围并不局限于此,尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,其依然可以对前述实施例所记载的技术方案进行修改或可轻易想到变化,或者对其中部分技术特征进行等同替换;而这些修改、变化或者替换,并不使相应技术方案的本质脱离本发明实施例技术方案的精神和范围,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以权利要求的保护范围为准。Finally, it should be noted that the above-mentioned embodiments are only specific implementations of the present invention and are used to illustrate the technical solutions of the present invention rather than to limit them. The protection scope of the present invention is not limited thereto. Although refer to the foregoing The embodiments illustrate the present invention in detail. Those of ordinary skill in the art should understand that any person familiar with the technical field can still modify the technical solutions recorded in the foregoing embodiments within the technical scope disclosed by the present invention. It may be easy to think of changes, or equivalent substitutions of some of the technical features; and these modifications, changes or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and they should all be included in the present invention. within the scope of protection. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.

Claims (10)

1.一种小程序IPv6协议转换方法,其特征在于,应用于协议版本为IPv6的小程序客户端和协议版本为IPv4的小程序服务端的协议版本转换场景,所述方法包括:1. A mini program IPv6 protocol conversion method, characterized in that it is applied to the protocol version conversion scenario of a mini program client whose protocol version is IPv6 and a mini program server whose protocol version is IPv4. The method includes: 接收所述小程序客户端反馈的初始访问请求;基于所述初始访问请求对应的小程序客户端协议版本对所述初始访问请求进行协议版本转换,得到目标访问请求;所述小程序客户端协议版本为IPv6;Receive the initial access request fed back by the applet client; perform protocol version conversion on the initial access request based on the applet client protocol version corresponding to the initial access request to obtain a target access request; the applet client protocol The version is IPv6; 将所述目标访问请求发送至所述小程序服务端,接收所述小程序服务端基于所述目标访问请求反馈的初始访问响应;Send the target access request to the applet server, and receive an initial access response fed back by the applet server based on the target access request; 基于所述初始访问响应对应的小程序服务端协议版本对所述初始访问响应进行协议版本转换,得到目标访问响应;将所述目标访问响应发送至所述小程序客户端;所述小程序服务端协议版本为IPv4。Perform protocol version conversion on the initial access response based on the applet server protocol version corresponding to the initial access response to obtain a target access response; send the target access response to the applet client; the applet service The end protocol version is IPv4. 2.根据权利要求1所述的方法,其特征在于,所述基于所述初始访问请求对应的小程序客户端协议版本对所述初始访问请求进行协议版本转换,得到目标访问请求,包括:2. The method according to claim 1, characterized in that the protocol version conversion is performed on the initial access request based on the applet client protocol version corresponding to the initial access request to obtain a target access request, including: 确定是否存在进行协议版本转换的通信流;Determine whether there is a communication flow for protocol version conversion; 若存在,则基于所述通信流对所述初始访问请求进行协议版本转换,得到目标访问请求。If it exists, perform protocol version conversion on the initial access request based on the communication flow to obtain a target access request. 3.根据权利要求2所述的方法,其特征在于,所述通信流中记录有小程序客户端协议版本的四元组与小程序服务端协议版本的四元组之间的对应关系;所述基于所述通信流对所述初始访问请求进行协议版本转换,得到目标访问请求,包括:3. The method according to claim 2, characterized in that the correspondence between the four-tuple of the applet client protocol version and the four-tuple of the applet server protocol version is recorded in the communication flow; The step of performing protocol version conversion on the initial access request based on the communication flow to obtain a target access request includes: 基于所述通信流和所述小程序客户端协议版本的四元组确定所述小程序服务端协议版本的四元组;Determine the four-tuple of the applet server protocol version based on the communication flow and the four-tuple of the applet client protocol version; 基于所述小程序服务端协议版本的四元组对所述初始访问请求进行协议版本转换,得到目标访问请求。The initial access request is converted to a protocol version based on the quadruple of the applet server protocol version to obtain a target access request. 4.根据权利要求2所述的方法,其特征在于,确定是否存在进行协议版本转换的通信流之后,所述方法还包括:4. The method according to claim 2, characterized in that after determining whether there is a communication flow for protocol version conversion, the method further includes: 若不存在,则确定所述小程序服务端对应的协议版本地址;If it does not exist, determine the protocol version address corresponding to the applet server; 基于所述小程序服务端对应的协议版本地址对所述初始访问请求进行协议版本转换,得到目标访问请求,并建立基于所述小程序客户端协议版本的四元组与所述小程序服务端协议版本的四元组的通信流。Perform protocol version conversion on the initial access request based on the protocol version address corresponding to the mini program server, obtain the target access request, and establish a quadruple based on the protocol version of the mini program client and the mini program server Communication flow of four-tuple of protocol versions. 5.根据权利要求4所述的方法,其特征在于,所述基于所述小程序服务端对应的协议版本地址对所述初始访问请求进行协议版本转换,得到目标访问请求,包括:5. The method according to claim 4, characterized in that the protocol version conversion is performed on the initial access request based on the protocol version address corresponding to the applet server to obtain the target access request, including: 基于所述小程序服务端对应的协议版本地址对小程序客户端协议版本的四元组进行转换,确定小程序服务端协议版本的四元组;Convert the four-tuple of the protocol version of the mini-program client based on the protocol version address corresponding to the mini-program server, and determine the quad-tuple of the protocol version of the mini-program server; 基于所述小程序服务端协议版本的四元组对所述初始访问请求进行协议版本转换,得到目标访问请求。The initial access request is converted to a protocol version based on the quadruple of the applet server protocol version to obtain a target access request. 6.根据权利要求1所述的方法,其特征在于,所述基于所述初始访问响应对应的小程序服务端协议版本对所述初始访问响应进行协议版本转换,得到目标访问响应,包括:6. The method according to claim 1, characterized in that the protocol version conversion is performed on the initial access response based on the applet server protocol version corresponding to the initial access response to obtain a target access response, including: 确定是否存在小程序客户端协议版本与小程序服务端协议版本的通信流;Determine whether there is a communication flow between the mini program client protocol version and the mini program server protocol version; 若存在,则基于所述通信流对所述初始访问响应进行协议版本转换,得到目标访问响应。If it exists, perform protocol version conversion on the initial access response based on the communication flow to obtain a target access response. 7.根据权利要求6所述的方法,其特征在于,所述基于所述通信流对所述初始访问响应进行协议版本转换,得到目标访问响应,包括:7. The method according to claim 6, wherein the step of converting the initial access response to a protocol version based on the communication flow to obtain a target access response includes: 基于所述通信流和小程序服务端协议版本的四元组确定小程序客户端协议版本的四元组;Determine the four-tuple of the applet client protocol version based on the communication flow and the four-tuple of the applet server protocol version; 基于小程序客户端协议版本的四元组对所述初始访问响应进行协议版本转换,得到目标访问响应。The initial access response is converted to a protocol version based on the quadruple of the applet client protocol version to obtain a target access response. 8.一种小程序IPv6协议转换装置,其特征在于,应用于协议版本为IPv6的小程序客户端和协议版本为IPv4的小程序服务端的协议版本转换场景,所述装置包括:8. A mini program IPv6 protocol conversion device, characterized in that it is applied to the protocol version conversion scenario of the mini program client whose protocol version is IPv6 and the mini program server whose protocol version is IPv4. The device includes: 协议版本转换模块,用于接收所述小程序客户端反馈的初始访问请求;基于所述初始访问请求对应的小程序客户端协议版本对所述初始访问请求进行协议版本转换,得到目标访问请求;所述小程序客户端协议版本为IPv6;A protocol version conversion module, configured to receive an initial access request fed back by the mini program client; perform protocol version conversion on the initial access request based on the mini program client protocol version corresponding to the initial access request to obtain a target access request; The mini program client protocol version is IPv6; 初始访问响应接收模块,用于将所述目标访问请求发送至所述小程序服务端,接收所述小程序服务端基于所述目标访问请求反馈的初始访问响应;An initial access response receiving module, configured to send the target access request to the applet server, and receive an initial access response fed back by the applet server based on the target access request; 目标访问响应发送模块,用于基于所述初始访问响应对应的小程序服务端协议版本对所述初始访问响应进行协议版本转换,得到目标访问响应;将所述目标访问响应发送至所述小程序客户端;所述小程序服务端协议版本为IPv4。A target access response sending module, configured to convert the initial access response to a protocol version based on the applet server protocol version corresponding to the initial access response to obtain a target access response; send the target access response to the applet Client; the protocol version of the mini program server is IPv4. 9.一种电子设备,其特征在于,包括处理器和存储器,所述存储器存储有能够被所述处理器执行的计算机可执行指令,所述处理器执行所述计算机可执行指令以实现权利要求1至7任一项所述的小程序IPv6协议转换方法。9. An electronic device, characterized in that it includes a processor and a memory, the memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement the claims The mini program IPv6 protocol conversion method described in any one of 1 to 7. 10.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机可执行指令,所述计算机可执行指令在被处理器调用和执行时,所述计算机可执行指令促使处理器实现权利要求1至7任一项所述的小程序IPv6协议转换方法。10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt The processor implements the applet IPv6 protocol conversion method described in any one of claims 1 to 7.
CN202310814823.7A 2023-07-04 2023-07-04 Mini program IPv6 protocol conversion method, device and electronic equipment Pending CN116800858A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310814823.7A CN116800858A (en) 2023-07-04 2023-07-04 Mini program IPv6 protocol conversion method, device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310814823.7A CN116800858A (en) 2023-07-04 2023-07-04 Mini program IPv6 protocol conversion method, device and electronic equipment

Publications (1)

Publication Number Publication Date
CN116800858A true CN116800858A (en) 2023-09-22

Family

ID=88043561

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310814823.7A Pending CN116800858A (en) 2023-07-04 2023-07-04 Mini program IPv6 protocol conversion method, device and electronic equipment

Country Status (1)

Country Link
CN (1) CN116800858A (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1747457A (en) * 2005-09-09 2006-03-15 北京中星微电子有限公司 A method of cross-gateway communication
CN1960316A (en) * 2005-11-04 2007-05-09 华为技术有限公司 Network address conversion method for segmented messages
US20130103805A1 (en) * 2011-07-29 2013-04-25 3Crowd Technologies, Inc. Facilitating content accessibility via different communication formats
CN108011989A (en) * 2017-11-30 2018-05-08 杭州盈高科技有限公司 A kind of reorientation method and device
CN109951493A (en) * 2019-03-29 2019-06-28 深圳市信锐网科技术有限公司 A kind of network intercommunication method, device, equipment and storage medium
CN110677405A (en) * 2019-09-26 2020-01-10 北京金山云网络技术有限公司 Data processing method and device, electronic equipment and storage medium
CN115225606A (en) * 2022-07-11 2022-10-21 上海道客网络科技有限公司 Domain name access method and system of cross-network protocol of container cloud platform
CN115550044A (en) * 2022-10-09 2022-12-30 浙江中控技术股份有限公司 Message forwarding method, device, equipment and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1747457A (en) * 2005-09-09 2006-03-15 北京中星微电子有限公司 A method of cross-gateway communication
CN1960316A (en) * 2005-11-04 2007-05-09 华为技术有限公司 Network address conversion method for segmented messages
US20130103805A1 (en) * 2011-07-29 2013-04-25 3Crowd Technologies, Inc. Facilitating content accessibility via different communication formats
CN108011989A (en) * 2017-11-30 2018-05-08 杭州盈高科技有限公司 A kind of reorientation method and device
CN109951493A (en) * 2019-03-29 2019-06-28 深圳市信锐网科技术有限公司 A kind of network intercommunication method, device, equipment and storage medium
CN110677405A (en) * 2019-09-26 2020-01-10 北京金山云网络技术有限公司 Data processing method and device, electronic equipment and storage medium
CN115225606A (en) * 2022-07-11 2022-10-21 上海道客网络科技有限公司 Domain name access method and system of cross-network protocol of container cloud platform
CN115550044A (en) * 2022-10-09 2022-12-30 浙江中控技术股份有限公司 Message forwarding method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
JP6050259B2 (en) Method and system for providing Internet Protocol (IP) data communication in an NFC peer-to-peer communication environment
CN113824642B (en) Method for sending message, network device and computer-readable storage medium
CN112152940B (en) Message processing method, device and system
US11418951B2 (en) Method for identifying encrypted data stream, device, storage medium and system
CN112039905B (en) Reverse connection-based network communication method and device, electronic equipment and medium
WO2019062593A1 (en) Packet transmission method and device, and computer readable storage medium
WO2021197375A1 (en) Roaming networking processing method, apparatus, mobile terminal and readable storage medium
WO2014101891A1 (en) Method and device for configuring ip address
CN102036422A (en) Method, device and system for acquiring IP address
CN102547553B (en) Method, system and device for accessing service based on wireless application protocol (WAP)
CN102984138B (en) A kind of methods, devices and systems obtaining object
CN102857547B (en) The method and apparatus of distributed caching
CN102057719B (en) Communication system
CN104702707B (en) A kind of data processing method and device
CN114866472B (en) A method and system for realizing open source community access in a multimodal network
CN111711705A (en) Method and device for realizing network connection based on proxy node for bidirectional NAT
CN116800858A (en) Mini program IPv6 protocol conversion method, device and electronic equipment
CN107426263A (en) Sending, receiving method and device, the electronic equipment of packet
WO2019076025A1 (en) Method for identifying encrypted data stream, device, storage medium, and system
CN116192797B (en) Address request message answering method, device, electronic equipment and storage medium
WO2025036184A1 (en) Dns information processing method and apparatus, address overlapping processing method and apparatus, and communication device
CN107612831B (en) A method and device for transmitting data message for accessing source station
US20240048527A1 (en) Information processing method, device, related apparatus and storage medium
CN113595848B (en) Communication tunnel establishing method, device, equipment and storage medium
CN109245970B (en) Message forwarding method, device and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination