CN101917323A - Data sending method and device - Google Patents
Data sending method and device Download PDFInfo
- Publication number
- CN101917323A CN101917323A CN 201010281605 CN201010281605A CN101917323A CN 101917323 A CN101917323 A CN 101917323A CN 201010281605 CN201010281605 CN 201010281605 CN 201010281605 A CN201010281605 A CN 201010281605A CN 101917323 A CN101917323 A CN 101917323A
- Authority
- CN
- China
- Prior art keywords
- data
- communication link
- send
- handled
- sign
- 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
Images
Landscapes
- Communication Control (AREA)
Abstract
The invention discloses a data sending method and a data sending device. The method comprises the following steps of: acquiring a communication task processing tag; if the communication task processing tag indicates that the processed data needs to be sent to an upper-layer host through a CAN communication link, calling a CAN communication link bottom-layer processing program, calling a common application-layer processing program to process the data needing processing, and calling a CAN communication link bottom-layer sending program to send the processed data to the upper-layer host; and if the communication task processing tag indicates that the processed data needs to be sent to the upper-layer host through an RS485 communication link, calling an RS485 communication link bottom-layer processing program, calling a common application-layer processing program to process the data needing processing, and calling an RS485 communication link bottom-layer sending program to send the processed data to the upper-layer host. The data sending method and the data sending device can improve the reuse rate of programs, and reduce storage resources occupying a system.
Description
Technical field
The present invention relates to data processing field, relate in particular to a kind of data transmission method for uplink and device.
Background technology
The FM301A monitoring equipment is a kind of monitoring equipment based on the Digital Signal Processing function, is mainly used in the monitoring of metro stray current.The FM301A monitoring equipment can be connected with the upper strata main frame by these two kinds communication links without character of CAN communication link and RS485 communication link, the data communication between realization and the upper strata main frame.
With the CAN communication link is example, the FM301A monitoring equipment can receive the request msg message that the upper strata main frame issues by the CAN communication link, the FM301A monitoring equipment calls CAN communication link bottom layer treatment program, calls the data that the application layer process routine processes need send to the upper strata main frame again; Data after will handling by CAN communication link bottom router then send to the upper strata main frame, realize the data communication with the upper strata main frame.In addition, the FM301A monitoring equipment is similarly by the process that RS485 communication link and upper strata main frame carry out communication, does not give unnecessary details herein.
The inventor finds that in practice above-mentioned two kinds is independent of each other without the communication handling procedure on the communication link of character, for CAN communication link and RS485 communication link, each has application layer process program separately.But the application layer process program of CAN communication link and RS485 communication link can be identical, has caused the program reusability low, the storage resources of waste system.
Summary of the invention
A kind of data transmission method for uplink and device are provided in the embodiment of the invention, can have improved the reusability of program, reduced the storage resources of the system that takies.
A kind of data transmission method for uplink comprises:
Obtain communication task and handle sign;
If the data that described communication task will be handled after the sign indication need will be handled by the CAN communication link send to the upper strata main frame, then call CAN communication link bottom layer treatment program, call public application layer process program the more described data that need to handle are handled, and the data of calling after CAN communication link bottom router will be handled send to the upper strata main frame;
If the data that described communication task will be handled after the sign indication need will be handled by the RS485 communication link send to the upper strata main frame, then call RS485 communication link bottom layer treatment program, call public application layer process program the more described data that need to handle are handled, and the data of calling after RS485 communication link bottom router will be handled send to the upper strata main frame.
Wherein, described communication task processing sign is used to indicate the data after need will handling by CAN communication link or RS485 communication link to send to the upper strata main frame.
Alternatively, the described CAN communication link bottom layer treatment program of calling is called after public application layer process program handles the described data of need handling again, also comprises:
Data carry data after the processing send sign; Described data send sign and indicate the data that need call after CAN communication link bottom router will be handled to send to the upper strata main frame.
Alternatively, the described RS485 communication link bottom layer treatment program of calling is called after public application layer process program handles the described data of need handling again, also comprises:
Data carry data after the processing send sign; Described data send sign and indicate the data that need call after RS485 communication link bottom router will be handled to send to the upper strata main frame.
Wherein, the described communication task processing sign that obtains comprises:
From memory, obtain described communication task and handle sign;
Wherein, the processing of the communication task in described memory sign is provided with by interrupt routine; When described interrupt routine monitors the CAN communication link when receiving the request msg message that the upper strata main frame issues, communication task is set in described memory handles sign, the data that this communication task will be handled after the sign indication need will be handled by the CAN communication link send to the upper strata main frame; When described interrupt routine monitors the RS485 communication link when receiving the request msg message that the upper strata main frame issues, communication task is set in described memory handles sign, this communication task is handled the sign indication to be needed to handle which data, and the data after need will handling by the RS485 communication link send to the upper strata main frame.
A kind of data sending device comprises:
Acquisition module is used to obtain communication task and handles sign;
First communication module, be used for when described communication task processing indicates that the data of indicating after need will handling by the CAN communication link send to the upper strata main frame, call CAN communication link bottom layer treatment program, call public application layer process program the more described data that need to handle are handled, and the data of calling after CAN communication link bottom router will be handled send to the upper strata main frame;
Second communication module, be used for when described communication task processing indicates that the data of indicating after need will handling by the RS485 communication link send to the upper strata main frame, call RS485 communication link bottom layer treatment program, call public application layer process program the more described data that need to handle are handled, and the data of calling after RS485 communication link bottom router will be handled send to the upper strata main frame.
Wherein, described communication task processing sign is used to indicate the data after need will handling by CAN communication link or RS485 communication link to send to the upper strata main frame.
Alternatively, the described CAN communication link bottom layer treatment program of calling is called after public application layer process program handles the described data of need handling again, and the data carry data after the processing send sign; Described data send sign and indicate the data that need call after CAN communication link bottom router will be handled to send to the upper strata main frame.
Alternatively, the described RS485 communication link bottom layer treatment program of calling is called after public application layer process program handles the described data of need handling again, and the data carry data after the processing send sign; Described data send sign and indicate the data that need call after RS485 communication link bottom router will be handled to send to the upper strata main frame.
Wherein, described acquisition module specifically is used for obtaining described communication task from memory and handles sign;
Wherein, the processing of the communication task in described memory sign is provided with by interrupt routine; When described interrupt routine monitors the CAN communication link when receiving the request msg message that the upper strata main frame issues, communication task is set in described memory handles sign, the data that this communication task will be handled after the sign indication need will be handled by the CAN communication link send to the upper strata main frame; When described interrupt routine monitors the RS485 communication link when receiving the request msg message that the upper strata main frame issues, communication task is set in described memory handles sign, this communication task is handled the sign indication to be needed to handle which data, and the data after need will handling by the RS485 communication link send to the upper strata main frame.
Compared with prior art, the embodiment of the invention has following beneficial effect:
In the embodiment of the invention, obtain communication task and handle sign, call CAN communication link bottom layer treatment program, call public application layer process program again the data of needs processing are handled, and the data of calling after CAN communication link bottom router will be handled send to the upper strata main frame; Perhaps call RS485 communication link bottom layer treatment program, call public application layer process program again the data of needs processing are handled, and the data of calling after RS485 communication link bottom router will be handled send to the upper strata main frame.Realize no communication link, can carry out public application layer process program, improved the reusability of program, reduced the storage resources of the system that takies.
Description of drawings
In order to be illustrated more clearly in the technical scheme in the embodiment of the invention, to do to introduce simply to the accompanying drawing of required use among the embodiment below, apparently, accompanying drawing in describing below only is some embodiments of the present invention, for those of ordinary skills, under the prerequisite of not paying creative work, can also obtain other accompanying drawing according to these accompanying drawings.
The flow chart of a kind of data transmission method for uplink of providing in the embodiment of the invention is provided Fig. 1;
The structure chart of a kind of data sending device of providing in the embodiment of the invention is provided Fig. 2.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the invention, the technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that is obtained under the creative work prerequisite.
Embodiment one:
See also Fig. 1, the flow chart of a kind of data transmission method for uplink of providing in the embodiment of the invention is provided Fig. 1.As shown in Figure 1, this data transmission method for uplink can may further comprise the steps:
101, obtain communication task and handle sign;
Wherein, above-mentioned communication task processing sign is used to indicate the data after need will handling by CAN communication link or RS485 communication link to send to the upper strata main frame.
For instance, the communication task that obtains in above-mentioned 101 is handled sign and is specifically as follows:
From memory, obtain communication task and handle sign; Wherein, the processing of the communication task in memory sign is provided with by interrupt routine; When interrupting sequential monitoring when the CAN communication link receives the request msg message that the upper strata main frame issues, communication task is set in memory handles sign, the data that this communication task will be handled after the sign indication need will be handled by the CAN communication link send to the upper strata main frame; When interrupting sequential monitoring when the RS485 communication link receives the request msg message that the upper strata main frame issues, communication task is set in memory handles sign, this communication task is handled the sign indication to be needed to handle which data, and the data after need will handling by the RS485 communication link send to the upper strata main frame.
102, if the data that communication task will be handled after the sign indication need will be handled by the CAN communication link send to the upper strata main frame, then call CAN communication link bottom layer treatment program, call public application layer process program again the data of needs processing are handled, and the data of calling after CAN communication link bottom router will be handled send to the upper strata main frame;
For instance, the data after above-mentioned steps 102 is handled can be carried data and be sent sign; Wherein, these data send and indicate that the data that indication need be called after CAN communication link bottom router will be handled send to the upper strata main frame.
103, if the data that communication task will be handled after the sign indication need will be handled by the RS485 communication link send to the upper strata main frame, then call RS485 communication link bottom layer treatment program, call public application layer process program again the data of needs processing are handled, and the data of calling after RS485 communication link bottom router will be handled send to the upper strata main frame.
For instance, the data after above-mentioned steps 103 is handled can be carried data and be sent sign; Wherein, these data send and indicate that the data that indication need be called after RS485 communication link bottom router will be handled send to the upper strata main frame.
In the present embodiment, the data that need to handle comprise alternating voltage, alternating current and other status datas or the like.
Need to prove, the embodiment of the invention not to the order between above-mentioned step 102 and the step 103 to limiting.
The data transmission method for uplink that the embodiment of the invention provides can be applied to the FM301A monitoring equipment, realizes the data communication between FM301A monitoring equipment and the upper strata main frame.
In the embodiment of the invention, obtain communication task and handle sign, call CAN communication link bottom layer treatment program, call public application layer process program again the data of needs processing are handled, and the data of calling after CAN communication link bottom router will be handled send to the upper strata main frame; Perhaps call RS485 communication link bottom layer treatment program, call public application layer process program again the data of needs processing are handled, and the data of calling after RS485 communication link bottom router will be handled send to the upper strata main frame.Realize no communication link, can carry out public application layer process program, improved the reusability of program, reduced the storage resources of the system that takies.
Embodiment two:
See also Fig. 2, the structure chart of a kind of data sending device of providing in the embodiment of the invention is provided Fig. 2.As shown in Figure 2, this data sending device can comprise:
Wherein, above-mentioned communication task processing sign is used to indicate the data after need will handling by CAN communication link or RS485 communication link to send to the upper strata main frame.
For instance, above-mentioned acquisition module 201 obtains communication task and handles sign and be specifically as follows:
For instance, above-mentioned first communication module 202 processing data afterwards can be carried data transmission sign; Wherein, these data send and indicate that the data that indication need be called after CAN communication link bottom router will be handled send to the upper strata main frame.
For instance, above-mentioned second communication module 203 processing data afterwards can be carried data transmission sign; Wherein, these data send and indicate that the data that indication need be called after RS485 communication link bottom router will be handled send to the upper strata main frame.
In the present embodiment, the data that need to handle comprise alternating voltage, alternating current and other status datas or the like.
The data sending device that the embodiment of the invention provides can be used as the part of FM301A monitoring equipment, realizes the data communication between FM301A monitoring equipment and the upper strata main frame.
In the embodiment of the invention, obtain communication task and handle sign, call CAN communication link bottom layer treatment program, call public application layer process program again the data of needs processing are handled, and the data of calling after CAN communication link bottom router will be handled send to the upper strata main frame; Perhaps call RS485 communication link bottom layer treatment program, call public application layer process program again the data of needs processing are handled, and the data of calling after RS485 communication link bottom router will be handled send to the upper strata main frame.Realize no communication link, can carry out public application layer process program, improved the reusability of program, reduced the storage resources of the system that takies.
One of ordinary skill in the art will appreciate that: all or part of step that realizes said method embodiment can be finished by the relevant hardware of program command, aforesaid program can be stored in the computer read/write memory medium, this program is carried out the step that comprises said method embodiment when carrying out; And aforesaid storage medium comprises: various media that can be program code stored such as read-only memory (ROM), random access device (RAM), magnetic disc or CD.
More than a kind of data transmission method for uplink and the device that is provided in the embodiment of the invention is described in detail, used specific case herein principle of the present invention and execution mode are set forth, the explanation of above embodiment just is used for helping to understand method of the present invention and core concept thereof; Simultaneously, for one of ordinary skill in the art, according to thought of the present invention, the part that all can change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.
Claims (10)
1. a data transmission method for uplink is characterized in that, comprising:
Obtain communication task and handle sign;
If the data that described communication task will be handled after the sign indication need will be handled by the CAN communication link send to the upper strata main frame, then call CAN communication link bottom layer treatment program, call public application layer process program the more described data that need to handle are handled, and the data of calling after CAN communication link bottom router will be handled send to the upper strata main frame;
If the data that described communication task will be handled after the sign indication need will be handled by the RS485 communication link send to the upper strata main frame, then call RS485 communication link bottom layer treatment program, call public application layer process program the more described data that need to handle are handled, and the data of calling after RS485 communication link bottom router will be handled send to the upper strata main frame.
2. method according to claim 1 is characterized in that, described communication task is handled sign and is used to indicate the data after need will handling by CAN communication link or RS485 communication link to send to the upper strata main frame.
3. method according to claim 1 is characterized in that, the described CAN communication link bottom layer treatment program of calling is called after public application layer process program handles the described data of need handling again, also comprises:
Data carry data after the processing send sign; Described data send sign and indicate the data that need call after CAN communication link bottom router will be handled to send to the upper strata main frame.
4. method according to claim 1 is characterized in that, the described RS485 communication link bottom layer treatment program of calling is called after public application layer process program handles the described data of need handling again, also comprises:
Data carry data after the processing send sign; Described data send sign and indicate the data that need call after RS485 communication link bottom router will be handled to send to the upper strata main frame.
5. according to each described method of claim 1 to 4, it is characterized in that the described communication task processing sign that obtains comprises:
From memory, obtain described communication task and handle sign;
Wherein, the processing of the communication task in described memory sign is provided with by interrupt routine; When described interrupt routine monitors the CAN communication link when receiving the request msg message that the upper strata main frame issues, communication task is set in described memory handles sign, the data that this communication task will be handled after the sign indication need will be handled by the CAN communication link send to the upper strata main frame; When described interrupt routine monitors the RS485 communication link when receiving the request msg message that the upper strata main frame issues, communication task is set in described memory handles sign, this communication task is handled the sign indication to be needed to handle which data, and the data after need will handling by the RS485 communication link send to the upper strata main frame.
6. a data sending device is characterized in that, comprising:
Acquisition module is used to obtain communication task and handles sign;
First communication module, be used for when described communication task processing indicates that the data of indicating after need will handling by the CAN communication link send to the upper strata main frame, call CAN communication link bottom layer treatment program, call public application layer process program the more described data that need to handle are handled, and the data of calling after CAN communication link bottom router will be handled send to the upper strata main frame;
Second communication module, be used for when described communication task processing indicates that the data of indicating after need will handling by the RS485 communication link send to the upper strata main frame, call RS485 communication link bottom layer treatment program, call public application layer process program the more described data that need to handle are handled, and the data of calling after RS485 communication link bottom router will be handled send to the upper strata main frame.
7. device according to claim 6 is characterized in that, described communication task is handled sign and is used to indicate the data after need will handling by CAN communication link or RS485 communication link to send to the upper strata main frame.
8. device according to claim 6 is characterized in that, the described CAN communication link bottom layer treatment program of calling is called after public application layer process program handles the described data of need handling again, and the data carry data after the processing send sign; Described data send sign and indicate the data that need call after CAN communication link bottom router will be handled to send to the upper strata main frame.
9. device according to claim 6, it is characterized in that, the described RS485 communication link bottom layer treatment program of calling is called after public application layer process program handles the described data of need handling again, and the data carry data after the processing send sign; Described data send sign and indicate the data that need call after RS485 communication link bottom router will be handled to send to the upper strata main frame.
10. according to each described device of claim 6 to 9, it is characterized in that,
Described acquisition module specifically is used for obtaining described communication task from memory and handles sign;
Wherein, the processing of the communication task in described memory sign is provided with by interrupt routine; When described interrupt routine monitors the CAN communication link when receiving the request msg message that the upper strata main frame issues, communication task is set in described memory handles sign, the data that this communication task will be handled after the sign indication need will be handled by the CAN communication link send to the upper strata main frame; When described interrupt routine monitors the RS485 communication link when receiving the request msg message that the upper strata main frame issues, communication task is set in described memory handles sign, this communication task is handled the sign indication to be needed to handle which data, and the data after need will handling by the RS485 communication link send to the upper strata main frame.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 201010281605 CN101917323A (en) | 2010-09-13 | 2010-09-13 | Data sending method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 201010281605 CN101917323A (en) | 2010-09-13 | 2010-09-13 | Data sending method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN101917323A true CN101917323A (en) | 2010-12-15 |
Family
ID=43324718
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN 201010281605 Pending CN101917323A (en) | 2010-09-13 | 2010-09-13 | Data sending method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN101917323A (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1606375A (en) * | 2003-10-09 | 2005-04-13 | Lg电子株式会社 | Mobile communication terminal for supporting multimode |
CN1764182A (en) * | 2004-10-22 | 2006-04-26 | 华为技术有限公司 | Multi protocol processing chip and multi protocol processing apparatus |
US20080259956A1 (en) * | 2004-03-31 | 2008-10-23 | Lg Electronics Inc. | Data Processing Method for Network Layer |
CN101499639A (en) * | 2009-01-24 | 2009-08-05 | 北京清电华力电气自动化科技有限公司 | Relay protection and measurement integrated apparatus with multiple communication interfaces integrated |
-
2010
- 2010-09-13 CN CN 201010281605 patent/CN101917323A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1606375A (en) * | 2003-10-09 | 2005-04-13 | Lg电子株式会社 | Mobile communication terminal for supporting multimode |
US20080259956A1 (en) * | 2004-03-31 | 2008-10-23 | Lg Electronics Inc. | Data Processing Method for Network Layer |
CN1764182A (en) * | 2004-10-22 | 2006-04-26 | 华为技术有限公司 | Multi protocol processing chip and multi protocol processing apparatus |
CN101499639A (en) * | 2009-01-24 | 2009-08-05 | 北京清电华力电气自动化科技有限公司 | Relay protection and measurement integrated apparatus with multiple communication interfaces integrated |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102638397B (en) | USB (universal serial bus) device communication transmission method, device and system | |
US20190004781A1 (en) | Application push method, and a service device | |
US20110216775A1 (en) | System and Method for Multiple Concurrent Virtual Networks | |
CN107347205A (en) | A kind of network section system of selection, apparatus and system | |
CN103685269A (en) | Method and system for both-way communication between web browser and server | |
CN109104491A (en) | A kind of micro services call method, device, server and storage medium | |
CN103049327A (en) | Method and device for mounting many storage devices on android system | |
ATE347225T1 (en) | METHOD AND COMMUNICATION MODULE FOR TRANSMITTING DICOM OBJECTS THROUGH DATA ELEMENT SOURCES | |
CN107589990A (en) | A kind of method and system of the data communication based on thread pool | |
CN111782473A (en) | Distributed log data processing method, device and system | |
CN105898804A (en) | Network co-existing method, device and mobile terminal | |
CN106559447A (en) | The method for processing business and system of JSLEE containers | |
CN107041017A (en) | UE contextual informations restoration methods, device and system | |
CN106331394A (en) | Voice outbound system and outbound method | |
CN105867899A (en) | Method and device for identifying device | |
CN111464352A (en) | Call link data processing method and device | |
CN105094824A (en) | Display method for notification messages on intelligent watch and intelligent watch | |
CN111277983A (en) | RFID middleware, publish-subscribe system and data transmission method | |
CN105847169A (en) | Method and device for traffic control | |
CN106454403A (en) | Data display method, equipment and data display system | |
CN103002446A (en) | Method and device for intercepting call | |
CN113632487A (en) | Coding tree unit size signaling | |
CN101917323A (en) | Data sending method and device | |
WO2006115771A3 (en) | Methods and apparatus for message oriented invocation | |
CN103051484A (en) | Method and system for processing session service and session border controller |
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 |
Application publication date: 20101215 |