CN101115261A - System and method for implementing different port switch in embedded system - Google Patents

System and method for implementing different port switch in embedded system Download PDF

Info

Publication number
CN101115261A
CN101115261A CNA2007101474575A CN200710147457A CN101115261A CN 101115261 A CN101115261 A CN 101115261A CN A2007101474575 A CNA2007101474575 A CN A2007101474575A CN 200710147457 A CN200710147457 A CN 200710147457A CN 101115261 A CN101115261 A CN 101115261A
Authority
CN
China
Prior art keywords
port
service
new access
access interface
resource
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
Application number
CNA2007101474575A
Other languages
Chinese (zh)
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.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CNA2007101474575A priority Critical patent/CN101115261A/en
Publication of CN101115261A publication Critical patent/CN101115261A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Transfer Systems (AREA)

Abstract

In order to realize a cut-over of heathendom ends of an embedded system, the invention provides a method to realize the cut-over of heathendom ends of the embedded system, wherein a plurality of kinds of ends are registered in the embedded system and the following steps are implemented when novel switch-in ends are available: A. the type of the novel switch-in ends is tested; B. if the type of the novel switch-in ends is different from the type of the current ends of the system, the ends of the system are set into a novel switch-in ends. The Step B includes the following steps: B1. the service is uninstalled from the current end of the system; B2. the service is installed in the novel switch-in end. The invention also provides a system which implements the methods. The invention can realize the automatic listen-in ends of the embedded system, can cut the heathendom ends over automatically, can improve the flexibility of the communication ways and can bring the advantages of a variety of the communication ways into play.

Description

