Disclosure of Invention
In view of this, an object of the embodiments of the present invention is to provide a memory card, which can implement a mobile terminal digital television service, implement a set-card separation, and save cost.
In order to achieve the above purpose, the technical solution of the embodiment of the present invention is specifically realized as follows:
a memory card, the memory card comprising: a memory card control unit, a condition receiving unit, a memory unit, and a memory card interface, wherein,
the memory card control unit is used for controlling the memory card interface to receive and transmit data, analyzing a protocol, managing the memory unit and coordinating all units in the memory card;
the memory card interface is used for receiving data from the outside and storing the data into the storage unit under the control of the memory card control unit; the external data comprises a first information stream, a second information stream and scrambling information;
the conditional access unit is used for acquiring a first information stream, a second information stream and scrambling information under the control of the memory card control unit, judging that the mobile terminal has service use authority for the scrambling information according to the second information stream, acquiring a corresponding service key according to the second information stream, decrypting a ciphertext control word in the first information stream by using the service key and acquiring a plaintext control word; and descrambling the scrambled information under the control of the plaintext control word to obtain the service data stream required by the mobile terminal user.
The conditional access unit includes: an authority control module, a service key extraction module, a control word extraction module, a descrambling module, a file management module and a key management module, wherein,
the authority control module is used for sending an authentication success notice to the service key extraction module when the service identifier in the received second information flow is the same as the service identifier corresponding to the conditional access service supported by the user terminal and stored in the file management module in advance, and sending the second information flow to the service key extraction module; when the received service identification is different from the stored service identification, exiting the current triggered conditional reception service;
the service key extraction module receives the authentication success notification, extracts a corresponding service key from the key management module according to the key seed ID number when the service key corresponding to the key seed ID number is stored in the key management module according to the key seed ID number and sends the extracted service key to the control word extraction module; when the ID number of the key seed in the second information flow is changed, the ID number of the corresponding service key in the memory card is updated;
the control word extraction module acquires a first information stream from the authority control module, acquires a ciphertext control word from the first information stream, decrypts the ciphertext control word by using the service key from the service key extraction module to obtain a plaintext control word, and sends the plaintext control word to the descrambling module;
and the descrambling module is used for acquiring the scrambled data from the storage unit under the control of the memory card control unit, descrambling the scrambled data by using the plaintext control word from the control word extraction module, and sending the descrambled data to the terminal through the memory card interface.
The protocol of the memory card interface is a digital security memory card or an MMC universal interface standard protocol.
The memory card control unit is connected with the conditional access unit through a data line, and the memory card control unit requests to send data signals, prepares to receive/send data signals, requests to receive data signals and latches data clock signals.
According to the technical scheme, the condition receiving unit is used as a component of the memory card, so that the condition receiving is completed on the mobile terminal through the SD/MMC and other universal memory card interfaces, the machine-card separation condition receiving of the mobile terminal digital television service is achieved, the development of the mobile terminal digital television service is facilitated, and the modification cost of the mobile terminal such as a mobile phone is greatly reduced.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and preferred embodiments.
Fig. 1 is a schematic view of a composition structure of the memory card of the present invention, and as shown in fig. 1, the memory card of the present invention mainly includes: a memory card control unit 100, a condition receiving unit 101, a storage unit 102, and a memory card interface 103. Wherein,
the memory card control unit 100 is configured to control the memory card interface 103 to perform data transmission and reception, perform protocol analysis, manage the storage unit 102, and perform coordination operations of the units in the memory card.
Memory card interface 103: for receiving data from outside, such as data that a user needs to store, a first information stream, a second information stream, scrambling information, and the like related to a digital stream such as an audio and video, and the like, and storing the data in the storage unit 102 under the control of the memory card control unit 100. The protocol of the memory card interface 103 may be a general interface standard protocol such as digital secure memory card (SD card)/MMC, but is not limited to any interface mode.
Wherein, the first information flow mainly comprises authorization Control information (entitlements Control Messages): such as ciphertext control words, time information, etc.;
the second information flow mainly includes authorization Management information (entitlements Management Messages): such as service identification, key seed ID number, time information, etc.;
the scrambling information is a scrambled audio/video signal such as a digital television signal.
The storage unit 102: the data transmitted to the memory card may be FLASH, EEPROM, ROM, etc.
Conditional access unit 101: the method is used for descrambling scrambled information such as data streams of audios and videos and user management, wherein the user management comprises functions of authority control, key management and the like. Under the control of the memory card control unit 100, a first information stream, a second information stream and scrambling information are acquired, after the mobile terminal belonging to the memory card control unit is judged to have the service use authority for the scrambling information according to the second information stream, a corresponding service key is acquired according to the second information stream, a ciphertext control word in the first information stream is decrypted by using the service key and a plaintext control word is acquired, and finally, under the control of the control word, the scrambling information is descrambled to acquire a service data stream required by a mobile terminal user.
Whether conditional access is required or not is selected by the user through the terminal, and when the user makes a selection, the processing of conditional access by the memory card control unit 100 is triggered. The selection of the condition reception and the process of triggering the memory card control unit 100 to perform the condition reception belong to the prior art, and are not described herein again. The invention emphasizes that the conditional access unit is used as a component of the memory card, thus realizing conditional access on the mobile terminal through a general memory card interface such as SD/MMC and the like, realizing conditional access of mobile terminal digital television service for machine-card separation, facilitating the development of mobile terminal digital television service and greatly reducing the reconstruction cost of the mobile terminal such as a mobile phone.
It should be noted that the memory card composition structure shown in fig. 1 only relates to units related to conditional access, and other existing units are not shown in fig. 1.
Fig. 2 is a schematic diagram of the structure of the conditional access unit of the present invention, and the following describes the operation principle of the conditional access unit in detail. As shown in fig. 2, the conditional access unit 101 includes: a rights control module 1011, a traffic key extraction module 1012, a control word extraction module 1013, a descrambling module 1014, a file management module 1015, and a key management module 1016. When the user triggers the conditional access service, the operation of each component module in the conditional access unit includes:
an authority control module 1011, configured to obtain the first information stream and the second information stream, determine whether the memory card has an authority to receive the service using the currently triggered condition according to the service identifier in the second information stream and the service identifier corresponding to the conditional access service supported by the user terminal and stored in the file management module 1015 in advance, send an authentication success notification to the service key extraction module 1012 if the received service identifier is the same as the stored one, and send the second information stream to the service key extraction module 1012; if the received service identification is different from the stored service identification, the current triggered conditional service receiving is quitted, for example, the terminal displays no authority to use the current service to the user.
Here, the first information stream and the second information stream are obtained from the storage unit 102 and then transmitted to the authorization control module 1011 under the control of the memory card control unit 100, and there are many specific obtaining methods, which are conventional technical means for those skilled in the art and will not be described in detail here.
The service key extraction module 1012 receives the authentication success notification, and queries whether the service key corresponding to the key seed ID number exists in the key management module 1017 according to the key seed ID number in the received second information stream, and if so, extracts the corresponding service key from the key management module 1016 according to the key seed ID number, and sends the extracted service key to the control word extraction module 1013. And when the ID number of the key seed in the second information flow is changed, updating the ID number of the corresponding service key in the memory card. Here, the key seed ID number is referred to as a service key ID number in the memory card.
Note that, the key management module 1016 stores in advance a one-to-one correspondence relationship between the key seed ID number and the service key.
The control word extracting module 1013 acquires the first information stream from the rights control module 1011, acquires the ciphertext control word from the first information stream, decrypts the ciphertext control word by using the service key from the service key extracting module 1012 to obtain a plaintext control word, and sends the plaintext control word to the descrambling module 1015.
The descrambling module 1014 acquires scrambled data from the storage unit 102 under the control of the memory card control unit 100, descrambles the scrambled data using the plaintext control word from the control word extraction module 1013, and finally transmits the descrambled data to the terminal through the memory card interface 105. The specific implementation of descrambling is well known to those skilled in the art, is not the focus of the present invention, and is not described herein.
It should be noted that the descrambling module 1014 may be a component of the memory card, as shown in fig. 2, since descrambling is completed in the memory card, all keys do not go out of the memory card, which improves the security of the conditional access system and reduces the performance overhead of the mobile terminal;
the descrambling module 1014 can also be independent of the memory card, such as in a security algorithm chip, because there is a CPU in the security algorithm chip, the descrambling speed of the terminal can be further increased. When the descrambling module 1014 is provided in the security algorithm chip, under the control of the memory card control unit 100, scrambled data is acquired from the storage unit 102, a plaintext control word is acquired from the control word extraction module 1013, and the scrambled data and the plaintext control word are transmitted to the security algorithm chip through the memory card interface 105.
The descrambling module performs descrambling processing after receiving the data, and the descrambled data is sent to the terminal through the memory card interface 105. The descrambling algorithm can be implemented by using an inverse encryption algorithm of a front-end processor, which belongs to the prior art and is not described in detail herein.
Fig. 3 is a flow chart of implementing conditional access according to the present invention, and after a user selects and selects a conditional access service through a terminal, the memory card is triggered to process conditional access, which mainly includes the following steps:
step 300: judging whether the current trigger condition has the authority to receive the service, if so, entering step 301; otherwise, go to step 304.
After a user selects a conditional access service through a terminal, a memory card receives external conditional access service data, such as data that the user needs to store, a first information stream, a second information stream, scrambling information and the like related to digital streams such as audio and video and the like, wherein the first information stream mainly includes authorization control information: such as ciphertext control words, time information, etc.; the second information stream mainly includes authorization management information: such as service identification, key seed ID number, time information, etc.; the scrambling information is a scrambled audio/video signal such as a digital television signal.
If the service identifier carried in the received second information flow is the same as that stored in the memory card, it indicates that the memory card has the authority to use the currently triggered conditional access service.
Step 301: judging whether a service key corresponding to the currently triggered condition receiving service exists, if so, entering step 302; otherwise, go to step 304.
And inquiring whether a service key corresponding to the key seed ID number exists in the memory card or not according to the received key seed ID number in the second information stream, and if so, judging that the service key corresponding to the current triggered conditional access service exists. And when the ID number of the key seed in the second information flow is changed, updating the ID number of the corresponding service key in the memory card.
Step 302: and decrypting the ciphertext control word by using the corresponding service key to obtain the plaintext control word.
The ciphertext control word is carried in a first information stream. The decryption method in this step is many, such as the existing AES CTR and AES ECB, and will not be described in detail here.
Step 303: and descrambling the scrambling information by using the obtained plaintext control word to obtain the conditional access service data.
The specific implementation of descrambling is well known to those skilled in the art, is not the focus of the present invention, and is not described herein.
Step 304: the process is exited.
There are many methods for exiting the current triggered conditional access service, such as displaying no permission to use the current service to the user through the terminal.
FIG. 4 is a schematic diagram of the connection between the conditional interface unit and the memory card interface unit according to an embodiment of the present invention, as shown in FIG. 4, the conditional interface unit and the memory card interface unit are connected via 8 data lines (DB0 DB8), and four control signals, namely, a request to send data signal (nInIntQ), a ready to receive/send data signal (nInReady/nOutReady), a request to receive data signal (nOutIntQ), and a data latch clock signal (nLE). The function of each control signal as seen from the conditional access unit is shown in table 1:
control signal |
Input/output |
Description of the function |
Application method |
Quasi-drugReady to receive signal (nInReady) |
Output of |
The status flag bit of the buffer is input into the condition receiving unit; form a pair of handshake signals with nInIntQ |
When nInReady is 1, the input buffer is busy and does not receive data; when nin ready is 0, the input buffer may receive data. |
Request to send data signal (nInIntQ) |
Input device |
Inputting a data request signal to a conditional access unit; form a pair of handshake signals with nInReady |
E.g. set to active low |
Ready to send data signal (nOutReady) |
Output of |
The buffer status flag bit is output in the condition receiving unit; form a pair of handshake signals with nOutIntQ |
When nOutReady is 1, no data in the output buffer can be output; when nourredy is 0, there is data in the output buffer to output. |
Request to receive data signal (nOutIntQ) |
Input device |
Outputting a data signal from a conditional access unit; form a pair of handshake signals with nOutReady |
E.g. set to active low |
Data latch clock signal (nLE) |
Input device |
Input/output data latch clock |
When nInReady is 0, nInIntQ is 0 and nLE is 0, DB 0-DB 8 data are latched by the conditional access unit; when nourredy is 0, noutinq is 0, and nLE is 0, DB0 to DB8 output data. |
DB<7:0> |
Bidirectional |
Bidirectional data bus |
When nin ready is 0, nin intq is 0, and nLE is 0, DB0 to DB8 are in an input state; DB0 to DB8 are in an output state when nourredy is 0, noutinq is 0, and nLE is 0; the others being in a high-impedance state |
The following describes the data interaction process between the conditional access unit and the storage control unit.
Fig. 5a is a timing chart of the memory card control unit of the present invention transmitting data to the conditional access unit, the transmission process being roughly as follows:
after the memory card control unit is electrified and self-checked, an nInIntQ low pulse signal is sent to the condition receiving unit to request to send data; after the condition receiving unit is prepared, an nInReady low pulse signal is returned to the memory card control unit, and the two parties successfully handshake; the memory card control unit generates nLE signals, which are the timing of sending data, to the conditional access unit and sends data to the conditional access unit in this timing.
In the process of receiving data by the conditional access unit, the data can be written without waiting as long as nInReady is 0; nLE pulse width is not less than 2ns, 1ns before nLE rising edge, data on DB 0-DB 8 must be stable. nLE rising edge, the data in DB0 DB8 is at least 1 ns.
Fig. 5b is a timing diagram of the memory card control unit receiving data from the conditional access unit, the receiving process being substantially as follows:
the memory card control unit sends nOutIntQ low pulse to wait for receiving the data processed by the condition receiving unit; after the condition receiving unit is prepared, an nOutReady low pulse signal is returned to the memory card control unit, and the two parties successfully handshake; the memory card control unit generates nLE signals, which are the timing of receiving data, to the conditional access unit and receives the data in this timing.
In the process of sending data by the conditional access unit, as long as the nOutReady is equal to 0, the data can be read without waiting; nLE pulse width is not less than 2ns, nLE falling edge within 1ns after, DB0 to DB8 data can be stable effective, and nLE rising edge within 1ns after, DB0 to DB8 are three state.
Fig. 5a and 5b are examples of a bus mode for the memory card control unit and the conditional access unit to implement data transmission, and the data transmission may also be performed by using an existing bus, such as I2C, SPI, and the like, which is not limited herein.
The above description is only exemplary of the present invention and should not be taken as limiting the scope of the present invention, and any modifications, equivalents, improvements and the like that are within the spirit and principle of the present invention should be included in the present invention.