CN112532699B - Data port updating method and device, electronic equipment and readable storage medium - Google Patents

Data port updating method and device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN112532699B
CN112532699B CN202011287058.0A CN202011287058A CN112532699B CN 112532699 B CN112532699 B CN 112532699B CN 202011287058 A CN202011287058 A CN 202011287058A CN 112532699 B CN112532699 B CN 112532699B
Authority
CN
China
Prior art keywords
port
local server
communication
browser
http port
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011287058.0A
Other languages
Chinese (zh)
Other versions
CN112532699A (en
Inventor
刘军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Citic Bank Corp Ltd
Original Assignee
China Citic Bank Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Citic Bank Corp Ltd filed Critical China Citic Bank Corp Ltd
Priority to CN202011287058.0A priority Critical patent/CN112532699B/en
Publication of CN112532699A publication Critical patent/CN112532699A/en
Application granted granted Critical
Publication of CN112532699B publication Critical patent/CN112532699B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/143Termination or inactivation of sessions, e.g. event-controlled end of session
    • H04L67/145Termination or inactivation of sessions, e.g. event-controlled end of session avoiding end of session, e.g. keep-alive, heartbeats, resumption message or wake-up for inactive or interrupted session
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • H04L41/082Configuration setting characterised by the conditions triggering a change of settings the condition being updates or upgrades of network functionality
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • Health & Medical Sciences (AREA)
  • Computer And Data Communications (AREA)

Abstract

The embodiment of the application provides a data port updating method and device, electronic equipment and a readable storage medium. The method comprises the following steps: when the browser establishes communication with a local server through a first http port, determining whether the communication condition of the first http port meets a preset reconnection condition; and if so, the browser end sends an updating request for the first http port to the local server end in a Urlscheme mode, so that the local server end updates the port for establishing the communication between the browser end and the local server end to the second http port based on the updating request. Based on the scheme, when the communication between the browser end and the local service end cannot be established through the first http port, the communication port can be distributed again in the Urlscheme communication mode, the first http port is updated, and a foundation is provided for establishing normal communication between the browser end and the local service end through the updated communication port.

Description

Data port updating method and device, electronic equipment and readable storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for updating a data port, an electronic device, and a readable storage medium.
Background
At present, a browser end and a plurality of pass-through ports establish communication with a local server end, so that the browser end can access local resources of a client through the local server end.
In actual use, there may be a situation that a port between a browser end and a local server end is occupied or disabled, in the prior art, many ports (generally 5 to 10 ports) are reserved, polling is performed in the reserved ports, and an available port is determined for communication, but once all the reserved ports are unavailable, normal communication between the browser end and the local server end is affected.
Disclosure of Invention
The present application aims to solve at least one of the above technical drawbacks. The technical scheme adopted by the application is as follows:
in a first aspect, an embodiment of the present application provides a method for updating a data port, where the method includes:
when the browser establishes communication with a local server through a first http port, determining whether the communication condition of the first http port meets a preset reconnection condition;
if the first http port is satisfied, the browser sends an update request for the first http port to the local server in a Urlscheme manner, so that the local server updates the port for establishing communication between the browser and the local server to the second http port based on the update request.
Optionally, the method further includes:
and the browser end establishes communication with the local server end through the second http port.
Optionally, when the communication with the local server is established through the second http port, if the communication condition of the second http port satisfies the reconnection condition, the method further includes:
and taking the second http port as the first http port, repeatedly executing the browser to send an update request for the first http port to the local server in a Urlscheme manner, so that the local server updates the port for establishing communication between the browser and the local server to the second http port based on the update request, and establishing communication between the browser and the local server through the second http port until a preset stop condition is met.
Optionally, the reconnect condition comprises at least one of:
all the ports in the first http port or the second http port fail to establish communication;
all the ports in the first http port or the second http port cannot establish communication within a preset time.
Optionally, the stop condition comprises:
the repeated execution times reach the preset times.
Optionally, the local server updates a port for establishing communication between the browser and the local server to the second http port based on the update request, by:
and the local server updates the port for establishing the communication between the browser terminal and the local server terminal into the second http port based on the port information of the second http port carried by the update request.
Optionally, the sending, by the browser, an update request for the first http port to the local server in a manner of Urlscheme includes:
determining whether the current operating system supports Urlscheme;
and if the request is supported, the browser end sends an update request for the first http port to the local server end in a Urlscheme mode.
In a second aspect, an embodiment of the present application provides an apparatus for updating a data port, where the apparatus includes:
the communication condition monitoring module is used for determining whether the communication condition of the first http port meets a preset reconnection condition when the browser establishes communication with the local server through the first http port;
and the port updating module is used for sending an updating request for the first http port to the local server by the browser in a Urlscheme mode when the communication condition of the first http port meets a preset reconnection condition, so that the local server updates the port for establishing the communication between the browser and the local server to a second http port based on the updating request.
Optionally, the apparatus further includes:
and the communication establishing module is used for establishing communication between the browser end and the local server end through the second http port.
Optionally, the communication establishing module is further configured to:
when the communication between the browser end and the local server end is established through the second http port, if the communication condition of the second http port meets the reconnection condition, the second http port is used as the first http port, the browser end is repeatedly executed to send an update request for the first http port to the local server end in a Urlscheme manner, so that the local server end updates a port for establishing the communication between the browser end and the local server end to the second http port based on the update request, and the browser end establishes the communication with the local server end through the second http port until the preset stop condition is met.
Optionally, the reconnect condition comprises at least one of:
all the ports in the first http port or the second http port fail to establish communication;
all the ports in the first http port or the second http port cannot establish communication within a preset time.
Optionally, the stop condition comprises:
the repeated execution times reach the preset times.
Optionally, the local server updates a port for establishing communication between the browser and the local server to the second http port based on the update request, by:
and the local server updates the port for establishing the communication between the browser terminal and the local server terminal into the second http port based on the port information of the second http port carried by the update request.
Optionally, when the browser sends an update request for the first http port to the local server in a manner of Urlscheme, the port update module is specifically configured to:
determining whether the current operating system supports Urlscheme;
and if the request is supported, the browser end sends an update request for the first http port to the local server end in a Urlscheme mode.
In a third aspect, an embodiment of the present application provides an electronic device, including: a processor and a memory;
a memory for storing operating instructions;
a processor, configured to execute the method for updating a data port as shown in any implementation manner of the first aspect of the present application by calling an operation instruction.
In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method for updating a data port shown in any implementation manner of the first aspect of the present application.
The technical scheme provided by the embodiment of the application has the following beneficial effects:
according to the scheme provided by the embodiment of the application, when the browser end establishes communication with the local server end through the first http port, if the communication condition of the first http port meets the preset reconnection condition, the browser end sends the update request for the first http port to the local server end in an Urlscheme mode, so that the local server end updates the port for establishing communication between the browser end and the local server end to the second http port based on the update request. Based on the scheme, when the communication between the browser end and the local server end cannot be established through the first http port, the communication port is distributed again in the Urlscheme communication mode, the first http port is updated, and a foundation is provided for establishing normal communication between the browser end and the local server end through the updated communication port.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings used in the description of the embodiments of the present application will be briefly described below.
Fig. 1 is a schematic flowchart of a method for updating a data port according to an embodiment of the present disclosure;
fig. 2 is a schematic flowchart of an embodiment of a method for updating a data port according to the present application;
fig. 3 is a schematic structural diagram of an update apparatus of a data port according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are exemplary only for the purpose of explaining the present application and are not to be construed as limiting the present invention.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. As used herein, the term "and/or" includes all or any element and all combinations of one or more of the associated listed items.
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
The following describes the technical solutions of the present application and how to solve the above technical problems with specific embodiments. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
Fig. 1 shows a schematic flowchart of an update method for a data port provided in an embodiment of the present application, and as shown in fig. 1, the method mainly includes:
step S110, when the browser establishes communication with a local server through a first http port, determining whether the communication condition of the first http port meets a preset reconnection condition;
and step S120, if the request is met, the browser sends an updating request for the first http port to the local server in a Urlscheme mode, so that the local server updates the port for establishing the communication between the browser and the local server to a second http port based on the updating request.
In this embodiment of the application, the first http port may be a communication interface pre-established between the browser end and the local service end in a local http manner.
In the embodiment of the application, when the browser end establishes communication with the local server end through the first http port, the browser end may poll each first http port in sequence, and if it is determined that the communication condition of each first http port satisfies the preset reconnection condition, it may be considered that the communication between the browser end and the local server end cannot be established through the first http port.
In practical use, the reconnection condition may include that all the first http ports fail to establish communication, or that all the first http ports fail to establish communication within a preset time period.
The number of the ports of the first http port and the preset duration are selected to take user experience into consideration, the number of the ports of the first http port is suggested to be 5-10, and the value of the preset duration is less than 2 seconds.
In the embodiment of the application, when the communication condition of each first http port meets the preset reconnection condition, the communication ports may be allocated again in an Urlscheme communication manner, specifically, the browser may send an update request for the first http port to the local server in the Urlscheme manner, and the local server updates the port for establishing the communication between the browser and the local server to the second http port based on the update request.
According to the method provided by the embodiment of the application, when the browser end establishes communication with the local server end through the first http port, if the communication condition of the first http port meets the preset reconnection condition, the browser end sends an update request for the first http port to the local server end in a Urlscheme mode, so that the local server end updates a port for establishing communication between the browser end and the local server end to the second http port based on the update request. Based on the scheme, when the communication between the browser end and the local server end cannot be established through the first http port, the communication port is distributed again in the Urlscheme communication mode, the first http port is updated, and a foundation is provided for establishing normal communication between the browser end and the local server end through the updated communication port.
In an optional manner of the embodiment of the present application, the method further includes:
and the browser end establishes communication with the local server end through the second http port.
In the embodiment of the application, the browser terminal can retry to establish communication with the local server terminal through the updated second http port.
Specifically, the browser side may poll each of the second http ports in turn.
In an optional manner of the embodiment of the present application, when the communication with the local server is established through the second http port, if the communication condition of the second http port satisfies the reconnection condition, the method further includes:
and taking the second http port as a first http port, repeatedly executing the browser to send an update request to the first http port to the local server in an Urlscheme manner, so that the local server updates a port for establishing communication between the browser and the local server to the second http port based on the update request, and the browser establishes communication with the local server through the second http port until a preset stop condition is met.
In this embodiment of the application, if it is determined that the communication condition of each second http port satisfies the preset reconnection condition, it may be determined that the communication between the browser side and the local server side cannot be established through the second http port, and the first http port may be used to repeatedly execute the operation of updating the communication port in the manner of Urlscheme until the preset stop condition is reached.
The communication between the browser end and the local service end is established through the updated communication port, and the success rate of establishing communication between the browser end and the local service end can be improved. In practical use, in order to avoid that a lot of time is occupied by updating the communication port for many times and establishing communication by using the updated communication port, and a long-time waiting for a user is caused, a stop condition can be preset to finish the process of establishing communication.
In an optional manner of the embodiment of the present application, the stop condition may include: the repeated execution times reach the preset times.
In the embodiment of the application, the maximum repeated execution times can be preset, when the repeated execution times reach the preset times, the repeated execution is not continued, and a prompt message for communication establishment failure is sent to a user.
In an optional manner of the embodiment of the application, the local server updates a port for establishing communication between the browser and the local server to the second http port based on the update request, and the method includes:
and the local server updates the port for establishing the communication between the browser terminal and the local server terminal into the second http port based on the port information of the second http port carried by the update request.
In the embodiment of the application, the browser end can determine the port information of the second http port and send the update request based on the port information of the second http port, and the local server end can update the port for establishing communication between the browser end and the local server end to the second http port.
In an optional manner of the embodiment of the present application, the sending, by the browser end, an update request for the first http port to the local server end in a manner of Urlscheme includes:
determining whether the current operating system supports Urlscheme;
if the first http port is supported, the browser end sends an update request of the first http port to the local server end in a Urlscheme manner
In the embodiment of the application, before the communication port is updated, whether the current operating system of the device supports the Urlscheme communication mode or not can be determined, and if so, the communication port can be updated; if not, the process of establishing communication can be stopped.
Fig. 2 shows a flowchart of a specific implementation manner provided by an embodiment of the present application, and as shown in fig. 2, a browser end may set initial information such as a port (i.e., a first http port) and a maximum timeout T seconds (i.e., a preset duration) in a local http manner in advance.
The browser end can poll each first http port in sequence to initiate a communication request, and meanwhile, the local server end can monitor the communication request and return a communication establishment result to the browser end.
If the communication request is failed to be established or the communication request is over time for T seconds (that is, a preset reconnection condition is met), the N ports (that is, the second http port) can be updated to perform the next round of communication, specifically, N port information (that is, port information of the second http port) is negotiated through a communication mode of the Urlscheme, and the local server can update the second http port. And then, waiting for the local server to try to establish communication through the second http port, if a reconnection condition is met, retrying the operation step for updating the communication port until the retrying time is greater than C times (namely greater than a preset time), ending the process, and sending a prompt message of communication establishment failure to the user.
Based on the same principle as the method shown in fig. 1, fig. 3 shows a schematic structural diagram of an updating apparatus of a data port provided by an embodiment of the present application, and as shown in fig. 3, the updating apparatus 20 of the data port may include:
the communication condition monitoring module 210 is configured to determine whether a communication condition of the first http port meets a preset reconnection condition when the browser establishes communication with the local server through the first http port;
the port updating module 220 is configured to, when the communication condition of the first http port meets a preset reconnection condition, send, by the browser, an update request for the first http port to the local server in a Urlscheme manner, so that the local server updates, based on the update request, the port for establishing communication between the browser and the local server to the second http port.
According to the device provided by the embodiment of the application, when the browser end establishes communication with the local server end through the first http port, if the communication condition of the first http port meets the preset reconnection condition, the browser end sends the update request for the first http port to the local server end in a Urlscheme manner, so that the local server end updates the port for establishing communication between the browser end and the local server end to the second http port based on the update request. Based on the scheme, when the communication between the browser end and the local server end cannot be established through the first http port, the communication port is distributed again in the Urlscheme communication mode, the first http port is updated, and a foundation is provided for establishing normal communication between the browser end and the local server end through the updated communication port.
Optionally, the apparatus further includes:
and the communication establishing module is used for establishing communication between the browser end and the local server end through the second http port.
Optionally, the communication establishing module is further configured to:
when the communication between the browser and the local server is established through the second http port, if the communication condition of the second http port meets the reconnection condition, the second http port is used as the first http port, the browser repeatedly executes a step of sending an update request for the first http port to the local server through an Urlscheme manner, so that the local server updates a port for establishing the communication between the browser and the local server to the second http port based on the update request, and the browser establishes the communication with the local server through the second http port until a preset stop condition is met.
Optionally, the reconnect condition comprises at least one of:
all the ports in the first http port or the second http port fail to establish communication;
all the ports in the first http port or the second http port cannot establish communication within a preset time.
Optionally, the stop condition comprises:
the repeated execution times reach the preset times.
Optionally, the local server updates a port for establishing communication between the browser and the local server to the second http port based on the update request, by:
and the local server updates the port for establishing the communication between the browser terminal and the local server terminal into the second http port based on the port information of the second http port carried by the update request.
Optionally, when the browser sends an update request for the first http port to the local server in a manner of Urlscheme, the port update module is specifically configured to:
determining whether the current operating system supports Urlscheme;
and if the request is supported, the browser end sends an update request for the first http port to the local server end in a Urlscheme mode.
It is understood that the above modules of the data port updating apparatus in the present embodiment have functions of implementing the corresponding steps of the data port updating method in the embodiment shown in fig. 1. The function can be realized by hardware, and can also be realized by executing corresponding software by hardware. The hardware or software includes one or more modules corresponding to the functions described above. The modules can be software and/or hardware, and each module can be implemented independently or by integrating a plurality of modules. For the functional description of each module of the data port updating apparatus, reference may be specifically made to the corresponding description of the data port updating method in the embodiment shown in fig. 1, and details are not repeated here.
The embodiment of the application provides an electronic device, which comprises a processor and a memory;
a memory for storing operating instructions;
the processor is used for executing the data port updating method provided by any embodiment of the application by calling the operation instruction.
As an example, fig. 4 shows a schematic structural diagram of an electronic device to which an embodiment of the present application is applicable, and as shown in fig. 4, the electronic device 2000 includes: a processor 2001 and a memory 2003. Wherein the processor 2001 is coupled to the memory 2003, such as via bus 2002. Optionally, the electronic device 2000 may also include a transceiver 2004. It should be noted that the transceiver 2004 is not limited to one in practical applications, and the structure of the electronic device 2000 is not limited to the embodiment of the present application.
The processor 2001 is applied to the embodiment of the present application to implement the method shown in the above method embodiment. The transceiver 2004 may include a receiver and a transmitter, and the transceiver 2004 is applied to the embodiments of the present application to implement the functions of the electronic device of the embodiments of the present application to communicate with other devices when executed.
The Processor 2001 may be a CPU (Central Processing Unit), general Processor, DSP (Digital Signal Processor), ASIC (Application Specific Integrated Circuit), FPGA (Field Programmable Gate Array) or other Programmable logic device, transistor logic device, hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. The processor 2001 may also be a combination of computing functions, e.g., comprising one or more microprocessors, DSPs and microprocessors, etc.
Bus 2002 may include a path that conveys information between the aforementioned components. The bus 2002 may be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus 2002 may be divided into an address bus, a data bus, a control bus, and so on. For ease of illustration, only one thick line is shown in FIG. 4, but this does not indicate only one bus or one type of bus.
The Memory 2003 may be a ROM (Read Only Memory) or other type of static storage device that can store static information and instructions, a RAM (Random Access Memory) or other type of dynamic storage device that can store information and instructions, an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical Disc storage, optical Disc storage (including Compact Disc, laser Disc, optical Disc, digital versatile Disc, blu-ray Disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to these.
Optionally, the memory 2003 is used to store application program code for performing aspects of the present application, and execution is controlled by the processor 2001. The processor 2001 is configured to execute the application program code stored in the memory 2003 to implement the method for updating the data port provided in any of the embodiments of the present application.
The electronic device provided by the embodiment of the application is applicable to any embodiment of the method, and is not described herein again.
Compared with the prior art, when the browser end establishes communication with the local server end through the first http port, if the communication condition of the first http port meets a preset reconnection condition, the browser end sends an update request for the first http port to the local server end in a Urlscheme manner, so that the local server end updates a port for establishing communication between the browser end and the local server end to the second http port based on the update request. Based on the scheme, when the communication between the browser end and the local service end cannot be established through the first http port, the communication port can be distributed again in the Urlscheme communication mode, the first http port is updated, and a foundation is provided for establishing normal communication between the browser end and the local service end through the updated communication port.
The embodiment of the present application provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements the method for updating a data port shown in the above method embodiment.
The computer-readable storage medium provided in the embodiments of the present application is applicable to any of the embodiments of the foregoing method, and is not described herein again.
Compared with the prior art, when the browser end establishes communication with the local server end through the first http port, if the communication condition of the first http port meets a preset reconnection condition, the browser end sends an update request for the first http port to the local server end in a Urlscheme manner, so that the local server end updates a port for establishing communication between the browser end and the local server end to the second http port based on the update request. Based on the scheme, when the communication between the browser end and the local service end cannot be established through the first http port, the communication port can be distributed again in the Urlscheme communication mode, the first http port is updated, and a foundation is provided for establishing normal communication between the browser end and the local service end through the updated communication port.
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless otherwise indicated herein. Moreover, at least a portion of the steps in the flow chart of the figure may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
The foregoing is only a partial embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (7)

1. An update method for a data port, comprising:
when a browser establishes communication with a local server through a first http port, determining whether the communication condition of the first http port meets a preset reconnection condition;
if so, the browser end sends an update request for the first http port to the local server end in a Urlscheme manner, so that the local server end updates a port for establishing communication between the browser end and the local server end to a second http port based on the update request;
the local server updates a port for establishing communication between the browser side and the local server side to a second http port based on the update request, and the method comprises the following steps:
the local server side updates a port for establishing communication between the browser side and the local server side to be a second http port based on the port information of the second http port carried by the update request;
taking the second http port as the first http port, repeatedly executing the update request sent by the browser to the local server in a Urlscheme manner, so that the local server updates a port for establishing communication between the browser and the local server to the second http port based on the update request, and the browser establishes communication with the local server through the second http port until a preset stop condition is met;
and the browser end establishes communication with the local server end through the second http port.
2. The method of claim 1, wherein the reconnect condition comprises at least one of:
all the ports in the first http port or the second http port fail to establish communication;
and all the ports in the first http port or the second http port cannot establish communication within a preset time length.
3. The method of claim 2, wherein the stop condition comprises:
the repeated execution times reach the preset times.
4. The method according to any one of claims 1-3, wherein the sending, by the browser side, the update request for the first http port to the local server side by means of Urlscheme comprises:
determining whether the current operating system supports Urlscheme;
and if the request is supported, the browser end sends an update request for the first http port to the local server end in a Urlscheme mode.
5. An apparatus for updating a data port, comprising:
the communication condition monitoring module is used for determining whether the communication condition of a first http port meets a preset reconnection condition when a browser end establishes communication with a local server end through the first http port;
a port updating module, configured to, when a communication condition of the first http port meets a preset reconnection condition, send, by a browser, an update request for the first http port to the local server in a Urlscheme manner, so that the local server updates, based on the update request, a port for establishing communication between the browser and the local server to a second http port;
the local server updates a port for establishing communication between the browser side and the local server side to a second http port based on the update request, and the method comprises the following steps:
the local server side updates a port for establishing communication between the browser side and the local server side to be a second http port based on the port information of the second http port carried by the update request;
taking the second http port as the first http port, repeatedly executing the update request sent by the browser to the local server in a Urlscheme manner, so that the local server updates a port for establishing communication between the browser and the local server to the second http port based on the update request, and the browser establishes communication with the local server through the second http port until a preset stop condition is met;
and the browser end establishes communication with the local server end through the second http port.
6. An electronic device comprising a processor and a memory;
the memory is used for storing operation instructions;
the processor is used for executing the method of any one of claims 1-4 by calling the operation instruction.
7. A computer-readable storage medium, characterized in that the storage medium has stored thereon a computer program which, when being executed by a processor, carries out the method of any one of claims 1-4.
CN202011287058.0A 2020-11-17 2020-11-17 Data port updating method and device, electronic equipment and readable storage medium Active CN112532699B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011287058.0A CN112532699B (en) 2020-11-17 2020-11-17 Data port updating method and device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011287058.0A CN112532699B (en) 2020-11-17 2020-11-17 Data port updating method and device, electronic equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN112532699A CN112532699A (en) 2021-03-19
CN112532699B true CN112532699B (en) 2022-10-25

Family

ID=74981534

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011287058.0A Active CN112532699B (en) 2020-11-17 2020-11-17 Data port updating method and device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN112532699B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107943997A (en) * 2017-12-05 2018-04-20 厦门市美亚柏科信息股份有限公司 A kind of remote website evidence collecting method, terminal device and storage medium based on Google's browser
CN108667861A (en) * 2017-03-28 2018-10-16 比亚迪股份有限公司 By browser to the method, system and server of device real-time monitoring
CN110995683A (en) * 2019-11-26 2020-04-10 深圳市思迪信息技术股份有限公司 Hardware information acquisition method and device based on Web page and computer equipment

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU771770B2 (en) * 2000-06-14 2004-04-01 Sap Aktiengesellschaft Communication between client and server computers via HTTP, method, computer program product and system
EP3396539B1 (en) * 2017-04-28 2021-06-09 Neopost Technologies Method and system for accessing local computer resources through a web browser

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108667861A (en) * 2017-03-28 2018-10-16 比亚迪股份有限公司 By browser to the method, system and server of device real-time monitoring
CN107943997A (en) * 2017-12-05 2018-04-20 厦门市美亚柏科信息股份有限公司 A kind of remote website evidence collecting method, terminal device and storage medium based on Google's browser
CN110995683A (en) * 2019-11-26 2020-04-10 深圳市思迪信息技术股份有限公司 Hardware information acquisition method and device based on Web page and computer equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于Web浏览器的SSL VPN网关系统的设计和实现;张仁等;《计算机工程与设计》;20070228(第04期);第97-100、103页 *

Also Published As

Publication number Publication date
CN112532699A (en) 2021-03-19

Similar Documents

Publication Publication Date Title
CN108712485B (en) Resource subscription method and device for Internet of things equipment
US20170163478A1 (en) Method,electronic device and system for updating client configuration in key-value pair database
CN110808948B (en) Remote procedure calling method, device and system
CN108055311B (en) HTTP asynchronous request method, device, server, terminal and storage medium
CN108833205B (en) Information processing method, information processing device, electronic equipment and storage medium
CN112637121B (en) Data port updating method and device, electronic equipment and readable storage medium
CN110519388B (en) Processing method and device for block chain request, electronic equipment and readable storage medium
CN110881224B (en) Network long connection method, device, equipment and storage medium
CN112532699B (en) Data port updating method and device, electronic equipment and readable storage medium
CN112511603B (en) Data port updating method and device, electronic equipment and readable storage medium
CN111913815A (en) Call request processing method and device, electronic equipment and readable storage medium
CN112948098B (en) Service unit offline method based on micro-service unit architecture and related device
CN112818336A (en) Data access method, data access device and computer readable storage medium
CN113867145A (en) Application control method and device, electronic equipment and storage medium
CN114697339A (en) Load balancing method and device under centralized architecture
CN113572701A (en) Service interface flow control method, device, equipment and storage medium
CN107506491B (en) OSD data distribution method and device of distributed file system
CN112769824B (en) Information transmission state updating method, terminal, device and storage medium
CN110008010A (en) System call method, device, equipment and readable storage medium storing program for executing
CN117201577B (en) Communication method and system of cross-platform API and SPI based on PISA
CN114095310B (en) Cloud edge collaborative management method, device, equipment and medium for intelligent gateway of Internet of things
CN115622988B (en) Call response method and device for web interface, electronic equipment and storage medium
CN108810087B (en) Connection method, system and equipment of storage server
CN112491993A (en) Communication establishing method and device, electronic equipment and computer readable storage medium
CN104796228A (en) Information transmission method, device and system

Legal Events

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