Realize the system and method that different port switches on the embedded system
Technical field
The present invention relates to the embedded system technology field, relate in particular to a kind of system and method that different port switches of on embedded system, realizing.
Background technology
Embedded system need with host computer (as PC) communication, the communication modes of employing comprises USB communication, serial communication, infrared communication, bluetooth communication etc.The general communication modes that adopts service and port binding in the built-in system software is to give the service initialization default port when embedded system is dispatched from the factory at present, and the user in use can not change.Also promptly, as with system when the dissimilar new access interface of front port inserts in the embedded system, the service in the embedded system can not be carried on this new access interface.
The general communication modes that adopts service and input/output port to bind in the embedded system, present solution are to give service binding default port (default port is the port that communication last time is used) behind the starting terminal.Here after said service is meant embedded system and host computer is connected, communicating by letter between embedded system and the host computer controlled, resolved (may comprise packet to host computer carries out verification, changes that the meaning symbol is handled, conversion Content of communciation), carries out that (this service/module is mainly by calling other modules, carry out the request of host computer, and return execution result) order that sends over of host computer, return results (comprise increase verification, the change meaning etc.) program of giving host computer.
General employing port and service static binding can not switch in the software running process in the present embedded system.Want port to use, port must be registered in system.Here so-called registration, the port system resource required with it that is about to a certain type is mapped.Only register a kind of fixed port in the present embedded system, port and system's binding can not change.
For example, mobile phone and PC communication most common form are USB port and serial ports at present, but port was bound with service when mobile phone dispatched from the factory, in use can not port switching, the mobile phone that dispatches from the factory like this or can only use USB port, can only use serial ports, the user can not select between serial ports and USB mouth.This has brought great inconvenience to the user.Be set to the terminal of serial ports for the port that dispatches from the factory,, can't accomplish at present if the user wants to use USB interface to make its personal computer carry out communication.In mobile phone system when front port be USB port, mobile phone links to each other with host computer by this port and carries out certain service, for example communicates by letter etc.And insert host computer (serial ports be new access interface) with this mobile phone by serial ports as if the user this moment, and then host computer can not communicate by serial ports and this mobile phone, and communication service can't be carried on the serial ports.
The user of embedded system is selected between different port rather than be subject to predesignating of embedded system manufacturer, become the industry problem demanding prompt solution.
Summary of the invention
For solving the problem of between different port, changing in the embedded system, the invention provides a kind of method that different port switches that in embedded system, realizes, registration has polytype port in described embedded system, when new access interface, carries out following steps:
The type of A, the new access interface of detection;
B, if the type of new access interface is different with system current port type, then system works as front port and is set to new access interface.
Above-mentioned method, described step B comprises the steps:
B1, will serve from system when front port unloading;
B2, service is loaded into new access interface.
Above-mentioned method is characterized in that, described B1 comprises the steps:
B11, detection current service state;
B12, if service is in non operating state, carry out B13; If service is in running order, end service;
B13, releasing service and the binding of system when front port;
B14, make the current port of system be in non-operating mode, the system resource that delivery system takies when front port.
Above-mentioned method, described releasing service and system work as front port when the binding of front port is meant with the port resource needle deflection of service.
Above-mentioned method, described step B2 comprises the steps:
B21, be new access interface distributing system resource;
B22, make new access interface be in mode of operation;
B23, will serve and new access interface binding.
Above-mentioned method, described service is meant the new access interface of port resource pointed of will serve with new access interface binding.
Said method also comprises step C, the information of storing new access interface behind the described step B.
The present invention also provides a kind of system that different port switches that realizes in embedded system, registration has polytype port in described embedded system, described system comprises port monitoring module and port controlling module, and whether port is monitored module has new access interface and type thereof in order to monitor; The port controlling module is set to system in order to new access interface and works as front port; Monitor type that module listens to new access interface and this port and system when front port is inconsistent when port, reset the current interface command of system to the transmission of port controlling module, the port controlling module is with new access interface.
Above-mentioned system, described port controlling module has comprised serving controls submodule and port operation submodule, and service control submodule is in order to detect and to control the state of current service and reset the current port command of system to the transmission of port operation submodule when service is in abort state; The port operation submodule is in order to the binding state of control port and service, control port mode of operation and be that port discharges or distributing system resource.
Above-mentioned system, the binding state of described control port and service is meant the port resource needle deflection of service or points to port.
Above-mentioned system, described port operation submodule also is used for new access interface information stores in the middle of the file of described system, after new access interface is fixed with service group, the port operation submodule with new access interface information stores in the middle of the file of described system.
The present invention monitors new access interface and type thereof by realizing embedded system, and according to new access interface type system is worked as front port and change, realized automatic switchover, made embedded system can support multiple communication modes such as USB communication, serial communication, infrared communication, bluetooth communication the variety classes port.Improve the flexibility of communication modes, bring into play the advantage of various communication modes.Greatly increased user's satisfaction.
Description of drawings
Fig. 1 is the inventive method basic flow sheet;
Fig. 2 is the particular flow sheet of step S103 among Fig. 1;
Fig. 3 is a more detailed flow chart of the inventive method;
Fig. 4 is a system diagram of the present invention.
Embodiment
Below in conjunction with accompanying drawing, method and system of the present invention is done concrete and detailed explanation.The present invention is applicable in different port switches adaptively, and described port has comprised USB port, infrared port, bluetooth port, serial ports etc.
Want port to use, port must be registered in system.Generally only register a kind of port in the present embedded system.And among the present invention, need support various ports in embedded system, therefore the type of these ports all need be registered in the middle of the embedded system.
The basic procedure of the inventive method is referring to Fig. 1,
S101: have new port to insert;
S102: detect new access interface whether with embedded system in service binding when front port (being that system works as front port) type identical, if identical, then directly arrive step S104, if difference, then execution in step S103;
S103: system works as front port and is set to new access interface;
S104: finish.
Referring to Fig. 2, S103 has comprised that S201 will serve from system and service has been carried in two steps of new access interface as front port unloading and S202.
Referring to Fig. 3, when new access interface and the current port type of system are inconsistent, carry out S301, the startup system is set to the step of new access interface when front port, carry out S302 afterwards, detect current service state, if service is in non operating state, then directly carry out S304, deactivation system is when the binding of front port and service; If serve in running order, execution in step S303 then, end ongoing service earlier, make it be in non operating state, the service that is in non operating state just can be removed and the binding of working as front port, carry out S304 then, execution in step S305 makes the current port of system be in non-operating mode and discharge the system resource that it takies afterwards, execution in step S306 is new access interface distributing system resource afterwards, and make it be in mode of operation, it can be bound with service, carry out S207 afterwards, new access interface and service are bound.S302~S305 is the more detailed steps of S201 among Fig. 2, and S305~S307 is the more detailed steps of S202 among Fig. 2.Binding can adopt the port resource pointer of service to carry out: service drives port by the port resource pointer, when this certain port of port resource pointed, just is called service and this port binding.For example, if the port resource pointed bluetooth port of service, then service is bound with bluetooth port.This pointer once can only point to a port, and different port may shared identical system resource, so will close during port switching and work as front port, discharges its shared system resource.Certainly, also additive method be can adopt, for example, the title of service and the corresponding mode of a certain data item of port adopted.
Carry out S308 afterwards, new access interface information is kept in the middle of the file, make the default port of system change to the port of new access like this.This step also can omit, and the default port of system still is original port like this.
Below in conjunction with Fig. 4, switching to USB port with serial ports is that example elaborates to process of the present invention:
System of the present invention comprises port monitoring module and port controlling module, and whether port is monitored module has new access interface and type thereof in order to monitor; The port controlling module is set to system in order to new access interface and works as front port; Monitor type that module listens to new access interface and this port and system when front port is inconsistent when port, reset the current interface command of system to the transmission of port controlling module, the new access interface of port controlling module is set to system and works as front port.The port controlling module has comprised service control submodule and port operation submodule, and service control submodule is in order to the state of detection and control current service; The port operation submodule is in order to the binding state of control port and service, control port mode of operation and be that port discharges or distributing system resource;
When detecting current service, service control submodule is in non operating state, then send and reset the current port command of system to the port operation submodule, the port operation submodule is removed when the binding of front port and service, is made the current port of system be in non-operating mode and discharge its system resource, for new access interface distributing system resource and make it be in mode of operation, with described new access interface and service binding;
If it is in running order that service control submodule detects current service, then service control submodule is ended current service, reset the current port command of system to the transmission of port operation submodule, port operation submodule deactivation system when the binding of front port and service, make the current port of system be in non-operating mode and discharge its system resource, for new access interface distributing system resource and make it be in mode of operation, with described new access interface and service binding.
The port controlling module of said system also can be used for new access interface information is kept in the middle of the file of described system, makes the default port of system change to new access interface like this.
Each need use the service of port that a port resource pointer is all arranged, and service can come port is carried out associative operation by the port resource pointer.Use under the situation of serial ports the port resource pointed serial ports of service in the service of embedded system.
Service has comprised port resource pointer, service state interface, opened service interface and has ended service interface.
Interfaces such as port has comprised port type interface, system port interface, opens port interface, close port interface, communication Processing Interface.The read port style interface can provide the type when front port, the port that judge to activate when mainly being used in port activation and serve whether consistent aspect of default port.
Port is monitored module and is listened to after USB port is access in, from the port type interface of USB port, read its type, and read the port type in the port type interface of port of the current sensing of serve port resource pointer and detect whether both consistent, if detect inconsistent, then the control of the service in port controlling module submodule sends and resets the current interface command of system, after service control submodule receives order, detect the state of current service by the service state interface of service, if current service is in running order, then the termination service interface to service sends the termination service command, makes out-of-service.The port operation submodule of service control submodule in the port controlling module reset the current port command of system afterwards, the port operation submodule will make serial ports be in non-operating mode by the close port interface of serial ports, the port operation submodule is with the port resource needle deflection serial ports of service afterwards, make service and serial ports unbind, and discharge the system resource that serial ports takies by the system port interface.The port operation submodule finds the system resource of USB port correspondence in registered port afterwards, and distribute these system resource for it by the system port interface of USB port, finish initialization procedure, and make USB port be in mode of operation by the port interface of opening of USB port, afterwards with the port resource pointed USB port of serving, promptly the address assignment of USB port is given the port resource pointer of service, finish the binding of service and the new USB port that inserts.So far this service is finished from the work that serial ports switches to USB port.
The above only is preferred embodiment of the present invention, not in order to restriction the present invention, all any modifications of being done within the spirit and principles in the present invention, is equal to and replaces and improvement etc., all should be included within protection scope of the present invention.

