CN117119491A - Network management method of embedded equipment - Google Patents
Network management method of embedded equipment Download PDFInfo
- Publication number
- CN117119491A CN117119491A CN202311078307.9A CN202311078307A CN117119491A CN 117119491 A CN117119491 A CN 117119491A CN 202311078307 A CN202311078307 A CN 202311078307A CN 117119491 A CN117119491 A CN 117119491A
- Authority
- CN
- China
- Prior art keywords
- network
- network management
- thread
- client
- mode
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000007726 management method Methods 0.000 title claims abstract description 73
- 238000000034 method Methods 0.000 claims abstract description 24
- 230000008569 process Effects 0.000 claims abstract description 16
- 230000000977 initiatory effect Effects 0.000 claims abstract description 6
- 230000006872 improvement Effects 0.000 description 9
- 230000007246 mechanism Effects 0.000 description 5
- 238000004891 communication Methods 0.000 description 2
- 238000003780 insertion Methods 0.000 description 2
- 230000037431 insertion Effects 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 230000008092 positive effect Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 239000013589 supplement Substances 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W24/00—Supervisory, monitoring or testing arrangements
- H04W24/02—Arrangements for optimising operational condition
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W24/00—Supervisory, monitoring or testing arrangements
- H04W24/04—Arrangements for maintaining operational condition
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W36/00—Hand-off or reselection arrangements
- H04W36/24—Reselection being triggered by specific parameters
- H04W36/30—Reselection being triggered by specific parameters by measured or perceived connection quality data
- H04W36/305—Handover due to radio link failure
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W88/00—Devices specially adapted for wireless communication networks, e.g. terminals, base stations or access point devices
- H04W88/02—Terminal devices
- H04W88/06—Terminal devices adapted for operation in multiple networks or having at least two operational modes, e.g. multi-mode terminals
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Small-Scale Networks (AREA)
Abstract
The invention discloses a network management method of an embedded device, wherein a physical button for initiating a network switching instruction is arranged on the embedded device; the method comprises the steps that a first thread is arranged, and the first thread is used for processing registration and management of a client; the client comprises a physical button and an APP installed in the equipment; the second thread is arranged and used for responding to the network management request sent by the client; the method comprises the steps that a global variable is set, and the global variable is used for recording a current target network mode and a current network state; and starting a network processing cycle in a main program of the equipment, and processing faults in the network management process according to the global variable. The invention can assist the user and the built-in APP to effectively manage the network under the condition that the equipment does not have a touch display screen, automatically process state information, errors and the like in the network management process, and provides a convenient and effective network management solution with low cost and high reliability for the equipment.
Description
Technical Field
The present invention relates to a network management method, and in particular, to a network management method for an embedded device.
Background
The wireless Wi-Fi module and the Ethernet module are frequently used in the embedded Linux equipment, and the interconnection between the equipment can be efficiently realized through Wi-Fi, so that the problem of Ethernet wiring is effectively avoided; the stable transmission of data can be realized through the Ethernet, and the problem that Wi-Fi is easy to be interfered is solved. The two are used simultaneously, so that the high-efficiency intercommunication between the devices can be realized, and the intelligent communication device is more intelligent.
Because multiple network communication modes are integrated in the embedded device at the same time, management configuration of the network on the device is required. The embedded Linux equipment in the prior art mainly interacts with the equipment through a display touch screen, so as to realize network management and operation of Wi-Fi and Ethernet. The method has the advantages that the implementation of the underlying interactive application is visual, and the corresponding service can be directly opened and closed according to the touch selection of the user.
However, embedded devices in many scenarios are limited by cost and other factors and do not have touch display functionality. In this case, configuration management of the network cannot be completed by touch display interaction. Especially, when a problem occurs in the network connection process, the equipment cannot feed information back to a user through the display screen, and the user cannot take corresponding operation according to the related information, so that network management cannot be effectively performed.
On the other hand, in special equipment such as campus broadcasting loudspeaker boxes, APP (application program) such as music playing and network broadcasting are integrated, and the APP needs to actively initiate specific network connection according to actual use conditions, but an effective network management response mechanism is lacking in the existing embedded equipment, so that the APP cannot be assisted to complete control processing of network connection and intermediate states.
Disclosure of Invention
The invention provides a network management method of embedded equipment, which aims at: the problem that the user and the built-in APP cannot perform effective network management under the condition that the conventional equipment does not have a touch display screen and normal use of network functions is hindered is solved.
The technical scheme of the invention is as follows:
a network management method of embedded equipment, the said embedded equipment is provided with the physical button used for initiating the switching instruction of the network;
the method comprises the steps that a first thread is arranged, and the first thread is used for processing registration and management of a client; the client comprises the physical button and an APP installed in the equipment;
the method comprises the steps that a second thread is arranged, and the second thread is used for responding to a network management request sent by a client;
a global variable is set, and the global variable is used for recording the current target network mode and the current network state;
and starting a network processing cycle in a main program of the equipment, and processing faults in the network management process according to the global variable.
As a further improvement of the network management method of the embedded device: and registering a plurality of first callback functions corresponding to different network modes, wherein the first callback functions are used for processing state information generated when the equipment is switched to the network mode corresponding to the first callback functions.
As a further improvement of the network management method of the embedded device: the second thread calls a first callback function when responding to a network management request sent by the client, and the first callback function sends the formatted state information obtained through processing to the client which initiates the network management request.
As a further improvement of the network management method of the embedded device: and registering a second callback function for analyzing the network management request sent by the client to obtain a target network mode in the network management request.
As a further improvement of the network management method of the embedded device: and the second thread calls a second callback function when responding to a network management request sent by the client, and the analyzed target network mode is stored in the global variable.
As a further improvement of the network management method of the embedded device: and when responding to the network management request sent by the client, the second thread judges to obtain the current network state according to the generated state information and stores the current network state into the global variable.
As a further improvement of the network management method of the embedded device: in the network processing cycle, the current network state of the global variable record is read first, and if the current network state is 'connection failure', the network mode is switched according to the current target network mode of the global variable record.
As a further improvement of the network management method of the embedded device: when the network processing loops switch the network modes, the current network state is judged according to the generated state information, and the current network state is stored in the global variable until the network state is 'successful connection'.
As a further improvement of the network management method of the embedded device: when the equipment is started, the main program firstly switches the equipment to a preset network mode, then starts the first thread and the second thread, and then starts the network processing cycle.
As a further improvement of the network management method of the embedded device: the network modes include Wi-Fi sta mode, wi-Fi softap mode, and Ethernet mode.
Compared with the prior art, the invention has the following positive effects: (1) The invention processes the network management request and the state information generated in the network mode switching process by creating the second thread and the corresponding callback function for processing the client request, and further utilizes the network processing cycle to automatically identify the switching failure condition and switch again by taking the global variable as a bridge, thereby providing an automatic network management mechanism for different network use environments, and enabling the equipment to assist a user and a built-in APP to complete network management under the condition of not having a touch display screen; (2) The invention introduces a client mechanism, takes a physical button operated by a user and a built-in APP as a client, completes the related processing of network management operation by responding to a client request, provides a unified network management interface for the user and the built-in APP, and simultaneously avoids the problem of network unavailability caused by random network switching of illegal processes.
Detailed Description
The following describes the technical scheme of the invention in detail:
the invention discloses a network management method of embedded equipment. The embedded device is not provided with a touch display screen, but is provided with a physical button for initiating a network switching instruction. Typically, the network modes include: including Wi-Fi sta mode, wi-Fi softap mode, and ethernet mode. Correspondingly, three groups of buttons corresponding to the three network modes one by one can be arranged on the device to send out a network mode switching instruction, and other numbers of buttons can be also arranged to distinguish different target network modes by short pressing, long pressing, double clicking and the like.
The device program is provided with a first thread, and the first thread is used for processing registration and management of the client. In the present invention, the client is an abstract concept that includes the physical buttons and also includes the APP (e.g., music playing software) installed in the device. Before the equipment leaves the factory, the physical button is registered as a preset client. Other APP's are received at installation time or through other configuration to complete registration of client. In the device, the client is managed through the database.
And a second thread is arranged in the equipment program, and the second thread is used for responding to a network management request sent by the client.
Meanwhile, three first callback functions corresponding to the three network modes one by one are registered in the program, and a second callback function is also registered. The network_ap_status_handler is a callback function corresponding to the softtap mode, and when Wi-Fi is in the softtap mode, namely in the routing mode, the callback function is responsible for processing related state information of disconnection and connection operation; network_sta_status_handler is a callback function corresponding to a sta mode, and when Wi-Fi is in the sta mode, the processing device processes state information such as scanning, connection-in-process, connection success, connection failure, disconnection, authentication and the like generated in the process of connecting a designated router; network_ethernet_line_status_handler is a callback function corresponding to the ethernet mode for handling status information at the time of ethernet line insertion/disconnection. The first callback function may also send the processed state information to the client. And the second callback function is used for analyzing the network management request sent by the client to obtain a target network mode in the network management request.
The program is also provided with global variables which are used for recording the current target network mode and the current network state.
The working process of the equipment is as follows:
1. when the device is started, a main program Manager is started, and the main program is a core daemon of a network management mechanism.
2. The main program first switches the device to a preset network mode.
3. The main thread registers the three groups of first callback functions: network_ap_status_ handler, network _status_status_handle and network_ethernet_line_status_handle.
4. The main thread starts the first thread and the second thread, and registers a second callback function.
5. The first thread registers the client for physical buttons and other APPs and manages the client through a database.
6. The second thread begins listening for network management requests from the client. When the second thread receives a network management request sent by the client, firstly judging whether the client is registered to pass or not, and if not, not responding. When responding to the request, the second thread firstly calls a second callback function, analyzes the network management request sent by the client, obtains a target network mode in the network management request, and stores the target network mode into the global variable. At the same time, the second thread starts a new thread, and starts the switching work to the target network mode in the new thread. When the network mode is switched, the state information generated in the switching process is processed by calling the corresponding first callback function, and the formatted state information obtained by processing is sent to the client side initiating the network management request. The status information is specific status text information, such as "network line insertion", "network line extraction" in the ethernet mode, and "connected to router" in the sta mode, and the status information is different in different network modes, and the information format required by the client is also different.
When the network mode is switched, the current network state can be judged according to the generated state information, and the current network state is stored in the global variable. The "network state" and the "state information" are not a concept, and the network state has only a few fixed values such as "connection in progress", "connection success", "connection failure", etc., and is a state flag obtained by judging and classifying according to the detailed state information.
7. After step 4, the main program starts the network processing loop main loop. The network processing loop main loop provides a fault-tolerant mechanism for processing faults in the network management process according to the global variable. The cycle is largely divided into three parts: ap, sta and ethernet respectively correspond to the three network modes, and perform conditional jump according to the target network mode to realize targeted processing.
In the network processing cycle, for each target network mode, firstly reading the current network state of the global variable record, and if the current network state is 'connection failure', indicating that the second thread can not complete the switching of the network mode, switching the network mode again according to the target network mode.
When the network processing loop switches the network mode again, the current network state is judged according to the generated state information, and the current network state is stored in the global variable until the network state is 'successful connection'.
In the network processing cycle, the client side initiating the request can be found by inquiring the request record, and the state information generated in the process of re-switching is returned to the client side through the first callback function.
The callback functions and the two threads are tightly matched with the main loop to supplement each other, so that a user and the APP are helped to realize a network management function, the equipment without a touch display screen can automatically complete network switching through key operation of the user or request of the APP, and fault errors in the switching process are automatically processed.
Claims (10)
1. A network management method of embedded equipment is characterized in that: the embedded device is provided with a physical button for initiating a network switching instruction;
the method comprises the steps that a first thread is arranged, and the first thread is used for processing registration and management of a client; the client comprises the physical button and an APP installed in the equipment;
the method comprises the steps that a second thread is arranged, and the second thread is used for responding to a network management request sent by a client;
a global variable is set, and the global variable is used for recording the current target network mode and the current network state;
and starting a network processing cycle in a main program of the equipment, and processing faults in the network management process according to the global variable.
2. The network management method of an embedded device according to claim 1, wherein: and registering a plurality of first callback functions corresponding to different network modes, wherein the first callback functions are used for processing state information generated when the equipment is switched to the network mode corresponding to the first callback functions.
3. The network management method of an embedded device according to claim 2, wherein: the second thread calls a first callback function when responding to a network management request sent by the client, and the first callback function sends the formatted state information obtained through processing to the client which initiates the network management request.
4. The network management method of an embedded device according to claim 1, wherein: and registering a second callback function for analyzing the network management request sent by the client to obtain a target network mode in the network management request.
5. The network management method of an embedded device according to claim 4, wherein: and the second thread calls a second callback function when responding to a network management request sent by the client, and the analyzed target network mode is stored in the global variable.
6. The network management method of an embedded device according to claim 1, wherein: and when responding to the network management request sent by the client, the second thread judges to obtain the current network state according to the generated state information and stores the current network state into the global variable.
7. The network management method of an embedded device according to claim 1, wherein: in the network processing cycle, the current network state of the global variable record is read first, and if the current network state is 'connection failure', the network mode is switched according to the current target network mode of the global variable record.
8. The network management method of an embedded device according to claim 7, wherein: when the network processing loops switch the network modes, the current network state is judged according to the generated state information, and the current network state is stored in the global variable until the network state is 'successful connection'.
9. The network management method of an embedded device according to claim 1, wherein: when the equipment is started, the main program firstly switches the equipment to a preset network mode, then starts the first thread and the second thread, and then starts the network processing cycle.
10. A network management method of an embedded device according to any one of claims 1 to 9, characterized in that: the network modes include Wi-Fi sta mode, wi-Fi softap mode, and Ethernet mode.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311078307.9A CN117119491A (en) | 2023-08-25 | 2023-08-25 | Network management method of embedded equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311078307.9A CN117119491A (en) | 2023-08-25 | 2023-08-25 | Network management method of embedded equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117119491A true CN117119491A (en) | 2023-11-24 |
Family
ID=88801597
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311078307.9A Pending CN117119491A (en) | 2023-08-25 | 2023-08-25 | Network management method of embedded equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117119491A (en) |
-
2023
- 2023-08-25 CN CN202311078307.9A patent/CN117119491A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4403335B2 (en) | Maintenance support system for video processing equipment | |
JP3739633B2 (en) | System and method for exchanging information between software modules | |
US20100275061A1 (en) | Server and method for remotely testing electronic devices | |
CN104916287A (en) | Voice control method and device and mobile device | |
CN103731562B (en) | For the method and apparatus of smart machine Adaptive matching bluetooth equipment | |
WO2015180231A1 (en) | Voice interaction method and apparatus | |
CN101826967B (en) | Data card and dial-up networking method | |
US20040230687A1 (en) | Service management system, and method, communications unit and integrated circuit for use in such system | |
CN105871922A (en) | Television fault locating method, business server and television | |
CN105635200B (en) | Information processing method, electronic equipment, server and system | |
US11812487B2 (en) | Method, device, extender, and computer medium for automatically restoring connection | |
CN117119491A (en) | Network management method of embedded equipment | |
US20120079130A1 (en) | Agent service processing method and internet protocol agent terminal | |
US20070298841A1 (en) | Approach for Module Configuration Management for an Integrated Telecommunication Platform | |
CN109815056A (en) | Method, device, storage medium and equipment for realizing message queue reconnection | |
TW200803282A (en) | Technique for controlling external communication of embedded device using proxy server | |
WO2024002301A1 (en) | Device binding method and apparatus, and computer readable storage medium | |
US7212108B2 (en) | Remote control system | |
CN106713817B (en) | System and method for switching recording sound source in video call | |
CN106970884B (en) | Method and device for processing serial port command applied to android system running layer | |
CN113744451B (en) | Fault processing method, device and storage medium | |
JP2005032192A (en) | Home network device support system, information registration and distribution device, and information distribution method | |
CN115766456B (en) | Factory setting restoration method, device, system and storage medium | |
CN114390436B (en) | Equipment control method and device, storage medium and electronic equipment | |
CN101651757A (en) | Method, system and equipment for realizing report of user intervention media manipulation |
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 |