The content of the invention
The technical problem to be solved in the present invention is that the drawbacks described above for being directed to prior art is based on linux systems there is provided one kind
The application program remote adjustment method and system of system.
The technical solution adopted for the present invention to solve the technical problems is:A kind of application journey based on Linux system of construction
Sequence remote debugging method, it is characterised in that comprise the following steps;
S1, one or more application programs are debugged and are generated with one or more groups of tune-up datas, by this group or many
The shared circle queue data buffer area of group tune-up data write-in, and the write data bits confidence in spatial cache administrative unit is ceased into
Row updates;
S2, detect whether that distal displayed tune-up data terminal device is connected, and detected distal displayed tune-up data
When terminal device is connected, spatial cache administrative unit is scanned and scanned to for shared circle queue data buffer area
During data writing events, next step S3 is performed;
S3, the tune-up data that will write shared circle queue data buffer area by digital independent interface unit are read, and
The tune-up data of reading is sent to distal displayed tune-up data terminal device.
In the above-mentioned application program remote adjustment method based on Linux system of the present invention, before the step S1 also
Comprise the following steps:
S0, the shared circle queue data buffer storage for being used to keep in application program tune-up data for creating a designated memory space
Area.
, will described in the step S1 in the above-mentioned application program remote adjustment method based on Linux system of the present invention
The step of circle queue data buffer area is shared at least one set of tune-up data write-in includes:Connected by buffer area connecting interface unit
Shared circle queue data buffer area is connected to, at least one set of tune-up data of generation is tagged as needed, and pass through data
Write interface unit and tagged tune-up data is write shared circle queue data buffer area.
In the above-mentioned application program remote adjustment method based on Linux system of the present invention, pin described in the step S2
The data writing events for sharing circle queue data buffer area are included:
S21, Read-Write Locks are added to shared circle queue data buffer area;
S22, one of which tune-up data write into shared circle queue data buffer area;
S23, the spatial cache that this group of tune-up data is taken and the remaining storage of shared circle queue data buffer area are empty
Between be compared;The remaining storage that the spatial cache that such as this group tune-up data takes is less than shared circle queue data buffer area is empty
Between, then this group of tune-up data is write direct into annular data storage;The spatial cache that such as this group tune-up data takes is between altogether
Enjoy between the residual memory space of circle queue data buffer area and the memory space of shared circle queue data buffer area, then first
Part tune-up data is removed from shared circle queue data buffer area, is not less than this for shared circle queue data buffer area release
The residual memory space for the spatial cache that group tune-up data takes, then this group of shared circle queue data of tune-up data write-in are delayed
Deposit area;The spatial cache that such as this group tune-up data takes is more than the memory space of shared circle queue data buffer area, then first from
The memory space part tune-up data equal with shared circle queue data buffer area memory space is intercepted in this group of tune-up data,
The part tune-up data is write into shared circle queue data buffer area again;
S24, the write data bits of the shared circle queue data buffer area of modification are put, according to amended shared circle queue number
The data in spatial cache management interface unit are updated according to the write data bits confidence breath of buffer area;
S25, the Read-Write Locks for removing shared circle queue data buffer area.
In the above-mentioned application program remote adjustment method based on Linux system of the present invention, after the step S25 also
Comprise the following steps:
S26, pass through buffer area de-interfaced unit disconnect and Circular buffer area between connection.
In the above-mentioned application program remote adjustment method based on Linux system of the present invention, after the step S26 also
Comprise the following steps:
S27, spatial cache management interface unit is scanned, judges whether that spatial cache management interface unit is arrived in scanning
Write data bits confidence breath renewal.
In the above-mentioned application program remote adjustment method based on Linux system of the present invention, the step S2 with it is described
Also comprise the following steps between step S3:
S23, judge whether the communication connection between commissioning device and distal displayed tune-up data terminal device is normal;As adjusted
The communication connection tried between equipment and distal displayed tune-up data terminal device is normal, then directly performs next step S3;As adjusted
Try equipment and interrupt communication connection with distal displayed tune-up data terminal device, then monitor whether the Service-Port bound in it has
The communication connection request of distal displayed tune-up data terminal device, and recover logical in itself and distal displayed tune-up data terminal device
During letter connection, next step S3 is performed.
In the above-mentioned application program remote adjustment method based on Linux system of the present invention, lead to described in the step S3
Crossing the step of digital independent interface unit reads one group of tune-up data of new write-in shared circle queue data buffer area includes:
S31, Read-Write Locks are added to shared circle queue data buffer area;
S32, by digital independent interface unit shared circle queue data buffer area is conducted interviews and from shared annular
Queuing data buffer area reads this group of tune-up data;
S33, the read data bit confidence breath of the shared circle queue data buffer area of modification, the read data bit confidence of modification is ceased
It is stored in spatial cache management interface unit;
S34, the Read-Write Locks for removing shared circle queue data buffer area.
In the above-mentioned application program remote adjustment method based on Linux system of the present invention, after the step S34 also
Comprise the following steps:
S35, this group of tune-up data progress packing processing by reading, and the tune-up data of packing is sent to distal displayed
Tune-up data terminal device.
The present invention also constructs a kind of application program remote debugging system based on Linux system, including local debugging is set
Standby and distal displayed tune-up data terminal device, the commissioning device runs one or more debugged application programs, institute
State debugged application program and constitute application program collection, the commissioning device also includes shared circle queue data buffer area and tune
Try service module;
In described commissioning device one end, the application program collection needs to export corresponding tune-up data according to debugging, by this
Tune-up data writes the circle queue data buffer area, and manages single to the spatial cache of the circle queue data buffer area
Write data bits confidence breath in member is updated;
The debugging services module is used to the spatial cache administrative unit is scanned and scanned to for described common
When enjoying the data writing events of circle queue data buffer area, the debugging number is read from the shared circle queue data buffer area
The distal displayed tune-up data terminal device is sent to according to and by the tune-up data;
In described distal displayed tune-up data terminal device one end, the distal displayed tune-up data terminal device passes through
TCP/IP is connected to the debugging services module, receives the tune-up data sent by the debugging services module, and this is debugged
Data are printed out.
Implement application program remote adjustment method and system of the invention based on Linux system, can reach following beneficial effect
Really:
1st, " the shared annular formation buffering area " that commissioning device of the present invention is created connects there is provided the access of corresponding system level
Mouthful, and in the interface to " shared annular formation buffering area " by adding unblock to carry out the management to application routine access interface, can
The debugging efforts of multiple application programs are supported simultaneously, are greatly improved maximum based on Linux system application program tune-up data
The ability of output, maximum debugging distance and debugging efficiency.
2nd, commissioning device can manage single by debugging services module to the spatial cache for sharing circle queue data buffer area
Member carries out real time scan to judge the reading and writing data situation of shared circle queue data buffer area, commissioning device once judging there is tune
When trying the shared circle queue data buffer area of data write-in, the tune-up data of write-in is read immediately and will by Ethernet interface
Tune-up data is sent to distal displayed tune-up data terminal device, realizes the remote debugging of application program.
3rd, commissioning device shared circle queue data buffer area tune-up data read-write link forbid other programs to its
Operation is accessed, and at the end of the tune-up data read-write link of shared circle queue data buffer area, decontrols other programs to it
Access, it is ensured that the uniformity of the reading and writing data of shared circle queue data buffer area.
4th, because the shared circle queue data buffer area of the present invention can be to write-in in the case of commissioning device not power down
Application program tune-up data carry out interim storage, therefore the present invention based on Linux system application program remote debugging system tool
Standby offline debugging function and history Debugging message writing function.
Embodiment
In order to solve complex operation in the existing application program debugging technique based on Linux system, to debugging hardware toolses
It is required that it is high, can only locally debug online, and the defect of the linux program debugging inefficiencies to random unexpected abnormality, the present invention
Innovative point be:
1st, the instrument of debugging demand of the present invention is simple, operating personnel's professional technique requires low.This adjustment method is also suitable for
Field adjustable, when commissioning device can not access the internet of wide area, as long as one computer of debugging acid and a netting twine
The collection of tune-up data is completed, linux application programs debugging complexity is greatly reduced.
2nd, " shared annular formation data buffer zone " that commissioning device of the present invention is created there is provided the access of corresponding system level
Interface, and in the interface to " shared annular formation data buffer zone " by adding unblock to carry out the pipe to application routine access interface
Reason, the debugging efforts of multiple application programs can be supported simultaneously, are greatly improved based on Linux system application program tune-up data
The ability of maximum output, maximum debugging distance and debugging efficiency.
3rd, debugging services module 101 carries out reality to the spatial cache administrative unit 1036 of circle queue data buffer area 103
When scan to judge the reading and writing data situation of circle queue data buffer area 103, debugging services program once judging there is debugging number
During according to write-in circle queue data buffer area 103, the tune-up data of write-in is read immediately and the terminal device of distal end is sent to
200, because being transmitted using Ethernet ICP/IP protocol, thus it is big, fast compared to having transmitted data amount for AccessPort equipment
Rate is high, many advantages, such as realize the remote debugging of application program.
4th, debugging services module 101 is forbidden other in shared circle queue data buffer area 103 tune-up data read-write link
Program is operated to its access, and at the end of the tune-up data read-write link of shared circle queue data buffer area 103, is decontroled
Other programs are accessed it, that is, have used the exclusive reference mechanism to circle queue buffer area, to ensure circle queue buffer area
The uniformity of reading and writing data.
5th, because the shared circle queue data buffer area 103 of the present invention can be to writing in the case of commissioning device not power down
The application program tune-up data progress interim storage entered, therefore the application program remote debugging system of the invention based on Linux system
Possess offline debugging function and history Debugging message writing function.
Due to present invention employs introducing multitasking mechanism in commissioning device, and create in commissioning device one
The design of the individual circle queue data buffer area 103 with high data access efficiency, so solving in the prior art because being based on
It is poor, poor to debugging acid requirement height, program operation stability to there is interface compatibility in the application development instrument of Linux system
Cause the technical problem of linux program debugging inefficiencies, realize the application program based on Linux system remote debugging,
Greatly improve application program debugging efficiency and application program tune-up data read-write speed and realize to debugging device memory
The purpose made full use of of resource.
There is provided the access of corresponding system level for " the shared annular formation buffering area " that the debugging services program of the present invention is created
Interface, and in the interface to " shared annular formation buffering area " by adding unblock to carry out the management to application routine access interface,
The debugging efforts of multiple application programs can be supported simultaneously, and the debugging services program can create the annular with high data access efficiency
Queuing data buffer area, the debugging terminal is set up with long-range terminal device by Ethernet and communicated, and greatly improves and is based on
The ability of Linux system application program tune-up data output, debugging efficiency and realize remote debugging technology.
Below in conjunction with drawings and Examples, the invention will be further described:
As shown in figure 1, the application program remote debugging system of the invention based on Linux system includes being located locally and running
The commissioning device 100 of Linux system and with the commissioning device 100 by Transmission Control Protocol set up communicate to connect, positioned at distal end
Distal displayed tune-up data terminal device 200.
As shown in Fig. 2 the commissioning device 100 include shared circle queue data buffer area 103, application program collection 102 with
And debugging services module 101.The application program collection 102 needs to debug at least a application program according to debugging, generates
At least one set of tune-up data, and interface unit 1033 is write by respectively by the data of the shared circle queue data buffer area 103
Group tune-up data is respectively written into the shared circle queue data buffer area 103, and to the shared circle queue data buffer area 103
Spatial cache administrative unit 1036 in write data bits confidence breath be updated.
The debugging services module 101 is additionally operable to manage single to the spatial cache of the shared circle queue data buffer area 103
Member 1036 carries out real time scan and the tune-up data writing events for being directed to the shared circle queue data buffer area 103 are arrived in scanning
When, the trigger signal that tune-up data is read from shared circle queue data buffer area 103 is received, passes through the shared circle queue number
One group of tune of the shared circle queue data buffer area 103 will be newly write according to the digital independent interface unit 1034 of buffer area 103
Data read-out is tried, and this group of tune-up data of reading is sent to the distal displayed tune-up data terminal device 200.
As shown in figure 3, the shared circle queue data buffer area 103 further comprises caching 1035, caching connecting interface
Unit 1031, caching de-interfaced unit 1033, data write-in interface unit 1033, digital independent interface unit 1034 and caching
Space management unit 1036.Application program collection 102 is connected to caching connecting interface unit 1031, caching de-interfaced unit 1033
And data write interface unit 1033, debugging services module 101 is connected to digital independent interface unit 1034 and spatial cache pipe
Manage unit 1036.
Below by by the present invention second better embodiment exemplified by, to application journey of the present invention based on Linux system
The flow of sequence remote debugging method is illustrated:
As shown in figure 4, in step S101, upper electric power-on operation is performed to commissioning device.
In step s 102, debugging services module 101 creates being debugged for keeping in application program for a designated memory space
The shared circle queue data buffer area 103 of data.
In step s 103, application program collection 102 performs the debugging efforts of at least a application program, and generation is at least one set of
Tune-up data, and each group tune-up data is tagged respectively as desired by the title of each money application program.
In step S104, tagged one group of tune-up data is write and shares circle queue data buffer area 103, and
When this group of tune-up data write operation is finished, the write data bits confidence breath of the shared circle queue data buffer area 103 of modification,
Number to spatial cache administrative unit 1036 is ceased according to the write data bits confidence of the shared circle queue data buffer area 103 of modification
According to being updated.
In step S105, judge between debugging services module 101 and distal displayed tune-up data terminal device 200 whether
Interrupt communication connection.Such as judge that debugging services module 101 does not interrupt communication link with distal displayed tune-up data terminal device 200
Connect, then perform step S106.Such as judge that debugging services module 101 and distal displayed tune-up data terminal device 200 are open close in
Letter connection, then perform step S108.
In step s 106, debugging services module 101 carries out real time scan to spatial cache administrative unit 1036, and judgement is
The no data writing events generated for shared circle queue data buffer area 103.As pin is arrived in the scanning of debugging services module 101
Data writing events to sharing circle queue data buffer area 103, then receive by system generate from shared circle queue number
The trigger signal of tune-up data is read according to buffer area 103.
In step s 107, debugging services module 101 passes through 1034 pairs of shared circle queue numbers of digital independent interface unit
Conducted interviews according to buffer area 103, and read the one group of application program debugging for being newly written to shared circle queue data buffer area 103
Data.
In step S108, periodically sent to commissioning device 100 by distal displayed tune-up data terminal device 200
Communication connection request.When distal displayed tune-up data terminal device 200 and commissioning device 100 re-establish communication connection, adjust
Examination service module 101 is conducted interviews by 1034 pairs of shared circle queue data buffer areas 103 of digital independent interface unit, and will
One group of tune-up data of the new shared circle queue data buffer area 103 of write-in is read.
Step S107 or step S108 continue executing with step S109 after being finished.
In step S109,101 pairs of this group of tune-up datas of debugging services module carry out packing processing, and by the tune after packing
Examination data, which are sent on distal displayed tune-up data terminal device 200, to be shown.
Because local commissioning device 100 of the invention creates the shared circle queue data buffer area for having high data access efficiency
103 and multitasking mechanism is employed, therefore in the present invention, program debugging personnel can debug number by the distal displayed of distal end
Carry out operating in multiple application program debugging efforts of commissioning device 100 simultaneously according to terminal device 200, and real-time reception is by this
Multigroup application program tune-up data that ground commissioning device 100 is passed back.The present invention not only realizes the remote debugging of application program, is
Program debugging personnel provide the work facility handled official business in strange land, also drastically increase the debugging efficiency of application program.
Below by by taking the 3rd better embodiment of the present invention as an example, circle queue data buffer area is shared to the present invention
103 tune-up data write-in link is illustrated:
As shown in figure 5, in step S1041, the program process by cache connecting interface unit 1031 be connected to it is shared
Circle queue data buffer area 103.
In step S1042, to shared circle queue data buffer area 103 plus Read-Write Locks, to avoid on commissioning device 100
Other application program synchronization to share circle queue data buffer area 103 data access caused by software rush
It is prominent.
In step S1043, judge whether the spatial cache that this group of tune-up data takes is less than shared circle queue data
The residual memory space of buffer area 103.The spatial cache that such as this group tune-up data takes is less than or equal to shared circle queue number
According to the residual memory space of buffer area 103, then step S1044 is performed.The spatial cache that such as this group tune-up data takes is more than altogether
The residual memory space of circle queue data buffer area 103 is enjoyed, then performs step S1045.
In step S1044, directly write interface unit 1033 by data and write this group of tune-up data and share annular
Queuing data buffer area 103.
In step S1045, this group of tune-up data and the memory space of shared circle queue data buffer area are compared
Compared with.Residual memory space and shared circle queue data of such as this group tune-up data between shared circle queue data buffer area delay
Between the memory space for depositing area, then part tune-up data first is removed from shared circle queue data buffer area 103, for shared annular
Queuing data buffer area 103 discharges certain memory space so that the remaining storage of shared circle queue data buffer area 103 is empty
Between be not less than the caching space-consuming of this group of tune-up data, then write interface unit 1033 by data and write this group of tune-up data
Enter shared circle queue data buffer area 103.The storage that such as this group tune-up data is more than shared circle queue data buffer area is empty
Between, then a memory space is intercepted from this group of tune-up data equal with the shared memory space of circle queue data buffer area 103
Part tune-up data, then the part tune-up data is write into shared circle queue data buffer area 103.
In step S1046, the Read-Write Locks of shared circle queue data buffer area 103 are removed, i.e., to sharing circle queue
Data buffer area 103 is unlocked, so as to decontrol other application program on commissioning device 100 to sharing circle queue data
Buffer area 103 carries out the operating right of data access.
In step S1047, stop the data write operation for shared circle queue data buffer area 103, and pass through
Cache the interruption of de-interfaced unit 1033 and the connection of shared circle queue data buffer area 103.
Below by by taking the 4th better embodiment of the present invention as an example, the present invention is delayed for shared circle queue data
The tune-up data reading link for depositing area 103 is illustrated:
As shown in fig. 6, in step S1071, to shared circle queue data buffer area 103 plus Read-Write Locks, to forbid adjusting
Try the operation that other programs in equipment 100 carry out data access in synchronization to sharing circle queue data buffer area 103
Authority.
In step S1072, debugging services module 101 passes through 1034 pairs of shared circle queue numbers of digital independent interface unit
Conducted interviews according to buffer area 103, this group of tune-up data is read from shared circle queue data buffer area 103.
In step S1073, the read data bit confidence breath of the shared circle queue data buffer area 103 of modification.
In step S1074, the read data bit confidence breath of the shared circle queue data buffer area 103 of modification is stored in
Spatial cache administrative unit 1036.
In step S1075, the Read-Write Locks of shared circle queue data buffer area 103 are removed, to decontrol commissioning device 100
On other programs to share circle queue data buffer area 103 data access operation authority.
Embodiments of the invention are described above in conjunction with accompanying drawing, but the invention is not limited in above-mentioned specific
Embodiment, above-mentioned embodiment is only schematical, rather than restricted, one of ordinary skill in the art
Under the enlightenment of the present invention, in the case of present inventive concept and scope of the claimed protection is not departed from, it can also make a lot
Form, these are belonged within the protection of the present invention.