Claims (11)

1. in embedded system, realize the method that different port switches for one kind, it is characterized in that registration has polytype port in described embedded system, when new access interface, carry out following steps:
The type of A, the new access interface of detection;
B, if the type of new access interface is different with system current port type, then system works as front port and is set to new access interface.
2. the method for claim 1 is characterized in that, described step B comprises the steps:
B1, will serve from system when front port unloading;
B2, service is loaded into new access interface.
3. method as claimed in claim 2 is characterized in that described B1 comprises the steps:
B11, detection current service state;
B12, if service is in non operating state, carry out B13; If service is in running order, end service;
B13, releasing service and the binding of system when front port;
B14, make the current port of system be in non-operating mode, the system resource that delivery system takies when front port.
4. method as claimed in claim 3 is characterized in that, described releasing service and system work as front port when the binding of front port is meant with the port resource needle deflection of service.
5. as the arbitrary described method of claim 2 to 4, it is characterized in that described step B2 comprises the steps:
B21, be new access interface distributing system resource;
B22, make new access interface be in mode of operation;
B23, will serve and new access interface binding.
6. method as claimed in claim 5 is characterized in that, described service is meant the new access interface of port resource pointed of will serve with new access interface binding.
7. method as claimed in claim 5 is characterized in that, also comprises step C, the information of storing new access interface behind the described step B.
8. in embedded system, realize the system that different port switches for one kind, it is characterized in that, registration has polytype port, described system to comprise port monitoring module and port controlling module in described embedded system, and whether port is monitored module has new access interface and type thereof in order to monitor; The port controlling module is set to system in order to new access interface and works as front port; Monitor type that module listens to new access interface and this port and system when front port is inconsistent when port, reset the current port command of system to the transmission of port controlling module, the new access interface of port controlling module is set to system and works as front port.
9. system as claimed in claim 8, it is characterized in that, described port controlling module has comprised serving controls submodule and port operation submodule, and service control submodule is in order to detect and to control the state of current service and reset the current port command of system to the transmission of port operation submodule when service is in abort state; The port operation submodule is in order to the binding state of control port and service, control port mode of operation and be that port discharges or distributing system resource.
10. system as claimed in claim 9 is characterized in that, the binding state of described control port and service is meant the port resource needle deflection of service or points to port.
11. system as claimed in claim 10, it is characterized in that, described port operation submodule also is used for new access interface information stores in the middle of the file of described system, after new access interface is fixed with service group, the port operation submodule with new access interface information stores in the middle of the file of described system.
CNA2007101474575A 2007-09-12 2007-09-12 System and method for implementing different port switch in embedded system Pending CN101115261A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNA2007101474575A CN101115261A (en) 2007-09-12 2007-09-12 System and method for implementing different port switch in embedded system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNA2007101474575A CN101115261A (en) 2007-09-12 2007-09-12 System and method for implementing different port switch in embedded system

