CN113839973A - Communication connection method, device, equipment and storage medium - Google Patents
Communication connection method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN113839973A CN113839973A CN202010581067.4A CN202010581067A CN113839973A CN 113839973 A CN113839973 A CN 113839973A CN 202010581067 A CN202010581067 A CN 202010581067A CN 113839973 A CN113839973 A CN 113839973A
- Authority
- CN
- China
- Prior art keywords
- connection
- communication
- preset
- connection request
- upper computer
- 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.)
- Granted
Links
- 238000004891 communication Methods 0.000 title claims abstract description 149
- 238000000034 method Methods 0.000 title claims abstract description 82
- 230000008569 process Effects 0.000 claims abstract description 41
- 238000012795 verification Methods 0.000 claims abstract description 22
- 238000004590 computer program Methods 0.000 description 12
- 230000006870 function Effects 0.000 description 8
- 238000010586 diagram Methods 0.000 description 6
- 238000007726 management method Methods 0.000 description 5
- FFBHFFJDDLITSX-UHFFFAOYSA-N benzyl N-[2-hydroxy-4-(3-oxomorpholin-4-yl)phenyl]carbamate Chemical compound OC1=C(NC(=O)OCC2=CC=CC=C2)C=CC(=C1)N1CCOCC1=O FFBHFFJDDLITSX-UHFFFAOYSA-N 0.000 description 4
- 238000001514 detection method Methods 0.000 description 3
- 230000007246 mechanism Effects 0.000 description 3
- 230000002093 peripheral effect Effects 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 238000012360 testing method Methods 0.000 description 3
- 235000015429 Mirabilis expansa Nutrition 0.000 description 2
- 244000294411 Mirabilis expansa Species 0.000 description 2
- 230000009471 action Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 239000004973 liquid crystal related substance Substances 0.000 description 2
- 235000013536 miso Nutrition 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000010365 information processing Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000002035 prolonged effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/14—Session management
- H04L67/141—Setup of application sessions
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer And Data Communications (AREA)
- Communication Control (AREA)
Abstract
The invention relates to the field of communication, and provides a communication connection method, a communication connection device, a communication connection equipment and a storage medium, wherein a preset communication pipeline can be selected to be connected with an upper computer, when an electronic device executes a process, a connection request received from the upper computer in a preset connection window is received, the connection request is verified to ensure the reliability of the connection request, when the connection request passes the verification, the communication protocol type of the connection request is determined, and the preset communication pipeline is started to be connected with the upper computer to realize the rapid establishment of communication connection with the upper computer.
Description
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a communication connection method, apparatus, device, and storage medium.
Background
In the prior art, in order to meet requirements of a DFU (device firmware upgrade) or a test, a protocol connection mechanism needs to be inserted in advance in a normal operation process of an electronic device, and whether an upper computer is connected is determined through the protocol connection mechanism.
However, the above solutions generally have the following problems:
1. when the connection requirement is not met, the operation time is prolonged because the connection timeout time needs to be waited for too long;
2. when no connection request exists, a complete connection flow still needs to be operated, and other processes of the electronic equipment can be continuously executed by judging overtime or other software and hardware states, so that the operation time is increased;
3. when there is no connection request, the corresponding hardware module and pin still need to be operated according to the connection flow to affect the state of the hardware pin, and at this time, if other devices are connected to the pin, the electrical characteristics of the device will be affected.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a communication connection method, apparatus, device and storage medium capable of quickly establishing a communication connection with an upper computer.
A communication connection method is applied to an electronic device, the electronic device is communicated with an upper computer, and the communication connection method comprises the following steps:
selecting a preset communication pipeline to be connected with the upper computer;
when the electronic equipment executes a process, receiving a connection request received from the upper computer in a preset connection window;
verifying the connection request;
when the connection request passes the verification, determining the communication protocol type of the connection request;
and starting the preset communication pipeline to establish connection with the upper computer.
According to the preferred embodiment of the invention, the connection request is sent to the electronic device by the upper computer every preset period.
According to a preferred embodiment of the present invention, the duration of the preset connection window is greater than the preset period, and a difference between the duration of the preset connection window and the preset period is less than or equal to a preset threshold.
According to a preferred embodiment of the present invention, said verifying said connection request comprises:
extracting data of the connection request;
when the data of the connection request is matched with preset data, determining that the connection request passes verification; or;
and when the data of the connection request is not matched with the preset data, determining that the connection request is not verified.
According to a preferred embodiment of the invention, the method further comprises:
and when the connection request does not pass the verification, continuously receiving the connection request received from the upper computer in the preset connection window.
According to a preferred embodiment of the present invention, the starting of the connection between the preset communication pipe and the upper computer includes:
when the preset communication pipeline is in serial port communication, starting a UART RX pin to establish connection with the upper computer; or
When the preset communication pipeline is I2C communication, starting an I2C pin to establish connection with the upper computer; or
And when the preset communication pipeline is SPI communication, starting an SPI pin to be connected with the upper computer.
According to a preferred embodiment of the present invention, the starting of the connection between the preset communication pipe and the upper computer further includes:
the preset communication pipeline is a wireless pipeline and is in wireless connection with the upper computer; wherein the wireless conduit comprises a BLE broadcast.
According to a preferred embodiment of the invention, the method further comprises:
and when the connection request is not received from the upper computer in the preset connection window, continuing to execute the process of the electronic equipment.
A communication connection apparatus, operable on an electronic device, the electronic device being in communication with a host computer, the apparatus comprising:
the selection unit is used for selecting a preset communication pipeline to be connected with the upper computer;
the receiving unit is used for receiving a connection request received from the upper computer in a preset connection window when the electronic equipment executes a process;
a checking unit for checking the connection request;
a determining unit, configured to determine a communication protocol type of the connection request when the connection request passes the verification;
and the connecting unit is used for starting the preset communication pipeline to be connected with the upper computer.
An electronic device, the electronic device comprising:
a memory storing at least one instruction; and
a processor executing instructions stored in the memory to implement the communication connection method.
A computer-readable storage medium having at least one instruction stored therein, the at least one instruction being executable by a processor in an electronic device to implement the communication connection method.
According to the technical scheme, the method and the device can select the preset communication pipeline to be connected with the upper computer, receive the connection request received from the upper computer in the preset connection window when the electronic equipment executes the process, verify the connection request to ensure the reliability of the connection request, determine the communication protocol type of the connection request when the connection request passes the verification, and start the preset communication pipeline to be connected with the upper computer so as to realize the quick establishment of the communication connection with the upper computer.
Drawings
Fig. 1 is a flow chart of a communication connection method according to a preferred embodiment of the present invention.
FIG. 2 is a schematic diagram of the execution process of the present invention.
Fig. 3 is a functional block diagram of a preferred embodiment of the communication connection apparatus of the present invention.
Fig. 4 is a schematic structural diagram of an electronic device implementing a communication connection method according to a preferred embodiment of the invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in detail with reference to the accompanying drawings and specific embodiments.
Fig. 1 is a flow chart of a communication connection method according to a preferred embodiment of the present invention. The order of the steps in the flow chart may be changed and some steps may be omitted according to different needs.
The communication connection method is applied to one or more electronic devices, which are devices capable of automatically performing numerical calculation and/or information processing according to preset or stored instructions, and the hardware thereof includes, but is not limited to, a microprocessor, an Application Specific Integrated Circuit (ASIC), a Programmable Gate Array (FPGA), a Digital Signal Processor (DSP), an embedded device, and the like.
The electronic device may be any electronic product capable of performing human-computer interaction with a user, for example, a Personal computer, a tablet computer, a smart phone, a Personal Digital Assistant (PDA), a game machine, an interactive Internet Protocol Television (IPTV), an intelligent wearable device, and the like.
The electronic device may also include a network device and/or a user device. The network device includes, but is not limited to, a single network server, a server group consisting of a plurality of network servers, or a Cloud Computing (Cloud Computing) based Cloud consisting of a large number of hosts or network servers.
The Network where the electronic device is located includes, but is not limited to, the internet, a wide area Network, a metropolitan area Network, a local area Network, a Virtual Private Network (VPN), and the like.
And S10, selecting a preset communication pipeline to be connected with the upper computer.
The preset communication pipeline refers to a physical communication channel, such as a Serial port, an SPI (Serial Peripheral Interface), an I2C (Inter-Integrated Circuit, Serial communication bus), and the like, and is determined when the upper computer is connected to the electronic device.
And S11, when the electronic equipment executes the process, receiving a connection request received from the upper computer in the preset connection window.
In this embodiment, the electronic device communicates with the upper computer.
Further, the processes may include various processes of the electronic device in normal operation.
In this embodiment, the connection request is sent to the electronic device by the upper computer every preset period.
In this embodiment, the duration of the preset connection window is greater than the preset period, and a difference between the duration of the preset connection window and the preset period is less than or equal to a preset threshold.
And the duration of the preset connection window, the preset period and the preset threshold value can be configured according to actual requirements.
For example: the duration of the preset connection window may be configured to be 25ms, the preset threshold may be configured to be 5ms, and the preset period may be configured to be 20 ms.
Through the above embodiment, will predetermine the length of time configuration of connecting the window and be greater than predetermine the cycle, can guarantee to receive the connection request avoids influencing the normal connection with the host computer because of missing the connection request, simultaneously, will predetermine the length of time configuration of connecting the window and be a little higher than predetermine the cycle, can effectively reduce the connection latency, avoid influencing the normal execution of other threads of system because long-time connection waits.
S12, the connection request is verified.
In at least one embodiment of the present invention, in order to ensure the reliability of the connection request, the connection request needs to be checked.
Specifically, the verifying the connection request includes:
extracting data of the connection request;
when the data of the connection request is matched with preset data, determining that the connection request passes verification; or;
and when the data of the connection request is not matched with the preset data, determining that the connection request is not verified.
The preset data may be data agreed in advance between the electronic device and the upper computer.
Specifically, different connection requests correspond to different communication protocols, the upper computer sends the connection requests according to the requirements of the communication protocols, and the electronic equipment selects different communication protocols according to the received connection requests; for example, the DFU (device firmware update) may be preset to "CCCC", and the connection request data of the test protocol may be preset to "TTTT".
Preferably, the data of the connection request may further include a repeated data sequence, for example, the data of the connection request is 3 consecutive characters "ACTIONS", when the data of the connection request matches the preset data, only one character string "action" needs to be matched, that is, it is considered that "the data of the connection request matches the preset data", and it may be determined that the connection request passes the verification.
In at least one embodiment of the invention, the method further comprises:
and when the connection request does not pass the verification, continuously receiving the connection request received from the upper computer in the preset connection window.
By the embodiment, the receiving can be continuously executed when the connection request is determined not to pass the verification, so that the detection leakage is avoided.
S13, when the connection request passes the check, determining the communication protocol type of the connection request.
The communication protocol type is a communication protocol type constructed on a communication pipeline, and for example, based on a UART (Universal Asynchronous Receiver Transmitter), a firmware upgrade protocol may be selected, and a software test protocol may also be selected.
The communication protocol types may include, but are not limited to: serial communication, I2C communication, SPI communication, and the like.
And S14, starting the preset communication pipeline to establish connection with the upper computer.
Specifically, the starting the preset communication pipeline and the connection establishment of the upper computer comprise:
when the preset communication pipeline is in serial port communication, starting a UART RX pin to establish connection with the upper computer; or
When the preset communication pipeline is I2C communication, starting an I2C pin to establish connection with the upper computer; or
And when the preset communication pipeline is SPI communication, starting an SPI pin to be connected with the upper computer.
For example, the I2C pins may include I2C clock, I2C data, etc., and the SPI pins may include SPI clock, SPI MISO, SPI SS, etc.
Through the embodiment, different pins can be started to be connected with the upper computer according to different communication pipelines, and connection failure is avoided.
Further, the starting the preset communication pipeline and the connection establishment of the upper computer further comprises:
the preset communication pipeline is a wireless pipeline and is in wireless connection with the upper computer; wherein the wireless conduit comprises a BLE broadcast.
In at least one embodiment of the invention, the method further comprises:
and when the connection request is not received from the upper computer in the preset connection window, continuing to execute the process of the electronic equipment.
As shown in fig. 2, the process is executed schematically, the processes being executed by the electronic device are process0 and process1, the process corresponding to the preset connection window is a process connection, after the process0 is finished, the process connection is entered, and when the process connection is not received from the upper computer in the preset connection window, the process1 is continuously executed.
Through the implementation mode, the problem that a complete connection process still needs to be operated when no connection request exists can be effectively solved, and the corresponding hardware module and the corresponding pins do not need to be operated according to the connection process so as to influence the state of the hardware pins, so that the electric characteristics of the device are prevented from being influenced when other devices are connected to the pins.
According to the technical scheme, the method and the device can select the preset communication pipeline to be connected with the upper computer, receive the connection request received from the upper computer in the preset connection window when the electronic equipment executes the process, verify the connection request to ensure the reliability of the connection request, determine the communication protocol type of the connection request when the connection request passes the verification, and start the preset communication pipeline to be connected with the upper computer so as to realize the quick establishment of the communication connection with the upper computer.
Fig. 3 is a functional block diagram of a communication connection device according to a preferred embodiment of the present invention. The communication connection device 11 comprises a receiving unit 110, a checking unit 111, a determining unit 112, a connecting unit 113 and a selecting unit 114. The module/unit referred to in the present invention refers to a series of computer program segments that can be executed by the processor 13 and that can perform a fixed function, and that are stored in the memory 12. In the present embodiment, the functions of the modules/units will be described in detail in the following embodiments.
The communication connection device 11 operates in an electronic device, the electronic device communicates with an upper computer, and the communication connection device includes:
the selection unit 114 selects a preset communication pipeline to be connected with the upper computer.
The preset communication pipeline refers to a physical communication channel, such as a Serial port, an SPI (Serial Peripheral Interface), an I2C (Inter-Integrated Circuit), and the like, and is set when the upper computer is connected with the electronic device.
When the electronic device executes a process, the receiving unit 110 receives a connection request received from the upper computer in a preset connection window.
Wherein the process may include various processes of the electronic device in normal operation.
In this embodiment, the connection request is sent to the receiving unit 110 by the upper computer every preset period.
In this embodiment, the duration of the preset connection window is greater than the preset period, and a difference between the duration of the preset connection window and the preset period is less than or equal to a preset threshold.
And the duration of the preset connection window, the preset period and the preset threshold value can be configured according to actual requirements.
For example: the duration of the preset connection window may be configured to be 25ms, the preset threshold may be configured to be 5ms, and the preset period may be configured to be 20 ms.
Through the above embodiment, will predetermine the length of time configuration of connecting the window and be greater than predetermine the cycle, can guarantee to receive the connection request avoids influencing the normal connection with the host computer because of missing the connection request, simultaneously, will predetermine the length of time configuration of connecting the window and be a little higher than predetermine the cycle, can effectively reduce the connection latency, avoid influencing the normal execution of other threads of system because long-time connection waits.
The verification unit 111 verifies the connection request.
In at least one embodiment of the present invention, in order to ensure the reliability of the connection request, the connection request needs to be checked.
Specifically, the verifying unit 111 verifies that the connection request includes:
extracting data of the connection request;
when the data of the connection request is matched with preset data, determining that the connection request passes verification; or;
and when the data of the connection request is not matched with the preset data, determining that the connection request is not verified.
The preset data may be data agreed in advance between the electronic device and the upper computer.
Specifically, different connection requests correspond to different communication protocols, the upper computer sends the connection requests according to the requirements of the communication protocols, and the electronic equipment selects different communication protocols according to the received connection requests; for example, the DFU (device firmware update) may be preset to "CCCC", and the connection request data of the test protocol may be preset to "TTTT".
Preferably, the data of the connection request may further include a repeated data sequence, for example, the data of the connection request is 3 consecutive characters "ACTIONS", when the data of the connection request matches the preset data, only one character string "action" needs to be matched, that is, it is considered that "the data of the connection request matches the preset data", and it may be determined that the connection request passes the verification.
In at least one embodiment of the present invention, when the connection request fails to be verified, the receiving unit 110 continues to receive the connection request received from the upper computer within the preset connection window.
By the embodiment, the receiving can be continuously executed when the connection request is determined not to pass the verification, so that the detection leakage is avoided.
When the connection request passes the check, the determination unit 112 determines the communication protocol type of the connection request.
The communication protocol type is a communication protocol type constructed on a communication pipeline, and for example, based on a UART (Universal Asynchronous Receiver Transmitter), a firmware upgrade protocol may be selected, and a software test protocol may also be selected.
The communication protocol types may include, but are not limited to: serial communication, I2C communication, SPI communication, and the like.
The connection unit 113 starts the preset communication pipeline to establish connection with the upper computer.
Specifically, the connection unit 113 starting the preset communication pipeline to establish connection with the upper computer includes:
when the preset communication pipeline is in serial port communication, starting a UART RX pin to establish connection with the upper computer; or
When the preset communication pipeline is I2C communication, starting an I2C pin to establish connection with the upper computer; or
And when the preset communication pipeline is SPI communication, starting an SPI pin to be connected with the upper computer.
For example, the I2C pins may include I2C clock, I2C data, etc., and the SPI pins may include SPI clock, SPI MISO, SPI SS, etc.
Through the embodiment, different pins can be started to be connected with the upper computer according to different communication pipelines, and connection failure is avoided.
Further, the starting the preset communication pipeline and the connection establishment of the upper computer further comprises:
the preset communication pipeline is a wireless pipeline and is in wireless connection with the upper computer; wherein the wireless conduit comprises a BLE broadcast.
In at least one embodiment of the invention, when a connection request is not received from the upper computer in the preset connection window, the process of the electronic equipment is continuously executed.
As shown in fig. 2, the process is schematically executed, the executing processes are process0 and process1, the process corresponding to the preset connection window is a process connection, after the process0 is completed, the process connection is entered, and when the process connection does not receive a connection request from the upper computer in the preset connection window, the process1 is continuously executed.
Through the implementation mode, the problem that a complete connection process still needs to be operated when no connection request exists can be effectively solved, and the corresponding hardware module and the corresponding pins do not need to be operated according to the connection process so as to influence the state of the hardware pins, so that the electric characteristics of the device are prevented from being influenced when other devices are connected to the pins.
According to the technical scheme, the method and the device can select the preset communication pipeline to be connected with the upper computer, receive the connection request received from the upper computer in the preset connection window when the electronic equipment executes the process, verify the connection request to ensure the reliability of the connection request, determine the communication protocol type of the connection request when the connection request passes the verification, and start the preset communication pipeline to be connected with the upper computer so as to realize the quick establishment of the communication connection with the upper computer.
Fig. 4 is a schematic structural diagram of an electronic device according to a preferred embodiment of the present invention.
The electronic device 1 may comprise a memory 12, a processor 13 and a bus, and may further comprise a computer program, such as a communication connection program, stored in the memory 12 and executable on the processor 13.
It will be understood by those skilled in the art that the schematic diagram is merely an example of the electronic device 1, and does not constitute a limitation to the electronic device 1, the electronic device 1 may have a bus-type structure or a star-type structure, the electronic device 1 may further include more or less hardware or software than those shown in the figures, or different component arrangements, for example, the electronic device 1 may further include an input and output device, a network access device, and the like.
It should be noted that the electronic device 1 is only an example, and other existing or future electronic products, such as those that can be adapted to the present invention, should also be included in the scope of the present invention, and are included herein by reference.
The memory 12 includes at least one type of readable storage medium, which includes flash memory, removable hard disks, multimedia cards, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disks, optical disks, etc. The memory 12 may in some embodiments be an internal storage unit of the electronic device 1, for example a removable hard disk of the electronic device 1. The memory 12 may also be an external storage device of the electronic device 1 in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the electronic device 1. Further, the memory 12 may also include both an internal storage unit and an external storage device of the electronic device 1. The memory 12 may be used not only to store application software installed in the electronic apparatus 1 and various types of data such as codes of a communication connection program, etc., but also to temporarily store data that has been output or is to be output.
The processor 13 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same or different functions, including one or more Central Processing Units (CPUs), microprocessors, digital Processing chips, graphics processors, and combinations of various control chips. The processor 13 is a Control Unit (Control Unit) of the electronic device 1, connects various components of the electronic device 1 by various interfaces and lines, and executes various functions and processes data of the electronic device 1 by running or executing programs or modules (for example, executing a communication connection program and the like) stored in the memory 12 and calling data stored in the memory 12.
Illustratively, the computer program may be divided into one or more modules/units, which are stored in the memory 12 and executed by the processor 13 to accomplish the present invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution process of the computer program in the electronic device 1. For example, the computer program may be divided into a receiving unit 110, a checking unit 111, a determining unit 112, a connecting unit 113, a selecting unit 114.
The processor 13 executes an operating system of the electronic device 1 and various installed application programs. The processor 13 executes the application program to implement the steps in the various communication connection method embodiments described above, such as the steps shown in fig. 1.
Alternatively, the processor 13, when executing the computer program, implements the functions of the modules/units in the above device embodiments, for example:
selecting a preset communication pipeline to be connected with the upper computer;
when the electronic equipment executes a process, receiving a connection request received from the upper computer in a preset connection window;
verifying the connection request;
when the connection request passes the verification, determining the communication protocol type of the connection request;
and starting the preset communication pipeline to establish connection with the upper computer.
The integrated unit implemented in the form of a software functional module may be stored in a computer-readable storage medium. The software functional module is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a computer device, or a network device) or a processor (processor) to execute parts of the communication connection method according to the embodiments of the present invention.
The integrated modules/units of the electronic device 1 may be stored in a computer-readable storage medium if they are implemented in the form of software functional units and sold or used as separate products. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented.
Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying said computer program code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM).
Further, the computer-usable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to the use of the blockchain node, and the like.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
The bus may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one arrow is shown in FIG. 3, but this does not indicate only one bus or one type of bus. The bus is arranged to enable connection communication between the memory 12 and at least one processor 13 or the like.
Although not shown, the electronic device 1 may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 13 through a power management device, so as to implement functions of charge management, discharge management, power consumption management, and the like through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The electronic device 1 may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
Further, the electronic device 1 may further include a network interface, and optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a bluetooth interface, etc.), which are generally used for establishing a communication connection between the electronic device 1 and other electronic devices.
Optionally, the electronic device 1 may further comprise a user interface, which may be a Display (Display), an input unit (such as a Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable for displaying information processed in the electronic device 1 and for displaying a visualized user interface, among other things.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
Fig. 4 only shows the electronic device 1 with components 12-13, and it will be understood by a person skilled in the art that the structure shown in fig. 4 does not constitute a limitation of the electronic device 1, and may comprise fewer or more components than shown, or a combination of certain components, or a different arrangement of components.
With reference to fig. 1, the memory 12 of the electronic device 1 stores a plurality of instructions to implement a communication connection method, and the processor 13 executes the plurality of instructions to implement:
selecting a preset communication pipeline to be connected with the upper computer;
when the electronic equipment executes a process, receiving a connection request received from the upper computer in a preset connection window;
verifying the connection request;
when the connection request passes the verification, determining the communication protocol type of the connection request;
and starting the preset communication pipeline to establish connection with the upper computer.
Specifically, the processor 13 may refer to the description of the relevant steps in the embodiment corresponding to fig. 1 for a specific implementation method of the instruction, which is not described herein again.
In the embodiments provided in the present invention, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof.
The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the system claims may also be implemented by one unit or means in software or hardware. The terms second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.
Claims (11)
1. A communication connection method is applied to an electronic device, wherein the electronic device is in communication with an upper computer, and the method comprises the following steps:
selecting a preset communication pipeline to be connected with the upper computer;
when the electronic equipment executes a process, receiving a connection request received from the upper computer in a preset connection window;
verifying the connection request;
when the connection request passes the verification, determining the communication protocol type of the connection request;
and starting the preset communication pipeline to establish connection with the upper computer.
2. The communication connection method according to claim 1, wherein the connection request is sent to the electronic device by the upper computer every preset period.
3. The communication connection method according to claim 1, wherein the duration of the predetermined connection window is greater than the predetermined period, and a difference between the duration of the predetermined connection window and the predetermined period is less than or equal to a predetermined threshold.
4. The communication connection method of claim 1, wherein the verifying the connection request comprises:
extracting data of the connection request;
when the data of the connection request is matched with preset data, determining that the connection request passes verification; or;
and when the data of the connection request is not matched with the preset data, determining that the connection request is not verified.
5. The communication connection method of claim 1, wherein the method further comprises:
and when the connection request does not pass the verification, continuously receiving the connection request received from the upper computer in the preset connection window.
6. The communication connection method according to claim 1, wherein the starting of the preset communication pipe to establish connection with the upper computer comprises:
when the preset communication pipeline is in serial port communication, starting a UART RX pin to establish connection with the upper computer; or
When the preset communication pipeline is I2C communication, starting an I2C pin to establish connection with the upper computer; or
And when the preset communication pipeline is SPI communication, starting an SPI pin to be connected with the upper computer.
7. The communication connection method according to claim 1, wherein the starting of the connection between the preset communication pipe and the upper computer further comprises:
the preset communication pipeline is a wireless pipeline and is in wireless connection with the upper computer; wherein the wireless conduit comprises a BLE broadcast.
8. The communication connection method according to any one of claims 1 to 7, characterized in that the method further comprises:
and when the connection request is not received from the upper computer in the preset connection window, continuing to execute the process of the electronic equipment.
9. A communication connection apparatus, operable on an electronic device, the electronic device being in communication with a host computer, the apparatus comprising:
the selection unit is used for selecting a preset communication pipeline to be connected with the upper computer;
the receiving unit is used for receiving a connection request received from the upper computer in a preset connection window when the electronic equipment executes a process;
a checking unit for checking the connection request;
a determining unit, configured to determine a communication protocol type of the connection request when the connection request passes the verification;
and the connecting unit is used for starting the preset communication pipeline to be connected with the upper computer.
10. An electronic device, characterized in that the electronic device comprises:
a memory storing at least one instruction; and
a processor executing instructions stored in the memory to implement the communication connection method of any one of claims 1 to 8.
11. A computer-readable storage medium characterized by: the computer-readable storage medium has stored therein at least one instruction that is executed by a processor in an electronic device to implement the communication connection method of any one of claims 1 to 8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010581067.4A CN113839973B (en) | 2020-06-23 | 2020-06-23 | Communication connection method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010581067.4A CN113839973B (en) | 2020-06-23 | 2020-06-23 | Communication connection method, device, equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113839973A true CN113839973A (en) | 2021-12-24 |
CN113839973B CN113839973B (en) | 2024-04-12 |
Family
ID=78964037
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010581067.4A Active CN113839973B (en) | 2020-06-23 | 2020-06-23 | Communication connection method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113839973B (en) |
Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1198227A (en) * | 1996-07-01 | 1998-11-04 | 富士通株式会社 | Device and method of controlling intergroup resource utilization |
US6859523B1 (en) * | 2001-11-14 | 2005-02-22 | Qgenisys, Inc. | Universal task management system, method and product for automatically managing remote workers, including assessing the work product and workers |
US20100115048A1 (en) * | 2007-03-16 | 2010-05-06 | Scahill Francis J | Data transmission scheduler |
CN102045325A (en) * | 2009-10-13 | 2011-05-04 | 北京搜狗科技发展有限公司 | Input method and system based on network communication |
CN102781023A (en) * | 2012-07-27 | 2012-11-14 | 浙江宇脉科技有限公司 | Network optimization method based on time window |
WO2012169752A2 (en) * | 2011-06-07 | 2012-12-13 | (주)잉카인터넷 | Authentication system and method for device attempting connection |
US20130144946A1 (en) * | 2011-12-02 | 2013-06-06 | Verizon Patent And Licensing Inc. | Intelligent connection manager |
CN104092559A (en) * | 2014-06-10 | 2014-10-08 | 深圳市信锐网科技术有限公司 | Method and apparatus for configuring connection parameter information of wireless network |
WO2015025189A1 (en) * | 2013-08-18 | 2015-02-26 | Yogesh Chunilal Rathod | Enable user to establish request data specific connections with other users for communication, participation and collaboration |
CN107396290A (en) * | 2017-07-25 | 2017-11-24 | 上海小蚁科技有限公司 | Establish the method and device, storage medium, terminal of WI FI connections |
US20170353365A1 (en) * | 2016-06-07 | 2017-12-07 | Nxp B.V. | Configuring wireless communications and an advertising event according to multiple communication protocols |
US20180341231A1 (en) * | 2017-05-24 | 2018-11-29 | Siemens Aktiengesellschaft | Method for Operating a Cyclically Operating Automation Controller, Automation Controller and Engineering System |
US20190182223A1 (en) * | 2016-06-14 | 2019-06-13 | Alibaba Group Holding Limited | Method and system for establishing connection |
-
2020
- 2020-06-23 CN CN202010581067.4A patent/CN113839973B/en active Active
Patent Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1198227A (en) * | 1996-07-01 | 1998-11-04 | 富士通株式会社 | Device and method of controlling intergroup resource utilization |
US6859523B1 (en) * | 2001-11-14 | 2005-02-22 | Qgenisys, Inc. | Universal task management system, method and product for automatically managing remote workers, including assessing the work product and workers |
US20100115048A1 (en) * | 2007-03-16 | 2010-05-06 | Scahill Francis J | Data transmission scheduler |
CN102045325A (en) * | 2009-10-13 | 2011-05-04 | 北京搜狗科技发展有限公司 | Input method and system based on network communication |
WO2012169752A2 (en) * | 2011-06-07 | 2012-12-13 | (주)잉카인터넷 | Authentication system and method for device attempting connection |
US20130144946A1 (en) * | 2011-12-02 | 2013-06-06 | Verizon Patent And Licensing Inc. | Intelligent connection manager |
CN102781023A (en) * | 2012-07-27 | 2012-11-14 | 浙江宇脉科技有限公司 | Network optimization method based on time window |
WO2015025189A1 (en) * | 2013-08-18 | 2015-02-26 | Yogesh Chunilal Rathod | Enable user to establish request data specific connections with other users for communication, participation and collaboration |
CN104092559A (en) * | 2014-06-10 | 2014-10-08 | 深圳市信锐网科技术有限公司 | Method and apparatus for configuring connection parameter information of wireless network |
US20170353365A1 (en) * | 2016-06-07 | 2017-12-07 | Nxp B.V. | Configuring wireless communications and an advertising event according to multiple communication protocols |
US20190182223A1 (en) * | 2016-06-14 | 2019-06-13 | Alibaba Group Holding Limited | Method and system for establishing connection |
US20180341231A1 (en) * | 2017-05-24 | 2018-11-29 | Siemens Aktiengesellschaft | Method for Operating a Cyclically Operating Automation Controller, Automation Controller and Engineering System |
CN107396290A (en) * | 2017-07-25 | 2017-11-24 | 上海小蚁科技有限公司 | Establish the method and device, storage medium, terminal of WI FI connections |
Also Published As
Publication number | Publication date |
---|---|
CN113839973B (en) | 2024-04-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112559535B (en) | Multithreading-based asynchronous task processing method, device, equipment and medium | |
CN112015663B (en) | Test data recording method, device, equipment and medium | |
CN112506559A (en) | Gray scale publishing method and device based on gateway, electronic equipment and storage medium | |
CN113890712A (en) | Data transmission method and device, electronic equipment and readable storage medium | |
CN112256472B (en) | Distributed data retrieval method and device, electronic equipment and storage medium | |
CN113839973A (en) | Communication connection method, device, equipment and storage medium | |
CN113515265B (en) | Site configuration method, device, equipment and computer readable storage medium | |
CN114816371B (en) | Message processing method, device, equipment and medium | |
CN113076069A (en) | Double-cache method and device, electronic equipment and computer readable storage medium | |
CN110879743A (en) | Task elimination method, device, system and medium based on edge computing environment | |
CN113297228B (en) | MySQL writing method, device, equipment and medium based on multiple live instances | |
CN113626533B (en) | Ultraviolet power detection method and device and electronic equipment | |
CN114327986B (en) | FRB2WDT timeout time determining method, device, equipment and medium | |
CN112637280B (en) | Data transmission method, device, electronic equipment and storage medium | |
CN114650436B (en) | Remote control method, device, equipment and medium based on background service | |
CN113687834B (en) | Distributed system node deployment method, device, equipment and medium | |
CN116418896B (en) | Task execution method, device, equipment and medium based on timer | |
CN116017381A (en) | Bluetooth connection method, device and medium for air conditioner | |
CN115202697A (en) | FPGA (field programmable Gate array) upgrading method, device, equipment and medium | |
CN113505079A (en) | Application program testing method, device, equipment and medium | |
CN113836030A (en) | Guest-obtaining system test method, apparatus, device and medium | |
CN116013311A (en) | Edge intelligent voice recognition method and related equipment | |
CN117632420A (en) | Timing checking method and device based on state driving, electronic equipment and storage medium | |
CN117170663A (en) | Data dictionary generating method, device, equipment and medium based on financial business | |
CN112287318A (en) | Cross-application program login method, device, equipment and medium |
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 |