Network connection method, device, storage medium and electronic device
Through the dual authentication mechanism between the application access client and the server, the legality of the application is judged and key-value pairs are generated for storage, which solves the problem of file leakage risks and high system construction costs when uploading files by encrypted clients. The security and efficiency of encrypted transmission are realized.
Patent Information
- Application Number
- CN202210060811.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-19
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2042-01-19
AI Technical Summary
When the encrypted client uploads encrypted files to the service server, the encryption gateway becomes a system bottleneck in the existing technology, increasing the cost of system construction. Moreover, the reading of ciphertext files and file uploading network are two logics, and it is not guaranteed to be uploaded to the network The files are all ciphertext files, resulting in the risk of file leakage.
By establishing a two-factor authentication mechanism between the application access client and the server, obtain the source port and source address of the application, judge its legitimacy, and generate key-value pairs based on the source port for storage, ensuring that the outbound data packet is in the transmission process. The file is encrypted to avoid file leakage.
It reduces the risk of file leakage, avoids the high-performance demand of encryption gateway hardware, reduces system construction costs, and ensures the encryption security of files during transmission.
Smart Images

Figure CN114374563B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of Internet technology, and specifically to a network connection method, device, storage medium, and electronic device. Background Art
[0002] Uploading encrypted files to the business system will cause some functions of the business system to be unable to be used normally. Therefore, it is required that when the encrypted client uploads the encrypted file to the business server, the file needs to be automatically decrypted, and when the business server downloads the plaintext file to the encryption client, the file needs to be automatically encrypted.
[0003] Currently, all communications between encryption clients and business servers need to go through encryption gateways, which become the bottleneck of the system and require high-performance hardware to support the normal operation of the system, increasing the cost of system construction. In addition, in the encryption client's credit authorization process, the reading of ciphertext files and the network upload of files are two usually unrelated logics, resulting in the inability to guarantee that the files uploaded to the network are all ciphertext files, thus creating the risk of file leakage. Summary of the invention
[0004] Embodiments of the present application provide a network connection method, device, storage medium, and electronic device, which can reduce the risk of file leakage.
[0005] In a first aspect, an embodiment of the present application provides a network connection method, including:
[0006] When receiving an inbound data packet sent by the application access client, obtaining the source port and source address of the application corresponding to the inbound data packet;
[0007] Determining whether the application is legitimate based on the source port and the source address;
[0008] If so, the inbound data packet is sent to the business server so that the application program establishes a network connection with the business server.
[0009] In a second aspect, an embodiment of the present application provides another network connection method, including:
[0010] When receiving an outbound data packet sent by an application, obtaining a source port of the application;
[0011] Searching for a corresponding key-value pair according to the source port;
[0012] Extracting the access tag corresponding to the application according to the key-value pair;
[0013] Determining the type of the access token;
[0014] When the access mark is to allow access, the outbound data packet is sent to the application admission server.
[0015] In the network connection method provided in the embodiment of the present application, before obtaining the source port of the application when receiving an outbound data packet sent by the application, it also includes:
[0016] When receiving a network registration request initiated by an application, determining whether the application is a controlled application;
[0017] When the application is a controlled application, obtaining a target address and a target port of the network registration request;
[0018] Determining whether the network registration request is legal according to the target address and the target port;
[0019] If yes, the network registration request is sent to the application admission server for network registration, and the access mark of the application is marked as allowing access;
[0020] If not, the network registration request is terminated, and the access tag of the application is marked as access prohibited.
[0021] In the network connection method provided in the embodiment of the present application, determining whether the network registration request is legal according to the target address and the target port includes:
[0022] Determining whether the target address of the network registration request is the same as the preset address;
[0023] When the target address is the same as the preset address, determining whether the target port of the network registration request is the same as the preset port;
[0024] If so, determining that the network registration request is legal;
[0025] If not, it is determined that the network registration request is illegal.
[0026] In the network connection method provided in the embodiment of the present application, after marking the access mark of the application as allowing access and / or after marking the access mark of the application as prohibiting access, it also includes:
[0027] A key-value pair is generated based on the source port of the application and the access tag of the application, and the key-value pair is stored.
[0028] In the network connection method provided in the embodiment of the present application, after generating a key-value pair based on the source port of the application and the access tag of the application and storing the key-value pair, it also includes:
[0029] When receiving a network logout request initiated by an application, obtaining a source port of the application;
[0030] Searching for a corresponding key-value pair according to the source port;
[0031] Extracting the access tag corresponding to the application according to the key-value pair;
[0032] Determining the type of the access token;
[0033] When the access mark indicates that access is allowed, the network logout request is sent to an application admission server.
[0034] In a third aspect, an embodiment of the present application provides a network connection device, including:
[0035] A first acquisition unit, configured to, when receiving an inbound data packet sent by the application access client, acquire a source port and a source address of an application corresponding to the inbound data packet;
[0036] A first determining unit, configured to determine whether the application is legitimate based on the source port and the source address;
[0037] The network connection unit is used to send the inbound data packet to the service server when the source port and the source address are legal, so that the application program can establish a network connection with the service server.
[0038] In a fourth aspect, an embodiment of the present application provides another network connection device, including:
[0039] A second acquisition unit, configured to acquire a source port of the application when receiving an outbound data packet sent by the application;
[0040] A key value search unit, used to search for a corresponding key value pair according to the source port;
[0041] A tag extraction unit, used to extract the access tag corresponding to the application according to the key-value pair;
[0042] A second determining unit, configured to determine a type of the access mark;
[0043] The data sending unit is used to send the outbound data packet to the application admission server when the access mark is to allow access.
[0044] In a third aspect, an embodiment of the present application provides a storage medium, which stores a plurality of instructions, and the instructions are suitable for a processor to load and execute the steps of any one of the network connection methods provided in the embodiments of the present application.
[0045] In a fourth aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps in any one of the network connection methods provided in the embodiments of the present application are implemented.
[0046] The network connection method provided by the embodiment of the present application obtains the source port and source address of the application corresponding to the inbound data packet when receiving the inbound data packet sent by the application access client; determines whether the application is legal based on the source port and the source address; if so, sends the inbound data packet to the business server so that the application establishes a network connection with the business server. This solution can reduce the risk of file leakage. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0048] Figure 1 A flowchart of a network connection method provided in an embodiment of the present application.
[0049] Figure 2 A flowchart of another network connection method provided in an embodiment of the present application.
[0050] Figure 3 A schematic diagram of the structure of a network connection device provided in an embodiment of the present application.
[0051] Figure 4 A schematic diagram of the structure of another network connection device provided in an embodiment of the present application.
[0052] Figure 5 A schematic diagram of the structure of a network connection system provided in an embodiment of the present application.
[0053] Figure 6 A schematic diagram of the structure of a server provided in an embodiment of the present application.
[0054] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0055] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0056] The terms "first" and "second" etc. in this application are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or modules is not limited to the listed steps or modules, but optionally includes steps or modules that are not listed, or optionally includes other steps or modules inherent to these processes, methods, products or devices.
[0057] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0058] Next, the network connection method, device, storage medium and electronic device provided by the embodiments of the present application will be introduced. Specifically, the embodiments of the present application provide a network connection device suitable for an electronic device, and the electronic device can be a terminal device such as a mobile device, a tablet computer and a laptop computer. In some embodiments, the electronic device can also be a network side device such as a server, and the server can be a single server or a server cluster composed of multiple servers, and can be a physical server or a virtual server.
[0059] Each of the embodiments will be described in detail below. The order of description of the following embodiments does not constitute a limitation on the order of specific implementation.
[0060] In this embodiment, the description will be made from the perspective of a network connection device, which can be integrated into an application trust client (ATC). Figure 1 , Figure 1 It is a flow chart of the network connection method provided in the embodiment of the present application. It should be noted that the specific flow of the network connection method can be as follows:
[0061] 101. When receiving an outbound data packet sent by an application, obtain the source port of the application.
[0062] 102. Search for the corresponding key-value pair according to the source port.
[0063] 103. Extract the access tag corresponding to the application according to the key-value pair.
[0064] 104. Determine the type of access token.
[0065] 105. When the access is marked as allowed, the outbound data packet is sent to the application admission server.
[0066] The outbound data packet is a Synchronize Sequence Numbers (SYN) data packet. The source port of the application refers to the port information of the application.
[0067] In this embodiment, when the access mark is access denied, the SYN data packet may be discarded, and a RST data packet may be returned to reset the connection between the application program and the application access client.
[0068] In some embodiments, the following steps may also be included before step 101: when a network registration request initiated by an application is received, determine whether the application is a controlled application; when the application is a controlled application, obtain the target address and target port of the network registration request; determine whether the network registration request is legal based on the target address and target port; if so, send the network registration request to the application access server for network registration, and mark the access tag of the application as allowing access; if not, interrupt the network registration request and mark the access tag of the application as prohibiting access.
[0069] It should be noted that the network registration request may carry the source address and source port of the application. When performing network registration, the application admission server actually authorizes and registers the source address and source port of the application.
[0070] The controlled application refers to the application that is authorized to access the application access server. The target address refers to the Internet Protocol address of the business server that the application needs to connect to. The target port refers to the port information of the business server that the application needs to connect to.
[0071] In some embodiments, after marking the access tag of an application as allowing access, and / or after marking the access tag of an application as prohibiting access, it may also include: generating a key-value pair based on the source port of the application and the access tag of the application, and storing the key-value pair.
[0072] In some embodiments, the step of "determining whether the network registration request is legal based on the target address and target port" may include: determining whether the target address of the network registration request is the same as the preset address; when the target address is the same as the preset address, determining whether the target port of the network registration request is the same as the preset port; if so, determining that the network registration request is legal; if not, determining that the network registration request is illegal.
[0073] It should be noted that the preset address and the preset port are the IP address and port information of the application access server.
[0074] In some embodiments, after the step of "generating a key-value pair based on the source port of the application and the access tag of the application, and storing the key-value pair", it may also include: when a network logout request initiated by an application is received, obtaining the source port of the application; searching for the corresponding key-value pair according to the source port; extracting the access tag corresponding to the application according to the key-value pair; determining the type of the access tag; and when the access tag is to allow access, sending the network logout request to the application access server.
[0075] In summary, the network connection method provided by this embodiment includes obtaining the source port of the application when receiving an outbound data packet sent by the application; searching for a corresponding key-value pair according to the source port; extracting an access tag corresponding to the application according to the key-value pair; determining the type of the access tag; and sending the outbound data packet to the application admission server when the access tag is to allow access. This solution can reduce the risk of file leakage.
[0076] See also Figure 2 , Figure 2 1 is a flow chart of another network connection method provided by an embodiment of the present application. In this embodiment, it will be described from the perspective of a network connection device, which can be integrated in an application trust server (ATS). The specific process of the network connection method can be as follows:
[0077] 201. When an inbound data packet sent by an application access client is received, a source port and a source address of an application corresponding to the inbound data packet are obtained.
[0078] 202. Determine whether the application is legitimate based on the source port and source address.
[0079] 203. If yes, the inbound data packet is sent to the business server so that the application program establishes a network connection with the business server.
[0080] The source port of the application refers to the port information of the application. The source address of the application refers to the IP address of the application. The inbound data packet is a SYN data packet.
[0081] The step of “determining whether the application is legitimate based on the source port and source address” may include:
[0082] Determine whether the source port and source address are registered;
[0083] When both the source port and the source address are registered, the application is determined to be legitimate;
[0084] When the source port and / or the source address are not registered, the application is determined to be illegal.
[0085] In some embodiments, when the application is not legal, the SYN packet may be discarded and a RST packet may be returned, thereby resetting the connection between the application admission server and the application admission client.
[0086] It should be noted that the meanings of the terms in this embodiment are the same as those in the above-mentioned network connection method, and the specific implementation details can refer to the description in the above-mentioned embodiment.
[0087] In summary, the network connection method provided by this embodiment includes, when receiving an inbound data packet sent by an application access client, obtaining the source port and source address of the application corresponding to the inbound data packet; determining whether the application is legitimate based on the source port and source address; if so, sending the inbound data packet to the business server so that the application establishes a network connection with the business server. This solution can reduce the risk of file leakage.
[0088] See also Figure 3 The embodiment of the present application further provides a network connection device, which can be integrated into an application access client. The network connection device 300 can include:
[0089] The second acquisition unit 301 is used to acquire the source port of the application when receiving an outbound data packet sent by the application;
[0090] A key value search unit 302, used to search for a corresponding key value pair according to a source port;
[0091] The tag extraction unit 303 is used to extract the access tag corresponding to the application according to the key-value pair;
[0092] A second determining unit 304, configured to determine a type of the access tag;
[0093] The data sending unit 305 is used to send the outbound data packet to the application admission server when the access mark is to allow access.
[0094] It should be noted that the meanings of the terms in this embodiment are the same as those in the above-mentioned network connection method. For specific implementation details, reference may be made to the description in the above-mentioned method embodiment.
[0095] In summary, the network connection device 300 provided in the embodiment of the present application obtains the source port of the application through the second acquisition unit 301 when receiving the outbound data packet sent by the application; the key value search unit 302 searches for the corresponding key value pair according to the source port; the tag extraction unit 303 extracts the access tag corresponding to the application according to the key value pair; the second determination unit 304 determines the type of the access tag; and the data sending unit 305 sends the outbound data packet to the application admission server when the access tag is allowed to access. This solution can reduce the risk of file leakage.
[0096] See also Figure 4 The embodiment of the present application further provides another network connection device, the network connection device 400 can be integrated into the application admission server, and the network connection device 400 can include:
[0097] The first acquisition unit 401 is used to acquire the source port and source address of the application corresponding to the inbound data packet when receiving the inbound data packet sent by the application access client;
[0098] A first determining unit 402, configured to determine whether the application is legitimate based on the source port and the source address;
[0099] The network connection unit 403 is used to send the inbound data packet to the service server when the source port and the source address are legal, so that the application program can establish a network connection with the service server.
[0100] It should be noted that the meanings of the terms in this embodiment are the same as those in the above-mentioned network connection method. For specific implementation details, reference may be made to the description in the above-mentioned method embodiment.
[0101] In summary, the network connection device 400 provided in the embodiment of the present application obtains the source port and source address of the application corresponding to the inbound data packet through the first acquisition unit 401 when receiving the inbound data packet sent by the application access client; the first determination unit 402 determines whether the application is legal based on the source port and source address; the network connection unit 403 sends the inbound data packet to the business server when the source port and source address are legal, so that the application establishes a network connection with the business server. This solution can reduce the risk of file leakage.
[0102] See also Figure 5 , Figure 55 is a schematic diagram of the structure of a network connection system provided in an embodiment of the present application. The network connection system 500 may include an application 501, an application access client 502, an application access server 503, and a business server 504. The application 501 and the application access client 502 may be integrated into the same electronic device. The application access server 503 and the business server 504 may be integrated into the same electronic device.
[0103] Among them, the application access client 502 can be used to perform the following steps: when receiving an outbound data packet sent by an application, obtain the source port of the application; search for the corresponding key-value pair according to the source port; extract the access tag corresponding to the application according to the key-value pair; determine the type of the access tag; when the access tag is to allow access, send the outbound data packet to the application access server.
[0104] It should be noted that when an application sends an outbound data packet to an application access server, the application access client 502 needs to obtain the access tag of the application through the source port, and then determine whether to send the outbound data packet to the application access server based on the access tag. That is, when an application needs to establish a network connection with a business server, the application access client 502 will first intercept the outbound data packet sent by the application, and then determine whether the access tag of the application is to allow access. If so, the outbound data packet is released. If not, the outbound data packet is discarded and the network connection is reset.
[0105] The application access server 503 can be used to perform the following steps: when receiving an inbound data packet sent by the application access client, obtaining the source port and source address of the application corresponding to the inbound data packet; determining whether the application is legal based on the source port and source address; if so, sending the inbound data packet to the business server to establish a network connection between the application and the business server.
[0106] It should be noted that, after the outbound data packet sent by the application passes the first interception by the application access client 502, the application access client 502 can send the outbound data packet to the application access server 503. At this time, when the application access server 503 receives the inbound data packet, it can intercept the inbound data packet for the second time, and then determine whether the source port and source address of the application corresponding to the inbound data packet are registered. If so, the inbound data packet is released. If not, the inbound data packet is discarded and the network connection is reset.
[0107] In this embodiment, after the application access server 503 releases the inbound data packet, the inbound data packet is sent to the business server. When the business server receives the inbound data packet, it indicates that the application corresponding to the inbound data packet has passed the security test. Therefore, the business server can establish a network connection with the application based on the inbound data packet.
[0108] In summary, when a user needs to upload a file to a business server, the network connection system provided by this embodiment can be used to establish a network connection between the application and the business server, and then the user can directly upload files to the business server through the application. In the process of establishing a network connection between the application and the business server, it is necessary to go through the dual authentication of the application access client 502 and the application access server 503, so as to ensure that the application is a legitimate application, and to ensure the security of uploading files through the application. In addition, the solution provided by this embodiment can be directly implemented by the application in the prior art through the encrypted network to achieve the process of uploading decryption, downloading encryption and encryption credit, avoiding the prior art in the credit process of the encrypted client, the reading of the ciphertext file and the network upload of the file are two usually unrelated logics, resulting in the problem that it is impossible to ensure that the files uploaded to the network are all ciphertext files, thereby causing the risk of file leakage. That is, this embodiment can directly implement the functions implemented by the encryption gateway in the prior art through the application, without the need for high-performance hardware to support the normal operation of the system, reducing the cost of system construction. At the same time, it also reduces the risk of file leakage.
[0109] In the above embodiment, the application admission client 502 and the application admission server 503 are connected by default. In actual operation, the network connection between the application admission client 502 and the application admission server 503 is disconnected at the beginning. In some embodiments, in order to further increase the security of file transmission, two-way identity authentication is required during the process of the application admission client 502 and the application admission server 503, as follows:
[0110] The application admission server 503 can monitor the transmission control protocol (TCP) port preset by the system, and the application admission client 502 can connect to the TCP port and send the first identity authentication information to the application admission server 503. The application admission server 503 can perform the first identity authentication on the application admission client 502 according to the first identity authentication information. After the first identity authentication is passed, the application admission server 503 sends the second identity authentication information to the application admission client 502, and the application admission client 502 can perform the identity authentication on the application admission server 503 according to the second identity authentication information. After the second identity authentication is passed, the application admission client 502 and the application admission server 503 maintain a connection through the TCP port.
[0111] All the above technical solutions can be combined in any way to form optional embodiments of the present application, which will not be described in detail here. The meanings of the terms are the same as those in the above network connection method, and the specific implementation details can refer to the description in the method embodiment.
[0112] The present application also provides a server, such as Figure 6 As shown, it shows a schematic diagram of the structure of the server involved in the embodiment of the present application, specifically:
[0113] The server may include one or more processing core processors 601, one or more computer-readable storage media memories 602, a power supply 603, an input unit 604 and other components. Those skilled in the art will appreciate that Figure 6 The server structure shown in the figure does not constitute a limitation on the server, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. Among them:
[0114] The processor 601 is the control center of the server, and uses various interfaces and lines to connect various parts of the entire server. By running or executing software programs and / or modules stored in the memory 602, and calling data stored in the memory 602, the processor 601 performs various functions of the server and processes data, thereby monitoring the server as a whole. Optionally, the processor 601 may include one or more processing cores; preferably, the processor 601 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 601.
[0115] The memory 602 can be used to store software programs and modules. The processor 601 executes various functional applications and network connections by running the software programs and modules stored in the memory 602. The memory 602 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the server, etc. In addition, the memory 602 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 602 may also include a memory controller to provide the processor 601 with access to the memory 602.
[0116] The server also includes a power supply 603 for supplying power to each component. Preferably, the power supply 603 can be logically connected to the processor 601 through a power management system, so that the power management system can manage charging, discharging, power consumption and other functions. The power supply 603 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators and other arbitrary components.
[0117] The server may further include an input unit 604, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0118] Although not shown, the server may further include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 601 in the server will load the executable files corresponding to the processes of one or more application programs into the memory 602 according to the following instructions, and the processor 601 will run the application programs stored in the memory 602, thereby realizing the following various functions:
[0119] When receiving an inbound data packet sent by the application admission client, obtaining the source port and source address of the application corresponding to the inbound data packet;
[0120] Determine if an application is legitimate based on source port and source address;
[0121] If so, the inbound data packet is sent to the business server so that the application program establishes a network connection with the business server.
[0122] Or implement the following functions:
[0123] When receiving an outbound data packet sent by an application, obtain the source port of the application;
[0124] Find the corresponding key-value pair according to the source port;
[0125] Extract the access token corresponding to the application based on the key-value pair;
[0126] Determine the type of access token;
[0127] When the access is marked as allowed, the outbound data packet is sent to the application admission server.
[0128] The above operations are specifically described in the previous embodiments and will not be described in detail here.
[0129] Accordingly, the present application also provides an electronic device, such as Figure 7 As shown, the electronic device may include a radio frequency (RF) circuit 701, a memory 702 including one or more computer-readable storage media, an input unit 703, a display unit 704, a sensor 705, an audio circuit 706, a wireless fidelity (WiFi) module 707, a processor 708 including one or more processing cores, and a power supply 709. Those skilled in the art will appreciate that Figure 7 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0130] The RF circuit 701 can be used for receiving and sending signals during information transmission or calls. In particular, after receiving the downlink information of the base station, it is handed over to one or more processors 708 for processing; in addition, the data related to the uplink is sent to the base station. Usually, the RF circuit 701 includes but is not limited to an antenna, at least one amplifier, a tuner, one or more oscillators, a subscriber identity module (SIM) card, a transceiver, a coupler, a low noise amplifier (LNA), a duplexer, etc. In addition, the RF circuit 701 can also communicate with the network and other devices through wireless communication. The wireless communication can use any communication standard or protocol, including but not limited to the Global System of Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Messaging Service (SMS), etc.
[0131] The memory 702 can be used to store software programs and modules, and the processor 708 executes various functional applications and network connections by running the software programs and modules stored in the memory 702. The memory 702 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device (such as audio data, a phone book, etc.), etc. In addition, the memory 702 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 702 may also include a memory controller to provide the processor 708 and the input unit 703 with access to the memory 702.
[0132] The input unit 703 can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control. Specifically, in a specific embodiment, the input unit 703 may include a touch-sensitive surface and other input devices. The touch-sensitive surface, also known as a touch display screen or a touch pad, can collect the user's touch operations on or near it (such as the user's operation on or near the touch-sensitive surface using any suitable object or accessory such as a finger, a stylus, etc.), and drive the corresponding connection device according to a pre-set program. Optionally, the touch-sensitive surface may include a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the touch point coordinates, and then sends it to the processor 708, and can receive and execute the command sent by the processor 708. In addition, the touch-sensitive surface can be implemented using multiple types such as resistive, capacitive, infrared and surface acoustic waves. In addition to the touch-sensitive surface, the input unit 703 may also include other input devices. Specifically, other input devices may include, but are not limited to, one or more of a physical keyboard, function keys (such as a volume control key, a switch key, etc.), a trackball, a mouse, a joystick, and the like.
[0133] The display unit 704 can be used to display information input by the user or information provided to the user and various graphical user interfaces of the electronic device, which can be composed of graphics, text, icons, videos and any combination thereof. The display unit 704 may include a display panel. Optionally, the display panel may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. Further, the touch-sensitive surface may cover the display panel. When the touch-sensitive surface detects a touch operation on or near it, it is transmitted to the processor 708 to determine the type of touch event. Subsequently, the processor 708 provides a corresponding visual output on the display panel according to the type of touch event. Although in Figure 7 In the embodiment, the touch-sensitive surface and the display panel are used as two independent components to realize input and output functions, but in some embodiments, the touch-sensitive surface and the display panel can be integrated to realize input and output functions.
[0134] The electronic device may also include at least one sensor 705, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel according to the brightness of the ambient light, and the proximity sensor may turn off the display panel and / or backlight when the electronic device is moved to the ear. As a type of motion sensor, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors that can be configured in the electronic device, such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., they will not be repeated here.
[0135] The audio circuit 706, the speaker, and the microphone can provide an audio interface between the user and the electronic device. The audio circuit 706 can transmit the electrical signal converted from the received audio data to the speaker, which is converted into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 706 and converted into audio data, and then the audio data is output to the processor 708 for processing, and then sent to another electronic device through the RF circuit 701, or the audio data is output to the memory 702 for further processing. The audio circuit 706 may also include an earplug jack to provide communication between an external headset and the electronic device.
[0136] WiFi is a short-range wireless transmission technology. Electronic devices can help users send and receive emails, browse web pages, and access streaming media through WiFi module 707. It provides users with wireless broadband Internet access. Figure 7 A WiFi module 707 is shown, but it is understandable that it is not an essential component of the electronic device and can be omitted as needed without changing the essence of the invention.
[0137] The processor 708 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire mobile phone. By running or executing software programs and / or modules stored in the memory 702 and calling data stored in the memory 702, it executes various functions of the electronic device and processes data, thereby monitoring the mobile phone as a whole. Optionally, the processor 708 may include one or more processing cores; preferably, the processor 708 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 708.
[0138] The electronic device also includes a power supply 709 (such as a battery) for supplying power to each component. Preferably, the power supply can be logically connected to the processor 708 through a power management system, so that the power management system can manage charging, discharging, and power consumption management. The power supply 709 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0139] Although not shown, the electronic device may also include a camera, a Bluetooth module, etc., which will not be described in detail here. Specifically in this embodiment, the processor 708 in the electronic device will load the executable files corresponding to the processes of one or more applications into the memory 702 according to the following instructions, and the processor 708 will run the applications stored in the memory 702 to achieve various functions:
[0140] When receiving an inbound data packet sent by the application admission client, obtaining the source port and source address of the application corresponding to the inbound data packet;
[0141] Determine if an application is legitimate based on source port and source address;
[0142] If so, the inbound data packet is sent to the business server so that the application program establishes a network connection with the business server.
[0143] Or implement the following functions:
[0144] When receiving an outbound data packet sent by an application, obtain the source port of the application;
[0145] Find the corresponding key-value pair according to the source port;
[0146] Extract the access token corresponding to the application based on the key-value pair;
[0147] Determine the type of access token;
[0148] When the access is marked as allowed, the outbound data packet is sent to the application admission server.
[0149] The above operations are specifically described in the previous embodiments and will not be described in detail here.
[0150] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0151] To this end, an embodiment of the present application provides a storage medium in which a plurality of instructions are stored, and the instructions can be loaded by a processor to execute the steps in any one of the network connection methods provided in the embodiment of the present application. For example, the instructions can execute the following steps:
[0152] When receiving an inbound data packet sent by the application admission client, obtaining the source port and source address of the application corresponding to the inbound data packet;
[0153] Determine if an application is legitimate based on source port and source address;
[0154] If so, the inbound data packet is sent to the business server so that the application program establishes a network connection with the business server.
[0155] Or follow these steps:
[0156] When receiving an outbound data packet sent by an application, obtain the source port of the application;
[0157] Find the corresponding key-value pair according to the source port;
[0158] Extract the access token corresponding to the application based on the key-value pair;
[0159] Determine the type of access token;
[0160] When the access mark is to allow access, the outbound data packet is sent to the application admission server. The specific implementation of the above operations can be referred to the previous embodiment, which will not be repeated here.
[0161] The storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0162] Since the instructions stored in the storage medium can execute the steps in any network connection method provided in the embodiments of the present application, the beneficial effects that can be achieved by any network connection method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0163] The above is a detailed introduction to a network connection method, device, storage medium and electronic device provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A network connection method, characterized in that: include: When the application access client receives an outbound data packet sent by the application, the application access client obtains the source port of the application; The application access client searches for a corresponding key-value pair according to the source port; The application admission client extracts the access tag corresponding to the application program according to the key-value pair; The application admission client determines the type of the access token; When the access mark is to allow access, the application admission client sends the outbound data packet to the application admission server; When the application admission server receives the inbound data packet sent by the application admission client, it obtains the source port and source address of the application corresponding to the inbound data packet; The application admission server determines whether the application is legal based on the source port and the source address; If so, the application admission server sends the inbound data packet to the business server so that the application program establishes a network connection with the business server.
2. The network connection method according to claim 1, characterized in that: Before obtaining the source port of the application when receiving an outbound data packet sent by the application, the method further includes: When receiving a network registration request initiated by an application, determining whether the application is a controlled application; When the application is a controlled application, obtaining a target address and a target port of the network registration request; Determining whether the network registration request is legal according to the target address and the target port; If yes, the network registration request is sent to the application admission server for network registration, and the access mark of the application is marked as allowing access; If not, the network registration request is terminated, and the access tag of the application is marked as access prohibited.
3. The network connection method according to claim 2, characterized in that: The determining whether the network registration request is legal according to the target address and the target port includes: Determining whether the target address of the network registration request is the same as the preset address; When the target address is the same as the preset address, determining whether the target port of the network registration request is the same as the preset port; If so, determining that the network registration request is legal; If not, it is determined that the network registration request is illegal.
4. The network connection method according to claim 2, characterized in that: After marking the access mark of the application as allowing access, and / or after marking the access mark of the application as prohibiting access, the method further includes: A key-value pair is generated based on the source port of the application and the access tag of the application, and the key-value pair is stored.
5. The network connection method according to claim 4, characterized in that: After generating a key-value pair based on the source port of the application and the access tag of the application and storing the key-value pair, the method further includes: When receiving a network logout request initiated by an application, obtaining a source port of the application; When the access mark indicates that access is allowed, the network logout request is sent to an application admission server.
6. A network connection device, characterized in that: include: A second acquisition unit, configured to, when the application access client receives an outbound data packet sent by the application, obtain the source port of the application; A key value search unit, used for the application access client to search for a corresponding key value pair according to the source port; A tag extraction unit, configured for the application admission client to extract an access tag corresponding to the application program according to the key-value pair; A second determining unit, configured for the application access client to determine a type of the access token; A data sending unit, configured to, when the access mark is set to allow access, cause the application admission client to send the outbound data packet to the application admission server; A first acquisition unit, configured to acquire a source port and a source address of an application corresponding to an inbound data packet when the application admission server receives an inbound data packet sent by the application admission client; A first determining unit, configured for the application admission server to determine whether the application is legal based on the source port and the source address; The network connection unit is used for, when the source port and the source address are legal, the application admission server sends the inbound data packet to the business server, so that the application program establishes a network connection with the business server.
7. A storage medium, characterized in that: The storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the network connection method according to any one of claims 1 to 5.
8. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the network connection method according to any one of claims 1 to 5 when executing the computer program.