Publications (1)

Publication Number Publication Date
CN101115261A true CN101115261A (en) 2008-01-30

Family

ID=39023299

Family Applications (1)

Application Number Title Priority Date Filing Date
CNA2007101474575A Pending CN101115261A (en) 2007-09-12 2007-09-12 System and method for implementing different port switch in embedded system

Country Status (1)

Country Link
CN (1) CN101115261A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102215500A (en) * 2010-04-09 2011-10-12 中兴通讯股份有限公司 Method and device for dynamically transforming port service configurations of AP (Application Processor) and communication module
CN111343190A (en) * 2020-03-05 2020-06-26 贵州宝智达网络科技有限公司 Remote wireless data tamper-proof acquisition equipment and system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102215500A (en) * 2010-04-09 2011-10-12 中兴通讯股份有限公司 Method and device for dynamically transforming port service configurations of AP (Application Processor) and communication module
CN111343190A (en) * 2020-03-05 2020-06-26 贵州宝智达网络科技有限公司 Remote wireless data tamper-proof acquisition equipment and system

Similar Documents

Publication Publication Date Title
EP2439648B1 (en) Auto start method and system of universal serial bus data card
CN101609408B (en) A kind of method and system realizing self-start of terminal equipment
US8738834B2 (en) Method and apparatus for configuring electronic devices to perform selectable predefined functions using device drivers
CN1795434B (en) Program execution control device and program execution control method
WO2012157891A2 (en) Electronic device and method for arranging icons displayed by the electronic device
CN103561414A (en) Terminal and multi-channel data transmission method
EP2320328B1 (en) Operation mode switching of data card and its control method, device and data card
CN101668082A (en) Method for updating acquiescent number of contact person and communication terminal thereof
CN101833466A (en) Terminal device and installing method of driver thereof
CN105573637A (en) Operation method and device for touch screen equipment
CN105335044A (en) Window display processing method in split-screen mode and electronic device
CN101957771A (en) Method and device for installing mobile software for multiple mobile phones simultaneously
CN104717377A (en) Mobile terminal scene mode switching method and device and mobile terminal
CN105515811A (en) USB wireless network card configuration method, host, USB wireless network card and communication system
CN101115261A (en) System and method for implementing different port switch in embedded system
CN101901157A (en) Management software self-starting installation method and system
CN106559550A (en) SIM management method and electronic installation
CN103731468A (en) Method and apparatus for performing hands-free profile control
CN105975306A (en) Application program starting management method and application program starting management apparatus for electronic device
US20020162099A1 (en) Multi-download structure and method of mobile communication terminal
CN104598243A (en) Multi-user application program management method and device applied to intelligent terminal
CN115567901A (en) Method, device, equipment and storage medium for operating user identity identification card
CN105592572A (en) Bluetooth connection control method and terminal
JP2002354063A (en) Radio equipment, wireless card, information processor and device driver loading method
CN109725786A (en) Starting method, user equipment, storage medium and the device of program

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Open date: 20080130