Summary of the invention
The object of the invention is to provide a kind of digital TV terminal, without restarting, can conveniently choose the photograph that need to upload, and photograph successfully can be uploaded to photograph album background server when it reads memory element, to realize photograph, shares.
The object of the invention is also to provide a kind of Digital Television photograph uploading system, without restarting digital TV terminal, can conveniently choose the photograph that need to upload, and photograph successfully can be uploaded to photograph album background server when it reads memory element, to realize photograph, shares.
The object of the invention is also to provide a kind of Digital Television photograph method for uploading, photograph successfully can be uploaded to photograph album background server.
For reaching above-mentioned advantage, the invention provides a kind of Digital Television photograph uploading system, it comprises photograph album background server and digital TV terminal.Photograph album background server and digital TV terminal interconnect by network.Digital TV terminal comprises digital photo album application module, and digital photo album application module is connected with photograph album background server, and photograph album background server starts digital photo album application module when receiving the request of uploading photograph data.Digital photo album application module adopts the first byte stream buffer memory to read the photograph data in the memory element that is inserted in digital TV terminal, and photograph data acquisition is uploaded to photograph album background server with employing the second byte stream buffer memory after Java.net.Socket encapsulation, the numerical value of the first byte stream is greater than the numerical value of the second byte stream, and photograph album background server adopts Java.net.ServerSocke to receive and preserve photograph data.
In one embodiment of the invention, described digital TV terminal also comprises photograph album Web program module and middleware, photograph album Web program module is connected with photograph album background server, photograph album Web program module is called application interface by JS and is connected with middleware, and digital photo album application module calls application interface by JS and is connected with middleware.
In one embodiment of the invention, the numerical value of the first described byte stream is 1024*10, and the numerical value of the second byte stream is 512.
The present invention also provides a kind of digital TV terminal, itself and photograph album background server interconnect by network, digital TV terminal comprises digital photo album application module, digital photo album application module is connected with photograph album background server, digital photo album application module adopts the first byte stream buffer memory to read the photograph data in the memory element that is inserted in digital TV terminal, and photograph data acquisition is uploaded to photograph album background server with employing the second byte stream buffer memory after Java.net.Socket encapsulation, the numerical value of the first byte stream is greater than the numerical value of the second byte stream.
In one embodiment of the invention, described digital TV terminal is Set Top Box, IPTV, digital TV integrated machine or intelligent television.
The present invention also provides a kind of Digital Television photograph method for uploading, photograph is uploaded to photograph album background server by digital TV terminal, digital TV terminal comprises digital photo album application module, said method comprising the steps of: step 1: photograph album background server receives the digital photo album application module of uploading the request of photograph data and starting digital TV terminal; Step 2: digital photo album application module adopts the first byte stream buffer memory to read the photograph data in the memory element that is inserted in digital TV terminal; And step 3: digital photo album application module encapsulates photograph data acquisition with Java.net.Socket, and adopt the second byte stream buffer memory that photograph data are sent to photograph album background server, so that affiliated photograph album background service adopts Java.net.ServerSocke receive and preserve described photograph data receiver and preserve, the numerical value of the first byte stream is greater than the numerical value of the second byte stream.
In one embodiment of the invention, described digital TV terminal more comprises photograph album Web program module, and step 1 more comprises the following steps: the request of sending access photograph album by digital TV terminal; Photograph album Web program module is transferred to photograph album background server by the request that receives access photograph album, photograph album background server response access request; Access photograph album also sends newly-built photograph album request by digital TV terminal; The newly-built photograph album of photograph album background server also judges that whether newly-built photograph album is successful; Photograph album background server sends uploads photograph prompting.
In one embodiment of the invention, described access photograph album more comprising by the step that digital TV terminal sends newly-built photograph album request: show digital photo album homepage.
In one embodiment of the invention, between described step 1 and step 2, more comprise the following steps: judge whether digital TV terminal is inserted with memory element.
In one embodiment of the invention, between described step 2 and step 3, more comprise the following steps: preview photograph is also chosen the photograph that need to upload.
In digital TV terminal of the present invention, Digital Television photograph uploading system and method, in digital TV terminal, be provided with digital photo album application module, digital photo album application module can read the photograph data in the memory element that inserts digital TV terminal, without restarting digital TV terminal.Digital photo album application module adopts large byte stream buffer memory while reading photograph data, when being sent to photograph album background server, picture data adopts small character throttling buffer memory, not only can choose quickly and easily the photograph that need to upload, also the larger photograph that takes up room successfully can be uploaded to photograph album background server, to realize photograph, share.
Above-mentioned explanation is only the general introduction of technical solution of the present invention, in order to better understand technological means of the present invention, and can be implemented according to the content of specification, and for above and other objects of the present invention, feature and advantage can be become apparent, below especially exemplified by preferred embodiment, and coordinate accompanying drawing, be described in detail as follows.
Embodiment
For further setting forth the present invention, reach technological means and the effect that predetermined goal of the invention is taked, below in conjunction with accompanying drawing and preferred embodiment, digital TV terminal, Digital Television photograph uploading system and its embodiment of method, structure, feature and effect thereof to proposing according to the present invention, be described in detail as follows.
Figure 1 shows that the configuration diagram of Digital Television photograph uploading system of the present invention.Refer to Fig. 1, the Digital Television photograph uploading system 10 of the present embodiment comprises photograph album background server 11, digital TV terminal 13, television set 15 and remote controller 17, between photograph album background server 11 and digital TV terminal 13, by network, interconnect, be that photograph album background server 11 is all connected with network with digital TV terminal 13, said network can be the Internet here.Digital TV terminal 13 is connected with television set 15, jointly forms common client.Remote controller 17 can communicate by wireless transmission protocol and digital TV terminal 13, and remote controller 17 communicates to connect with digital TV terminal 13, and user can send the request of uploading photograph data to photograph album background server 11 by remote controller 17.
Photograph album background server 11 is common service end, and it provides corresponding service for management resource and according to the service request of client submission.In the present embodiment, photograph album background server 11 be responsible for preserving users photograph data, photograph that receiving digital television terminal 13 is uploaded, process common user's additions and deletions and change the digital photo album application module of looking into business demand and starting digital TV terminal 13, the photograph that digital TV terminal 13 is uploaded can be family's photograph or corporate activity photograph, but not as limit, digital TV terminal 13 also can uploading pictures.
Digital TV terminal 13 includes but not limited to that Set Top Box, IPTV, digital TV integrated machine, intelligent television etc. have the terminal of receiving digital television function, it,, except can receiving digital television broadcast program, also possesses the function that reads photograph and photograph is uploaded to photograph album background server 11.In the present embodiment, digital TV terminal 13 is Set Top Box, on digital TV terminal 13, can plug memory element, memory element can be USB flash disk or SD card (Secure Digital Memory Card, safe digital card), but not as limit, on digital TV terminal 13, can be provided with USB interface, for plugging USB flash disk or supplying, plug the card reader that is accompanied with SD card, except USB interface, on digital TV terminal 13, also can be provided with SD card interface, for directly plugging SD card.Digital TV terminal 13 comprises photograph album Web program module 133, middleware 135 and digital photo album application module 137.Photograph album Web program module 133 and digital photo album application module 137 are all connected with photograph album background server 11.Photograph album Web program module 133 is called application interface by JS and is connected with middleware 135, to realize the communication between photograph album Web program module 133 and middleware 135.Digital photo album application module 137 calls application interface by JS and is connected with middleware 135, to realize the communication between digital photo album application module 137 and middleware 135.
Photograph album Web program module 133 is included in the foreground program of client operation, and it can present to user by digital photo album homepage by television set 15, and receives user's access request.Photograph album Web program module 133 is transferred to photograph album background server 11 by the user's who receives access request, photograph album background server 11 responds and processes user's access request, photograph album Web program module 133 also can be sent photograph album background server 11 photograph album process information according to user access request feeds back to user by television set 15, or the signal that photograph album background server 11 is started to digital photo album application module 137 is transferred to digital photo album application module 137.
Middleware 135 is a kind of independently systems soft ware or service routine, and Distributed Application software is by middleware 135 shared resource between different technology.Middleware 135 provides the Connection Service between photograph album background server 11 and digital TV terminal 13, and these services have routine interface and the agreement of standard.In the present embodiment, by the Connection Service of middleware 135, the digital photo album application module 137 of digital TV terminal 13 can and the communication of 133 of photograph album Web program modules.
Digital photo album application module 137 is responsible for reading photograph data, the interior browsing photo function of support memory element and the encapsulation photograph data in the memory element being inserted on digital TV terminal 13 and is uploaded to photograph album background server 11.Digital photo album application module 137 can directly read the content in memory element, and does not need to restart digital TV terminal 13.Digital photo album application module 137 is supported the preview function of photograph in memory element, but not by the mode preview photograph of JS calling interface, avoids reading less than photograph.Digital photo album application module 137 can be USB digital photo album application module, and it reads the photograph data in memory element by the USB interface on digital TV terminal 13.In the present embodiment, the Design Mode that digital TV terminal 13 adopts Web program to combine with java application, particularly, digital photo album application module 137 adopts Java.net.Socket encapsulation photograph data, photograph album background server 11 adopts Java.net.ServerSocket to receive the photograph data of encapsulation, and by TCP(Transmission Control Protocol, transmission control protocol) link data upload to photograph album background server 11.
It should be noted that, internal memory, CPU(Central Processing Unit due to digital TV terminal 13, CPU (central processing unit)), middleware and PC(Personal Computer, PC) different, so digital photo album application module 137 is when carrying out Socket programming, the cache size of Socket need to be set, and the code for example adopting is: socket.setSendBufferSize (65536), the cache size that is about to Socket is set to 65536 bytes.In addition, the java.io.IOException:Resource temporarily unavailable that dishes out when avoiding reading in memory element photograph data is abnormal, the input and output of dishing out are abnormal, byte stream array need to be established greatly, adopt large byte stream buffer memory, the code for example adopting is: byte[] bufSend=buf=new byte[1024*10], the numerical value that is about to byte stream is set to 1024*10, byte stream is not for comprising the Continuous Flow of data boundary, it is comprised of byte, when the numerical value of byte stream is 1024*10, represent that this byte stream comprises 1024*10 byte; When sending photograph data, byte stream array need to be established littlely, adopt small character throttling buffer memory, the code for example adopting is: int sendBufLen=512; Byte[] bufSend=new byte[sendBufLen], the numerical value that is about to byte stream is set to 512, and this byte stream comprises 512 bytes; So, can reduce the input-output operation that reads memory element, avoid occurring abnormal.The numerical value setting of byte stream is not limited with the present embodiment, during application, can set arbitrarily according to the actual requirements, but need satisfied condition to be, digital photo album application module 137 adopts the first byte stream buffer memory while reading the photograph data in memory element, photograph data when being sent to photograph album background server 11, digital photo album application module 137 are adopted to the second byte stream buffer memory, wherein, the numerical value of the first byte stream is greater than the numerical value of the second byte stream, and the byte quantity that the first byte stream comprises is greater than the quantity of the byte that the second byte stream comprises.
While using Digital Television photograph uploading system 10 to upload photograph, user can send by remote controller 17 request of access photograph album to the photograph album Web program module 133 of digital TV terminal 13, photograph album background server 11 response access request newly-built photograph albums, then, photograph album background server 11 starts digital photo album application module 137 by photograph album Web program module 133 and middleware 135, digital photo album application module 137 read and sealed storage element in photograph data, finally, digital photo album application module 137 by call photograph upload interface by photograph data upload to photograph album background server 11, whether photograph album background server 11 feedback photographs upload successful information to digital photo album application module 137, and show by television set 15.
It should be noted that, in Fig. 1, only schematically illustrating a photograph album background server 11 and a digital TV terminal 13 and a television set 15(is a client), but the present invention is not as limit, in other embodiments, a plurality of clients can share a photograph album background server 11, can share photograph like this between different user.When digital TV terminal 13 is not IPTV, digital TV integrated machine or intelligent television for Set Top Box, can omits television set 15, and directly by digital TV terminal 13, carry out Presentation Functions.
Figure 2 shows that the photograph method for uploading flow chart of the Digital Television photograph uploading system of Fig. 1.Refer to Fig. 2 and Fig. 1, the Digital Television photograph method for uploading of the present embodiment can be uploaded to photograph album background server 11 by digital TV terminal 13 by photograph, and it comprises the following steps:
Step S201, user sends the request of access photograph album by digital TV terminal 13, and user can carry out the transmission of request command by controlling remote controller 17 buttons, the request of the access photograph album that photograph album Web program module 133 reception users send;
Step S202, the request of the access photograph album that photograph album Web program module 133 is sent the user who receives is transferred to photograph album background server 11, photograph album background server 11 response access request;
Step S203, photograph album Web program module 133 can be presented to user by digital photo album homepage by television set 15, and television set 15 shows digital photo album homepage, and it can adopt Web browser to show digital photo album homepage, and realize user, accesses photograph album;
Step S204, user sends newly-built photograph album request, send the request of uploading photograph data, user can send newly-built photograph album request to digital TV terminal 13 by controlling remote controller 17 buttons, and photograph album Web program module 133 receives user's newly-built photograph album request and is transferred to photograph album background server 11;
Step S205, the newly-built photograph album of photograph album background server 11 also judges that whether newly-built photograph album is successful, if unsuccessful, execution step S206, if success, execution step S207;
Step S206, if newly-built photograph album is unsuccessful, photograph album background server 11 sends newly-built photograph album and unsuccessfully points out, and by television set 15 display reminding contents, then, again performs step S204, user sends newly-built photograph album request again;
Step S207, if the success of newly-built photograph album, photograph album background server 11 sends uploads photograph prompting, and by television set 15 display reminding contents;
Step S208, photograph album background server 11 starts digital photo album application module 137 by photograph album Web program module 133 and middleware 135;
Step S209, digital photo album application module 137 judges whether digital TV terminal 13 is inserted with memory element, if do not insert memory element, execution step S210, if be inserted with memory element, execution step S211;
Step S210, if digital TV terminal 13 is not inserted memory element, digital photo album application module 137 sends and inserts memory element prompting, and by television set 15 display reminding contents, after certain interval of time (interlude can be determined according to actual demand), again perform step S209, judge whether digital TV terminal is inserted with memory element, until user is inserted in digital TV terminal 13 by memory element;
Step 211, if digital TV terminal 13 is inserted with memory element, read and show memory element content, particularly, can read the photograph data in memory element by digital photo album application module 137, digital photo album application module 137 is when carrying out Socket programming, the cache size of Socket need to be set, the code for example adopting is: socket.setSendBufferSize (65536), the cache size that is about to Socket is set to 65536 bytes, the input and output of dishing out when avoiding in memory element file reading are abnormal, byte stream array need to be established greatly, adopt large byte stream buffer memory, the code for example adopting is: byte[] bufSend=buf=new byte[1024*10], the numerical value that is about to byte stream is set to 1024*10, by television set 15, the content of memory element is presented to user,
Step 212, digital photo album application module 137 starts thumbnail preview, the full-screen preview function of photograph, and by television set 15, the preview content of photograph is presented to user;
Step S213, user chooses the photograph that need to upload, digital photo album application module 137 adopts Java.net.Socket to encapsulate photograph data, photograph album background server 11 adopts Java.net.ServerSocket to receive data, and link data upload to photograph album background server 11 by TCP, it should be noted that, when sending photograph data, byte stream array need to be established little, adopt small character throttling buffer memory, the code for example adopting is: int sendBufLen=512; Byte[] bufSend=new byte[sendBufLen], the numerical value that is about to byte stream is set to 512; So, can reduce the input-output operation that reads memory element, avoid occurring abnormal.The numerical value setting of byte stream is not limited with the present embodiment, during application, can set arbitrarily according to the actual requirements, but need satisfied condition to be, digital photo album application module 137 adopts the first byte stream buffer memory while reading the photograph data in memory element, photograph data when being sent to photograph album background server 11, digital photo album application module 137 are adopted to the second byte stream buffer memory, wherein, the numerical value of the first byte stream is greater than the numerical value of the second byte stream.
It should be noted that, if user does not need newly-built photograph album, and wish is uploaded to photograph in the photograph album of having built up, can omit above-mentioned step S204 to S206, correspondingly, between step S203 and S207, more comprise that user sends the step of the request of uploading photograph data to photograph album background server 11.When digital TV terminal 13 is not IPTV, digital TV integrated machine or intelligent television for Set Top Box, in step S203, S206, S207, S211 and S212, can omit television set 15, directly by digital TV terminal 13, carry out Presentation Functions.
In sum, digital TV terminal of the present invention, Digital Television photograph uploading system and method at least have advantages of following:
1. in digital TV terminal of the present invention, Digital Television photograph uploading system and method, in digital TV terminal, be provided with digital photo album application module, digital photo album application module can read the photograph data of the memory element that inserts digital TV terminal, without restarting digital TV terminal.Digital photo album application module adopts large byte stream buffer memory while reading photograph data, when being sent to photograph album background server, picture data adopts small character throttling buffer memory, not only can choose quickly and easily the photograph that need to upload, also the larger photograph that takes up room successfully can be uploaded to photograph album background server, to realize photograph, share.
2. in an embodiment of Digital Television photograph uploading system of the present invention, the Design Mode that digital TV terminal adopts Web program to combine with java application, digital photo album application module adopts Java.net.Socket encapsulation photograph data, photograph album background server adopts Java.net.ServerSocket to receive the photograph data of encapsulation, and link data upload to photograph album background server by TCP, thereby be conducive to improve the success rate that photograph is uploaded.
The above, it is only preferred embodiment of the present invention, not the present invention is done to any pro forma restriction, although the present invention discloses as above with preferred embodiment, yet not in order to limit the present invention, any those skilled in the art, do not departing within the scope of technical solution of the present invention, when can utilizing the technology contents of above-mentioned announcement to make a little change or being modified to the equivalent embodiment of equivalent variations, in every case be not depart from technical solution of the present invention content, any simple modification of above embodiment being done according to technical spirit of the present invention, equivalent variations and modification, all still belong in the scope of technical solution of the present invention.