Access method and device based on port mapping, electronic equipment and storage medium
By dynamically creating a target mapping port between the target server and the target client, the problems of complex access process and slow response in traditional remote access technologies are solved, and efficient access to the target client is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- WUXI YANQI INTELLIGENT TECHNOLOGY CO LTD
- Filing Date
- 2026-01-07
- Publication Date
- 2026-04-17
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional remote access technologies suffer from complex access processes and slow response times, especially when external users access clients through servers.
After establishing a communication connection between the target server and the target client, the target mapping port is dynamically determined, and a mapping relationship is established based on the target access port to realize the forwarding of the target access request. The target mapping port is an idle external port, and the target access port provides data access services.
It breaks through the limitations of static port mapping, enabling dynamic deployment and temporary access to target client services, reducing the complexity of the access process and operation and maintenance, and improving response efficiency.
Smart Images

Figure CN121887485A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of network communication technology, and in particular to an access method, apparatus, electronic device, and storage medium based on port mapping. Background Technology
[0002] With the development of information technology, the demand for remote access and control of devices located in different locations (such as industrial controllers, data acquisition terminals, and security equipment) is increasing. Traditional remote access technology establishes a communication connection between a server and a client, allowing external users to send access requests to the server, which then forwards them to the client. However, this server-based access method suffers from complex processes and slow response times. Summary of the Invention
[0003] This invention provides a port mapping-based access method, apparatus, electronic device, and storage medium to solve the problems of complex access process and slow response when users access the client through the server.
[0004] According to one aspect of the present invention, a port mapping-based access method is provided, the method comprising:
[0005] The target mapping port on the target server is determined. The target mapping port is determined based on the target access port on the target client after a communication connection is established between the target server and the target client. The communication connection between the target server and the target client can forward access requests to the target mapping port to the target access port based on the target mapping relationship. The target mapping relationship is the mapping relationship between the target mapping port and the target access port. The target mapping port is an idle external port, and the target access port is used to provide data access services.
[0006] Obtain the target user's target access request for the target mapped port. The target access request is used to access data on the target client.
[0007] Data access is achieved by forwarding the target access request to the target client through the target server.
[0008] According to another aspect of the present invention, a port mapping-based access device is provided, the device comprising:
[0009] The first determining module is used to determine the target mapping port on the target server. The target mapping port is determined based on the target access port on the target client after a communication connection is established between the target server and the target client. The communication connection between the target server and the target client can forward access requests to the target mapping port to the target access port based on the target mapping relationship. The target mapping relationship is the mapping relationship between the target mapping port and the target access port. The target mapping port is an idle external port, and the target access port is used to provide data access services.
[0010] The first acquisition module is used to acquire the target user's target access request for the target mapped port. The target access request is used to access the data of the target client.
[0011] The first forwarding module is used to forward the target access request to the target client through the target server to achieve data access.
[0012] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0013] At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the port mapping-based access method of any embodiment of the present invention.
[0014] According to another aspect of the present invention, a computer-readable storage medium is provided that stores computer instructions for causing a processor to execute and implement the port-mapping-based access method of any embodiment of the present invention.
[0015] The technical solution of this invention determines a target mapping port on the target server. This target mapping port is determined based on the target access port on the target client after a communication connection is established between the target server and the target client. The communication connection between the target server and the target client can forward access requests to the target mapping port to the target access port based on the target mapping relationship. The target mapping relationship is a mapping relationship between the target mapping port and the target access port. The target mapping port is an idle external port. The target access port is used to provide data access services. This enables the dynamic creation of target mapping ports on the target server within the lifespan of the communication connection between the target server and the target client, breaking through the limitations of static port mapping. This facilitates dynamic deployment and temporary access to services on the target client, reducing the complexity of the access process and maintenance, and improving response efficiency. The solution also obtains the target user's target access request for the target mapping port, which is used to access data on the target client. The target server forwards the target access request to the target client to achieve data access. This allows clients who cannot directly access the port on the target client to access the target client's data through the target server.
[0016] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 A flowchart illustrating an access method based on port mapping provided in an embodiment of the present invention;
[0019] Figure 2 A flowchart illustrating another port mapping-based access method provided in an embodiment of the present invention;
[0020] Figure 3 A schematic diagram of the structure of an access system based on port mapping provided in an embodiment of the present invention;
[0021] Figure 4 A schematic diagram of the structure of an access device based on port mapping provided in an embodiment of the present invention;
[0022] Figure 5This is a schematic diagram of the structure of an electronic device implementing a port mapping-based access method, as provided in an embodiment of the present invention. Detailed Implementation
[0023] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0024] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0025] It is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and related provisions.
[0026] Figure 1 This is a flowchart illustrating a port mapping-based access method provided in an embodiment of the present invention. This embodiment is applicable to situations where a user accesses a client through a server. The method can be executed by a port mapping-based access device, which can be implemented in hardware and / or software and configured in an electronic device implementing the port mapping-based access method. Figure 1 As shown, this port mapping-based access method includes:
[0027] S101. Determine the target mapping port on the target server. The target mapping port is determined based on the target access port on the target client after a communication connection is established between the target server and the target client. The communication connection between the target server and the target client can forward access requests to the target mapping port to the target access port based on the target mapping relationship. The target mapping relationship is the mapping relationship between the target mapping port and the target access port. The target mapping port is an idle external port, and the target access port is used to provide data access services.
[0028] The target server can be a server deployed on a cloud platform. The target client can be associated with a data detection system. The data detection system can be used to acquire relevant detection data at the location of the target client. The data access service provided by the target access port can refer to the service of accessing the data acquired by the data detection system. For example, the target client can be an industrial controller. The communication connection between the target server and the target client can be established based on the communication ports on the target server and the target client.
[0029] Specifically, after establishing a communication connection between the target server and the target client, based on the target access port on the target client, an idle external port on the target server is selected and a mapping relationship is established between it and the target access port, thus obtaining the target mapped port on the target server. The target mapped port can be dynamically created on demand during the lifetime of the communication connection, overcoming the limitations of static port mapping. This facilitates dynamic deployment and temporary access to services on the target client, reducing the complexity of the access process and maintenance, and improving response efficiency.
[0030] As an optional implementation of this invention, before determining the target mapping port on the target server, the following steps A1-A2 are further included:
[0031] Step A1: The target client sends a connection establishment request to the target server. The connection establishment request carries the target client's preset authentication identifier, which is used to identify the uniqueness of the target client.
[0032] Step A2: The target server responds to the connection establishment request, verifies the preset authentication identifier carried in the connection establishment request, and establishes a communication connection between the target server and the target client after successful verification.
[0033] The preset authentication identifier can be pre-configured by the target server for the target client and stored on both the target server and the target client. The preset authentication identifier can be represented as a string. Verification of the preset authentication identifier refers to verifying its validity and availability. The connection establishment request can be a request used to instruct the establishment of a communication connection between the target server and the target client.
[0034] Specifically, when the target client starts up, it can initiate a connection establishment request to the target server, carrying a preset authentication identifier for the target client in the request. The target server then verifies the preset authentication identifier in the connection establishment request. If the verification is successful, a communication connection is established with the target client; otherwise, the connection is rejected. Establishing a communication connection only after successful verification of the preset authentication identifier enhances the security of the communication connection and facilitates the target server's management of all communication connections and mapping relationships, making it suitable for the access and management of distributed devices.
[0035] For example, a connection establishment request could be "access.example.com:9000".
[0036] As an optional implementation of this invention, the target client establishes a communication connection with the target server using a mobile communication network to provide a stable and reliable communication connection. This avoids the impact of IP address changes, local wired network fluctuations, or wireless network fluctuations on the communication connection between the target client and the target server, and is applicable to complex network environments such as industrial sites and outdoor environments.
[0037] S102. Obtain the target user's target access request for the target mapped port. The target access request is used to access the data of the target client.
[0038] Specifically, a target user refers to a client that cannot directly access the port on the target client. The target user has access rights to the data on the target client. Therefore, when a target user needs to access the data on the target client, they need to send a target access request to the target mapped port on the target server. The target server then forwards the target access request to the target client, thus enabling the target user to access the data on the target client.
[0039] S103. Data access is achieved by forwarding the target access request to the target client through the target server.
[0040] Specifically, the mapping relationship between the target mapping port and the target access port can be established. Through the communication connection between the target server and the target client, the target access request is forwarded to the target access port on the target client. Then, by responding to the target access request forwarded by the target server, the target user can access the data on the target client.
[0041] The technical solution of this invention determines a target mapping port on the target server. This target mapping port is determined based on the target access port on the target client after a communication connection is established between the target server and the target client. The communication connection between the target server and the target client can forward access requests to the target mapping port to the target access port based on the target mapping relationship. The target mapping relationship is a mapping relationship between the target mapping port and the target access port. The target mapping port is an idle external port. The target access port is used to provide data access services. This enables the dynamic creation of target mapping ports on the target server within the lifespan of the communication connection between the target server and the target client, breaking through the limitations of static port mapping. This facilitates dynamic deployment and temporary access to services on the target client, reducing the complexity of the access process and maintenance, and improving response efficiency. The solution also obtains the target user's target access request for the target mapping port, which is used to access data on the target client. The target server forwards the target access request to the target client to achieve data access. This allows clients who cannot directly access the port on the target client to access the target client's data through the target server.
[0042] Figure 2 This is a flowchart illustrating another port mapping-based access method provided by an embodiment of the present invention. The technical solution of this embodiment further optimizes the process of determining the target mapping port on the target server in the aforementioned embodiments, based on the technical solutions of the previous embodiments. Solutions not described in detail in this embodiment can be found in the above embodiments. This embodiment can be combined with various optional solutions in one or more of the above embodiments. Figure 2 As shown, this port mapping-based access method includes:
[0043] S201. After establishing a communication connection between the target server and the target client, determine the port number and protocol type of the target access port, and determine the target idle external port on the target server.
[0044] The protocol type can refer to a standardized communication protocol category used to regulate data transmission formats, interaction logic, error handling, and resource scheduling rules. The protocol type can be at least one of TCP, UDP, HTTP, and HTTPS. The protocol type of the target access port is the original protocol type that needs to be mapped in the port mapping. The target idle external port can refer to a transport layer port that is not occupied, is in an allocable state, and is capable of receiving external network access requests.
[0045] As an optional implementation of this invention, determining the port number and protocol type of the target access port includes: obtaining a port mapping request sent by the target client to the target server, and determining the port number and protocol type of the target access port from the port mapping request.
[0046] Specifically, the target client sends a port mapping request to the target server, including the port number and protocol type of the target access port in the request. The target server can then obtain the port number and protocol type of the target access port from the port mapping request, enabling the dynamic creation of the target mapped port based on the request.
[0047] For example, a port mapping request can be "ADD_MAPPING HTTP 80".
[0048] S202. Based on the port number and protocol type of the target access port, establish a mapping relationship between the target idle external port and the target access port, and use the target idle external port as the target mapping port.
[0049] Specifically, after establishing a communication connection between the target server and the target client, it is necessary to determine the port number and protocol type of the target access port, and to identify the target available external port on the target server. Then, based on the port number and protocol type of the target available external port and the target access port, a mapping relationship is established between the target available external port and the target access port. This target available external port can then be used as the target mapped port on the target server, facilitating the dynamic creation of target mapped ports. Furthermore, after deploying the target client, the target server should accommodate the need for additional port mappings without requiring any changes to the target client's configuration.
[0050] S203. Obtain the target user's target access request for the target mapped port. The target access request is used to access the data of the target client.
[0051] S204. Data access is achieved by forwarding the target access request to the target client through the target server.
[0052] As an optional implementation of this invention, obtaining the target user's target access request for the target mapped port includes: starting a target reverse proxy service on the target server, wherein the target reverse proxy service is a reverse proxy service used to listen to the target mapped port; and obtaining the target user's target access request for the target mapped port through the target reverse proxy service.
[0053] Specifically, a reverse proxy service can refer to network middleware between a target server and a target client. After creating a target mapping port on the target server, a reverse proxy service can be started on the target server to listen on the target mapping port, acting as the target reverse proxy service. The target reverse proxy service can automatically collect all access requests to the target mapping port, so that when a target user sends a target access request to the target mapping port on the target server, it can be obtained through the target reverse proxy service.
[0054] As an optional implementation of this invention, forwarding the target access request to the target client through the target server includes: based on the communication connection between the target server and the target client, forwarding the target access request to the target access port on the target client through a target reverse proxy service.
[0055] Specifically, the target reverse proxy service can also forward access requests to the target mapped port to the target access port. Therefore, after the target reverse proxy service obtains the target user's target access request for the target mapped port, it can forward the target access request to the target access port through the established communication connection between the target server and the target client, thereby enabling the target user to access data on the target client and reducing the complexity of the access process.
[0056] For example, Figure 3 This is a schematic diagram of a port mapping-based access system provided in an embodiment of the present invention. (Reference) Figure 3 This port mapping-based access system includes a target server and a target client. The target server comprises an authentication module, a connection management module, and a dynamic port mapping module. The authentication module receives connection establishment requests from the target client, verifies the preset authentication identifier carried in the connection establishment request, and establishes a communication connection with the target client upon successful verification. The connection management module maintains the communication connection established between the target server and the target client. The dynamic port mapping module receives port mapping requests from the target client, creates a target mapped port on the target server based on the target client's target access port number and protocol type, and forwards the target user's target access requests for the target mapped port to the target access port.
[0057] The target client includes: a storage module, a main connection module, a port mapping request module, and a communication module. The storage module stores the target client's preset authentication identifier. The main connection module sends a connection establishment request carrying the target client's preset authentication identifier to the target server and establishes a communication connection with the target server after successful verification. The port mapping request module sends a port mapping request carrying the target access port number and protocol type to the target server after the communication connection is established. The communication module specifies that the target client uses a mobile communication network to establish a communication connection with the target server.
[0058] For example, the access method corresponding to the port mapping-based access system includes the following steps B1-B6:
[0059] Step B1: After the target client starts, obtain the preset authentication identifier from its storage module.
[0060] Step B2: The target client sends a connection establishment request to the target server through the communication module, and carries a preset authentication identifier in the connection establishment request.
[0061] Step B3: The target server's authentication module responds to the connection establishment request by verifying the preset authentication identifier, and establishes a communication connection with the target client after successful verification.
[0062] Step B4: When there is a communication connection between the target client and the target server, the target client sends a port mapping request to the target server through the port mapping request module based on its needs. The port mapping request carries the port number and protocol type of the target access port.
[0063] Step B5: The target server's dynamic port mapping module responds to the port mapping request, determines the target free external port on the target server, and establishes a mapping relationship between the target access port and the target free external port based on the port number and protocol type of the target access port, and then uses the target free external port as the target mapping port.
[0064] Step B6: When the target user sends a target access request to the target mapped port, the target server forwards the target access request to the target access port on the target client through the communication connection with the target client, thereby realizing remote access.
[0065] The technical solution of this invention, after establishing a communication connection between the target server and the target client, determines the port number and protocol type of the target access port, and determines the target idle external port on the target server; based on the port number and protocol type of the target access port, establishes a mapping relationship between the target idle external port and the target access port, and uses the target idle external port as the target mapping port, thereby enabling the dynamic creation of target mapping ports more effectively based on the port number and protocol type of the target idle external port and the port number and protocol type of the target access port; obtains the target user's target access request for the target mapping port, and the target access request is used to access the data of the target client; the target server forwards the target access request to the target client to realize data access, enabling clients who cannot directly access the port on the target client to access the data of the target client through the target server.
[0066] Figure 4 This is a schematic diagram of a port mapping-based access device provided in an embodiment of the present invention. This embodiment is applicable to situations where a user accesses a client through a server, and the device can be implemented in hardware and / or software. Figure 4 As shown, the port mapping-based access device includes:
[0067] The first determining module 301 is used to determine the target mapping port on the target server. The target mapping port is determined based on the target access port on the target client after a communication connection is established between the target server and the target client. The communication connection between the target server and the target client can forward access requests to the target mapping port to the target access port based on the target mapping relationship. The target mapping relationship is the mapping relationship between the target mapping port and the target access port. The target mapping port is an idle external port, and the target access port is used to provide data access services.
[0068] The first acquisition module 302 is used to acquire the target user's target access request for the target mapped port. The target access request is used to access the data of the target client.
[0069] The first forwarding module 303 is used to forward the target access request to the target client through the target server to achieve data access.
[0070] In addition to any of the above-mentioned optional technical solutions, the port mapping-based access device may optionally further include: a first sending module and a first connection module. The first sending module is used to send a connection establishment request from the target client to the target server, the connection establishment request carrying a preset authentication identifier of the target client, the preset authentication identifier being used to uniquely identify the target client; the first connection module is used to verify the preset authentication identifier carried in the connection establishment request in response to the connection establishment request from the target server, and to establish a communication connection between the target server and the target client after successful verification.
[0071] Based on any of the above optional technical solutions, optionally, the first determining module 301 includes: a second determining unit and a first establishing unit. The second determining unit is used to determine the port number and protocol type of the target access port, and to determine the target idle external port on the target server, after establishing a communication connection between the target server and the target client. The first establishing unit is used to establish a mapping relationship between the target idle external port and the target access port based on the port number and protocol type of the target access port, and to use the target idle external port as the target mapped port.
[0072] Based on any of the above optional technical solutions, optionally, the second determining unit is specifically used to obtain the port mapping request sent by the target client to the target server, and determine the port number and protocol type of the target access port from the port mapping request.
[0073] Based on any of the above optional technical solutions, optionally, the first acquisition module 302 includes: a first startup unit and a second acquisition unit. The first startup unit is used to start a target reverse proxy service on the target server, the target reverse proxy service being a reverse proxy service for listening to a target mapped port; the second acquisition unit is used to acquire target user access requests for the target mapped port through the target reverse proxy service.
[0074] Based on any of the above optional technical solutions, optionally, the first forwarding module 303 includes: a second forwarding unit. The second forwarding unit is used to forward target access requests to the target access port on the target client via a target reverse proxy service, based on the communication connection between the target server and the target client.
[0075] Optionally, based on any of the above-mentioned optional technical solutions, the target client may use a mobile communication network to establish a communication connection with the target server.
[0076] The technical solution of this invention involves a first determining module 301 that determines a target mapping port on the target server. This target mapping port is determined based on the target access port on the target client after a communication connection is established between the target server and the target client. The communication connection between the target server and the target client can forward access requests to the target mapping port to the target access port based on the target mapping relationship. The target mapping relationship is a mapping between the target mapping port and the target access port. The target mapping port is an idle external port, and the target access port is used to provide data access services. This allows for the dynamic creation of target mapping ports on the target server within the lifespan of the communication connection between the target server and the target client, overcoming the limitations of static port mapping. This facilitates dynamic deployment and temporary access to services on the target client, reducing the complexity of the access process and maintenance, and improving response efficiency. A first obtaining module 302 obtains the target user's target access request for the target mapping port. This target access request is used to access data on the target client. A first forwarding module 303 forwards the target access request to the target client through the target server to achieve data access. This allows clients who cannot directly access the port on the target client to access the target client's data through the target server.
[0077] The port mapping-based access device provided in this embodiment of the invention can execute the port mapping-based access method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the method execution.
[0078] Figure 5 This is a schematic diagram of an electronic device implementing a port mapping-based access method according to an embodiment of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0079] like Figure 5As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0080] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0081] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as port-mapped access methods.
[0082] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication unit 19, or installed from storage unit 18, or installed from ROM 12. When the computer program is executed by processor 11, it performs the functions defined in the methods of the embodiments of the present invention.
[0083] In some embodiments, the port-mapping-based access method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the port-mapping-based access method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the port-mapping-based access method by any other suitable means (e.g., by means of firmware).
[0084] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transferring data and instructions to the storage system, the at least one input device, and the at least one output device.
[0085] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0086] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0087] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0088] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0089] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0090] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0091] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. An access method based on port mapping, characterized in that, The method includes: The target mapping port on the target server is determined. The target mapping port is determined based on the target access port on the target client after a communication connection is established between the target server and the target client. The communication connection between the target server and the target client can forward access requests to the target mapping port to the target access port based on the target mapping relationship. The target mapping relationship is the mapping relationship between the target mapping port and the target access port. The target mapping port is an idle external port. The target access port is used to provide data access services. Obtain the target user's target access request for the target mapped port, the target access request being used to access the data of the target client; Data access is achieved by forwarding the target access request to the target client through the target server.
2. The method according to claim 1, characterized in that, Before determining the target mapped port on the target server, the following steps are also included: The target client sends a connection establishment request to the target server. The connection establishment request carries a preset authentication identifier of the target client, which is used to identify the uniqueness of the target client. The target server responds to the connection establishment request by verifying the preset authentication identifier carried in the connection establishment request, and establishes a communication connection between the target server and the target client after the verification is successful.
3. The method according to claim 1, characterized in that, Determine the target mapped port on the target server, including: After establishing a communication connection between the target server and the target client, the port number and protocol type of the target access port are determined, and the target idle external port on the target server is determined. Based on the port number and protocol type of the target access port, a mapping relationship is established between the target idle external port and the target access port, and the target idle external port is used as the target mapped port.
4. The method according to claim 3, characterized in that, Determining the port number and protocol type of the target access port includes: Obtain the port mapping request sent by the target client to the target server, and determine the port number and protocol type of the target access port from the port mapping request.
5. The method according to claim 1, characterized in that, Obtaining the target user's target access request for the target mapped port includes: Start a target reverse proxy service on the target server. The target reverse proxy service is a reverse proxy service used to listen to the target mapped port. The target reverse proxy service obtains the target user's target access request for the target mapped port.
6. The method according to claim 5, characterized in that, Forwarding the target access request to the target client through the target server includes: Based on the communication connection between the target server and the target client, the target access request is forwarded to the target access port on the target client through the target reverse proxy service.
7. The method according to claim 1, characterized in that, The target client establishes a communication connection with the target server using a mobile communication network.
8. An access device based on port mapping, characterized in that, The device includes: The first determining module is used to determine the target mapping port on the target server. The target mapping port is determined based on the target access port on the target client after a communication connection is established between the target server and the target client. The communication connection between the target server and the target client can forward access requests to the target mapping port to the target access port based on the target mapping relationship. The target mapping relationship is the mapping relationship between the target mapping port and the target access port. The target mapping port is an idle external port. The target access port is used to provide data access services. The first acquisition module is used to acquire the target user's target access request for the target mapped port, and the target access request is used to access the data of the target client; The first forwarding module is used to forward the target access request to the target client through the target server to achieve data access.
9. An electronic device, characterized in that, The electronic device includes: At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the port mapping-based access method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed by a processor, implement the port-mapping-based access method according to any one of claims 1-7.