CN117979118B - Data stream recording method, device, recorder and recording system - Google Patents
Data stream recording method, device, recorder and recording system Download PDFInfo
- Publication number
- CN117979118B CN117979118B CN202410381967.2A CN202410381967A CN117979118B CN 117979118 B CN117979118 B CN 117979118B CN 202410381967 A CN202410381967 A CN 202410381967A CN 117979118 B CN117979118 B CN 117979118B
- Authority
- CN
- China
- Prior art keywords
- data stream
- check code
- target data
- recorder
- identification information
- 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.)
- Active
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/80—Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
- H04N21/83—Generation or processing of protective or descriptive data associated with content; Content structuring
- H04N21/835—Generation of protective data, e.g. certificates
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/64—Protecting data integrity, e.g. using checksums, certificates or signatures
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/231—Content storage operation, e.g. caching movies for short term storage, replicating data over plural servers, prioritizing data for deletion
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
- H04N21/433—Content storage operation, e.g. storage operation in response to a pause request, caching operations
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N5/00—Details of television systems
- H04N5/76—Television signal recording
Landscapes
- Engineering & Computer Science (AREA)
- Signal Processing (AREA)
- Multimedia (AREA)
- Computer Security & Cryptography (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Computer Hardware Design (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- General Health & Medical Sciences (AREA)
- Bioethics (AREA)
- Health & Medical Sciences (AREA)
- Signal Processing For Digital Recording And Reproducing (AREA)
Abstract
The embodiment of the application provides a data stream recording method, a device, a recorder and a recording system, and relates to the technical field of computers, wherein the method comprises the following steps: in the process of recording the target data stream, calculating identification information for identifying the latest recorded data when preset recording conditions are met; until the recording of the target data stream is completed, calculating to obtain a first check code according to each piece of identification information; and storing the recorded target data stream corresponding to the first check code in the local of the recorder, and storing the target data stream, the first check code and the equipment identifier of the recorder in a platform, wherein the platform is used for downloading the target data stream by a terminal and playing the target data stream, and the equipment identifier is used for verifying the integrity of the target data stream stored by the platform. By applying the technical scheme provided by the embodiment of the application, the integrity of the data stream can be verified.
Description
Technical Field
The present application relates to the field of computer technologies, and in particular, to a data stream recording method, apparatus, recorder, and recording system.
Background
Shooting video is a common way to record life, events or create content, however, with the development of computer technology, people can modify the shot video, such as frame extraction, framing, etc., which results in the user not being able to determine the integrity of the watched video, i.e. whether the watched video is recorded or not.
Disclosure of Invention
The embodiment of the application aims to provide a data stream recording method, a data stream recording device, a data stream recorder and a data stream recording system, so as to verify the integrity of a data stream. The specific technical scheme is as follows:
In a first aspect, an embodiment of the present application provides a data stream recording method, applied to a recorder, where the method includes:
In the process of recording a target data stream, calculating identification information for identifying the latest recorded data when preset recording conditions are met, wherein the identification information is intermediate data obtained in the process of calculating check codes of the data;
Until the recording of the target data stream is completed, calculating to obtain a first check code according to each piece of identification information, wherein the first check code is used for verifying the integrity of the target data stream;
Storing the recorded target data stream corresponding to the first check code in the local of the recorder, and storing the target data stream, the first check code and a device identifier of the recorder in a platform, wherein the platform is used for a terminal to download and play the target data stream, and the device identifier is used for verifying the integrity of the target data stream stored in the platform.
In some embodiments, the index of the target data stream is a leading index;
the calculating to obtain the first check code according to each piece of the identification information comprises the following steps:
Calculating identification information for identifying modified sub-data as correction identification information, wherein the modified sub-data is data obtained by changing initial sub-data after the recording of the target data stream is completed, and the initial sub-data is data recorded before the preset recording condition is reached for the first time;
and calculating to obtain a first check code according to the correction identification information and other identification information except the initial identification information, wherein the initial identification information is identification information for identifying initial sub-data.
In some embodiments, each time the preset recording condition is met, calculating the identification information for identifying the latest recorded data includes:
And processing the latest recorded data through a hash rule to obtain a hash stream which is used as the identification information of the latest recorded data when the preset recording condition is met.
In some embodiments, the storing the recorded target data stream locally in the recorder corresponding to the first check code includes:
And storing the recorded target data stream in a TEE protection area of the recorder corresponding to the first check code, wherein the TEE protection area is used for protecting data in the process of restoring factory settings of the recorder.
In some embodiments, the terminal is configured to detect the target data stream by:
acquiring a check code stored corresponding to the target data stream from the platform as a third check code;
calculating a check code of the target data stream as a second check code;
Judging whether the third check code is identical to the second check code;
And if the third check code is different from the second check code, determining that the target data stream does not have the integrity.
In some embodiments, the terminal is further configured to obtain the first check code from the recorder if the third check code is the same as the second check code;
and if the first check code is different from the second check code, determining that the target data stream does not have the integrity.
In a second aspect, an embodiment of the present application further provides a data stream recording apparatus, where the apparatus includes:
The identification calculation module is used for calculating identification information for identifying the latest recorded data when preset recording conditions are met in the process of recording the target data stream, wherein the identification information is intermediate data obtained in the process of calculating the check codes of the data;
And a check code calculation module: the first check codes are used for verifying the integrity of the target data stream according to the identification information;
And a storage module: the device identification is used for storing the recorded target data stream locally corresponding to the first check code in the recorder, storing the target data stream, the first check code and the device identification of the recorder in a platform, wherein the platform is used for downloading and playing the target data stream by a terminal, and the device identification is used for verifying the integrity of the target data stream stored by the platform.
In some embodiments, the index of the target data stream is a leading index;
The check code calculation module is specifically configured to:
Calculating identification information for identifying modified sub-data as correction identification information, wherein the modified sub-data is data obtained by changing initial sub-data after the recording of the target data stream is completed, and the initial sub-data is data recorded before the preset recording condition is reached for the first time;
and calculating to obtain a first check code according to the correction identification information and other identification information except the initial identification information, wherein the initial identification information is identification information for identifying initial sub-data.
In some embodiments, the identification calculation module is specifically configured to:
And processing the latest recorded data through a hash rule to obtain a hash stream which is used as the identification information of the latest recorded data when the preset recording condition is met.
In some embodiments, the terminal is configured to detect the target data stream by:
acquiring a check code stored corresponding to the target data stream from the platform as a third check code;
calculating a check code of the target data stream as a second check code;
Judging whether the third check code is identical to the second check code;
and if the third check code is different from the second check code, determining that the target data stream has no integrity.
In some embodiments, the terminal is further configured to obtain the first check code from the recorder if the third check code is the same as the second check code;
and if the first check code is different from the second check code, determining that the target data stream does not have the integrity.
In a third aspect, an embodiment of the present application further provides a recorder, where the recorder includes a recording unit, a processing unit, and a storage unit;
The recording unit is used for recording a target data stream and storing the recorded target data stream into the storage unit;
The processing unit is used for calculating identification information for identifying the latest recorded data when preset recording conditions are met in the process of recording the target data stream by the recording unit;
The processing unit is further used for calculating a first check code according to each piece of identification information after the target data stream is recorded;
the processing unit is further configured to store the recorded target data stream in the storage unit corresponding to the first check code; storing the target data stream, the first check code and the equipment identifier of the recorder in a platform;
the identification information is intermediate data obtained in the process of calculating the check code of the data; the first check code is used for verifying the integrity of the target data stream; the platform is used for the terminal to download and play the target data stream, and the equipment identifier is used for checking the integrity of the target data stream stored by the platform.
In some embodiments, the storage unit includes a first storage subunit and a second storage subunit, where the first storage subunit is configured to store the recorded target data stream; the second storage subunit is configured to store the first check code.
In a fourth aspect, an embodiment of the present application further provides a recording system, where the recording system includes a recorder, a terminal, and a platform; wherein,
The recorder is used for calculating identification information for identifying the latest recorded data when preset recording conditions are met in the process of recording the target data stream; after the target data stream is recorded, calculating to obtain a first check code according to each piece of identification information, and storing the recorded target data stream in the local of the recorder corresponding to the first check code; the identification information is intermediate data obtained in the process of calculating the check code of the data, and the first check code is used for checking the integrity of the target data stream;
The recorder is further configured to send the target data stream, the first check code, and an equipment identifier of the recorder to a platform;
The platform is used for receiving the target data stream, the first check code and the equipment identifier of the recorder, which are sent by the recorder, and storing the target data stream, the first check code and the equipment identifier of the recorder correspondingly;
the platform is further configured to send the target data stream, the first check code, and an equipment identifier of the recorder to the terminal;
the terminal is used for receiving the target data stream sent by the platform and the equipment identifier of the recorder; receiving the first check code sent by the platform as a third check code; calculating a check code of the target data stream as a second check code; acquiring a first check code corresponding to the target data stream from the recorder according to the equipment identifier; and verifying the integrity of the target data stream according to the second check code and the third check code, and/or verifying the integrity of the target data stream according to the first check code and the second check code.
In a fifth aspect, embodiments of the present application also provide a computer program product comprising instructions which, when run on a computer, cause the computer to perform any of the above described data stream recording methods.
The embodiment of the application has the beneficial effects that: in the process of recording the target data stream, when preset recording conditions are met, the identification information for identifying the latest recorded data is calculated, and after the target data stream is recorded, the first check code is calculated according to each sub-identification, so that the time interval from the latest recorded data to the identification information is shorter, before the latest recorded data is modified by a user, the identification information of the latest recorded data is obtained by the recorder, and even if the latest recorded data is modified by the user, the corresponding identification information is the identification information of the latest recorded data before the modification, and the check code of the data stream with the first check code being unmodified is obtained, namely, the first check code can represent the complete data stream recorded by the recorder.
After the recorder calculates the first check code, the recorded target data stream is stored in the local of the recorder corresponding to the first check code, and the target data stream, the first check code and the equipment identifier of the recorder are stored in the platform, so that the terminal can conveniently acquire the target data stream and the first check code of the target data stream, and after the terminal acquires the target data stream and the first check code, the terminal can verify the integrity of the acquired video stream by calculating the acquired check code of the target data stream and comparing the calculated check code with the first check code.
Of course, it is not necessary for any one product or method of practicing the application to achieve all of the advantages set forth above at the same time.
Drawings
In order to more clearly illustrate the embodiments of the application or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the application, and other embodiments may be obtained according to these drawings to those skilled in the art.
FIG. 1 is a schematic diagram of a recording system according to an embodiment of the present application;
fig. 2 is a schematic flow chart of a first method for recording a data stream according to an embodiment of the present application;
FIG. 3a is a schematic diagram of a related art method for calculating a first check code;
FIG. 3b is a schematic diagram illustrating the calculation of a first check code according to an embodiment of the present application;
fig. 4 is a schematic diagram of a second flow chart of a data stream recording method according to an embodiment of the present application;
fig. 5 is a third flowchart of a data stream recording method according to an embodiment of the present application;
fig. 6 is a fourth flowchart of a data stream recording method according to an embodiment of the present application;
fig. 7 is a fifth flowchart of a data stream recording method according to an embodiment of the present application;
fig. 8 is a sixth flowchart of a data stream recording method according to an embodiment of the present application;
fig. 9 is a first flowchart of a data flow detection method according to an embodiment of the present application;
FIG. 10 is a schematic diagram of another recording system according to an embodiment of the present application;
Fig. 11 is a second flowchart of a data flow detection method according to an embodiment of the present application;
fig. 12 is a schematic structural diagram of a data stream recording apparatus according to an embodiment of the present application;
fig. 13 is a schematic structural diagram of a recorder according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. Based on the embodiments of the present application, all other embodiments obtained by the person skilled in the art based on the present application are included in the scope of protection of the present application.
The terms appearing in the embodiments of the present application are explained below:
Hash value: a hash value (hash value), also called a hash value, is a function capable of mapping input data of an arbitrary length, which may be a file, a character string, or the like, to output data of a fixed length.
Hash value verification: hash value checking (hotscoin) is a common data checking mechanism that can effectively detect whether data is modified or corrupted.
In some scenarios the user needs to record some video data using a recorder as evidence. Illustratively, a user uses a recorder to record an execution process during execution of an event as evidence of the event. For such video data for evidence, it is particularly necessary to ensure that the video data for certification is consistent with the video data recorded by the recorder, i.e., to ensure the integrity of the video data, or to be able to verify the integrity of the video data for certification.
However, since the recorder cannot transmit the recorded data stream to the platform for storage in real time, it usually needs to wait for a long time after finishing recording the data stream, that is, the time required from the end of recording the data stream to the transmission to the platform for storage is long, especially for the data that begins to be recorded first, this results in sufficient time for the user to tamper with the recorded data stream in the recorder, the reliability of the data stream uploaded to the platform cannot be guaranteed, and further the integrity of the data stream stored in the platform cannot be accurately detected through the check code, for example, the check code of the recorded data stream is calculated when the recorder finishes recording, if the recorded data stream is modified when the recorder finishes recording, the check code calculated when finishing recording is the check code of the modified data stream, at this time, after uploading the data stream to the platform, the integrity of the data stream cannot be verified by comparing the check code calculated when the data stream is acquired from the terminal with the first check code calculated by the recorder.
To verify the integrity of the data stream, an embodiment of the present application provides a recording system, as shown in fig. 1, comprising a recorder 11, a platform 12, and a terminal 13, wherein,
The recorder 11 is used for recording the target data stream and calculating a first check code of the target data stream, and the recorder 11 can be a device which has the functions of video recording or audio recording and the like but cannot transmit the recorded data to the platform for storage in real time; the platform 12 is used for storing information such as a target data stream, a first check code corresponding to the target data stream, a device identifier of the recorder and the like; the terminal 13 may be a desktop computer, a portable computer, etc., and may access and obtain the required data from the recorder 11 and the platform 12, such as obtaining the first check code from the recorder 11, obtaining the target data stream from the platform 12, etc.
Based on the recording system, the embodiment of the application also provides a data stream recording method, and the data stream recording method provided by the embodiment of the application is described in detail below through a specific embodiment.
Referring to fig. 2, fig. 2 is a schematic flow chart of a first data stream recording method according to an embodiment of the present application, which is applied to a recorder, and includes the following steps:
Step S21: in the process of recording the target data stream, calculating identification information for identifying the latest recorded data when preset recording conditions are met;
Step S22: until the recording of the target data stream is completed, calculating to obtain a first check code according to each piece of identification information;
Step S23: and storing the recorded target data stream corresponding to the first check code in the local of the recorder, and storing the target data stream, the first check code and the equipment identifier of the recorder in a platform, wherein the platform is used for downloading the target data stream by a terminal and playing the target data stream, and the equipment identifier is used for verifying the integrity of the target data stream stored by the platform.
The technical scheme provided by the embodiment of the application is as follows: in the process of recording the target data stream, when preset recording conditions are met, the identification information for identifying the latest recorded data is calculated, and after the target data stream is recorded, the first check code is calculated according to each sub-identification, so that the time interval from the latest recorded data to the identification information is shorter, before the latest recorded data is modified by a user, the identification information of the latest recorded data is obtained by the recorder, and even if the latest recorded data is modified by the user, the corresponding identification information is the identification information of the latest recorded data before the modification, and the check code of the data stream with the first check code being unmodified is obtained, namely, the first check code can represent the complete data stream recorded by the recorder.
After the recorder calculates the first check code, the recorded target data stream is stored in the local of the recorder corresponding to the first check code, and the target data stream, the first check code and the equipment identifier of the recorder are stored in the platform, so that the terminal can conveniently acquire the target data stream and the first check code of the target data stream, and after the terminal acquires the target data stream and the first check code, the terminal can verify the integrity of the acquired video stream by calculating the acquired check code of the target data stream and comparing the calculated check code with the first check code.
In the step S21, the target data stream may be a data stream such as video or audio; the identification information may be used to identify the latest recorded data, which is intermediate data obtained during the calculation of the check code of the data. The identification information may be a specific value or may be in other forms. For example, the identification information may be a hash stream obtained by processing the latest recorded data with a hash rule.
In some embodiments, once the preset recording condition is met, the latest recorded data may be processed through a hash rule (such as SHA-512, SHA-256, etc.), to obtain a hash stream corresponding to the latest recorded data, where the hash stream is used as identification information for identifying the latest recorded data.
The preset recording condition may be understood as whether a preset duration is reached or whether a preset frame number is reached, etc., where the preset duration and the preset frame number may be set according to actual situations, for example, the preset duration may be set to 1S, 2S, 3S, etc., and the preset frame number may be set to 10 frames, 20 frames, 30 frames, etc., which is not limited; the latest recorded data can be understood as the data recorded from the position where the preset recording condition is last reached to the position where the preset recording condition is next reached, and it can be understood that when the recorder starts to record the target data stream initially, the latest recorded data can be understood as the data which reaches the preset recording condition for the first time, such as the data recorded from the beginning of recording to the time when the preset duration is first reached, when the latest recorded data does not exist; in addition, when the recorder finishes recording, if the relationship between the position of the last time reaching the recording condition and the position of the finishing recording does not meet the preset recording condition, the data recorded between the position of the last time reaching the recording condition and the position of the finishing recording can be used as the latest recorded data.
Taking the target data stream as a video, taking the preset recording condition as an example whether 3S is reached, if the recorder records the video from 10 minutes 00 seconds, the video recorded from 10 minutes 03 seconds reaches 3S, and at this time, the video recorded from 10 minutes 00 seconds to 10 minutes 03 seconds can be regarded as the latest recorded data; the recorder continues to record the video, when reaching 10 minutes and 06 seconds, reaching 3S again, and at this time, the video recorded from 10 minutes and 03 seconds to 10 minutes and 06 seconds can be regarded as the latest recorded data; the video is recorded at 10 min 08 seconds, and the time between 10 min 06 seconds and 10 min 08 seconds is 3S, but since the video is recorded at the end, the video recorded at 10 min 06 seconds to 10 min 08 seconds can be regarded as the latest recorded data.
In the embodiment of the application, in the process of acquiring the target data stream, the recorder calculates the identification information of the latest recorded data once every time the latest recorded data is obtained, and caches the latest recorded data and the corresponding identification information, for example, the latest recorded data and the corresponding identification information are written into a memory card of the recorder. When the recording of the target data stream is completed and no more data is written into the memory card, the recorder can send information to indicate that the recording of the target data stream is completed.
In the step S22, the check code may be understood as a code with a fixed length generated by performing an operation on the data by a specific algorithm, and has uniqueness, that is, the generated check code should be different for different data; wherein the specific algorithm may be a hash algorithm, such as SHA-512, SHA-256, etc. in a secure hash algorithm (Secure Hash Algorithm, SHA); the first check code is a check code generated by a recorder for recording the target data stream for the target data stream, that is, the first check code can represent the target data stream recorded by the recorder and can be used for verifying the integrity of the target data stream. The complete target data stream can be understood as that the target data stream acquired by the terminal is completely consistent with the data stream recorded by the recorder, and the manipulation operations such as frame extraction, frame adding and the like are not performed.
In the embodiment of the application, the mode of calculating the first check code by the recorder is as follows: dividing the whole target data stream into a plurality of pieces of data, respectively calculating identification information corresponding to each piece of data, and calculating a verification code (namely a first verification code) of the whole target data stream according to each piece of identification information after the recording of the target data stream is completed; the check code calculated in this way is identical to the check code obtained by directly calculating the entire target data stream.
In some embodiments, after the recorder finishes recording the target data stream, the obtained identification information can be processed through a hash rule to obtain a first check code corresponding to the target data stream. In order to further improve the accuracy and reliability of the first check code, when the hash rule is required to be used for processing each piece of identification information to calculate the first check code, the same hash rule can be used for processing each piece of latest recorded data to obtain each piece of identification information when the identification information corresponding to each piece of latest recorded data is calculated. For example, if the recorder needs to process each piece of identification information by using SHA-512 to obtain the first check code, when calculating each piece of identification information, SHA-512 may be used to process each piece of latest recorded data to obtain a hash stream corresponding to each piece of latest recorded data, and the hash stream is used as the identification information.
It can be understood that in the related art, the recorder records the data stream, after the recording of the data stream is finished, the check code of the recorded data stream is calculated, as shown in fig. 3a, the recorder records the data stream, after the recording is finished, the data stream 1 is obtained, and then the check code of the data stream 1 is calculated. Thus, the time from the start of recording the data stream to the calculation of the check code of the recorded data stream is longer, and the user has more time to modify the data stream, resulting in a greater probability of the data stream being modified.
In the embodiment of the present application, during the recording process of the data stream by the recorder, each time the preset recording condition is reached, the recorder can calculate the identification information for identifying the latest recorded data, and after the recording is finished, the verification code (i.e. the first verification code) of the recorded data stream is calculated according to the obtained identification information, as shown in fig. 3b, when the preset recording condition is reached for the first time, the latest recorded data is data 1, and at this time, the recorder calculates the identification information of the data 1 while continuing recording; when the second time reaches the preset recording condition, the latest recorded data is data 2, and at the moment, the recorder calculates the identification information of the data 2 while continuing recording; when the third time reaches the preset recording condition, the latest recorded data is data 3, at this time, the recorder calculates the identification information of the data 3, and then the recorder calculates the check code of the recorded data stream according to the identification information of the data 1, the identification information of the data 2 and the identification information of the data 3. Therefore, the check code of the data stream is calculated in the process of recording the data stream by the recorder, so that a user does not have time to modify the data stream, the possibility of modifying the data stream is reduced, the reliability of the calculated check code of the data stream is higher, and the accuracy of the integrity of the data stream is improved according to the calculated check code.
Therefore, when the preset recording condition is set, the setting needs to be performed according to the actual situation so as to reduce the possibility of modifying the data stream, if the preset recording condition is the preset duration, the preset duration cannot be set too large, and if the preset duration is set too large, the data storage time meeting the preset recording condition may be too long, so that the user has time to modify the data stream.
In the step S23, after the recorder records the target data stream and the first check code, the target data stream may be stored locally in the recorder corresponding to the first check code.
In some embodiments, a folder for storing data streams is built in the recorder, when the recording device records the data streams, for each recorded data stream, the recorder can automatically generate a separate file, name the file as the name of the recorded video stream, store the file in the folder for storing the data stream, and after the recorder finishes recording the data stream, can store the first check code corresponding to the data stream and the device identifier of the recorder for recording the data stream in the file.
In other embodiments, a TEE protection area exists in the recorder, and the recorder may store the recorded target data stream corresponding to the first check code in the TEE protection area of the recorder. For the TEE protection area, even if the recorder is restored to factory settings, the data stored in the TEE protection area is not lost, and the data stored in the TEE partition is not easily modified.
The recorder may also send the target data stream, the first check code, and the device identifier of the recorder to the platform for storage by the platform, e.g., the recorder may send the target data stream, the first check code, and the device identifier to the platform for storage by the platform according to the structure shown in fig. 10 below. The platform can be accessed by the terminal and provides the terminal with the accessed data. The terminal can access the platform to download and play the target data stream, and can also acquire the first check code stored by the platform from the platform for checking the integrity of the target data stream, or the terminal can also acquire the equipment identifier of the recorder corresponding to the target data stream from the platform, and acquire the first check code of the target data stream from the recorder according to the equipment identifier so as to verify the integrity of the target data stream.
The manner in which the terminal obtains the first check code stored by the platform to verify the integrity of the target data stream, and the manner in which the terminal obtains the first check code according to the device identifier to verify the integrity of the target data stream will be described in detail later, which will not be described in detail here.
In some embodiments, referring to fig. 4, fig. 4 is a second flowchart of a data stream recording method according to an embodiment of the present application, when an index of a target data stream is a leading index, the method may include the following steps:
Step S41: in the process of recording the target data stream, calculating identification information for identifying the latest recorded data when preset recording conditions are met; see for details the description in step S21 above.
Step S42: the identification information for identifying the modified sub data is calculated as the correction identification information.
Step S43: and calculating to obtain a first check code according to the correction identification information and other identification information except the initial identification information, wherein the initial identification information is identification information for identifying initial sub-data.
In the technical scheme provided by the embodiment of the application, when the index of the target data stream is the pre-index, the initial sub-data of the target data stream changes after the recorder finishes recording the target data stream, so that after the recorder finishes recording, the recorder needs to calculate the identification information of the modified sub-data, namely, correct the identification information, replace the initial identification information with the correction identification information, and further determine the first check code of the target data stream, thus, the condition that the check code (such as the following second check code) corresponding to the target data stream which is recalculated subsequently and is inconsistent with the pre-calculated first check code due to the change of the initial sub-data can be avoided, and even if the index of the target data stream is the pre-index, the integrity of the target data stream can be verified by judging whether the first check code is identical with the recalculated check code of the target data stream.
In step S42, since the index of the target data stream is the leading index, the data at the front end of the target data stream is changed after the recorder finishes recording the target data stream. In the embodiment of the present application, after the recording is finished, the changed data can be understood as the data recorded before the first time reaches the preset recording condition in the target data stream, so that after the recording of the target data stream is finished, the recorder needs to calculate the identification information of the data recorded before the first time reaches the preset recording condition again.
In the embodiment of the present application, the initial sub-data may be understood as the data recorded before the first time reaches the preset recording condition, and the example in the above step S21 is continued, and assuming that the preset duration is 3S, the data recorded before the first time reaches the preset duration is the video recorded from 10 minutes 00 seconds to 10 minutes 03 seconds, that is, the video recorded from 10 minutes 00 seconds to 10 minutes 03 seconds is the initial sub-data; the modified sub-data can be understood as: and after the recording is finished, the data obtained by changing the initial sub-data, namely the changed initial sub-data.
In the embodiment of the application, after the recorder acquires the modified sub-data, the identification information of the modified sub-data can be calculated and used as correction representation information. Here, the manner of calculating the correction identification information is the same as that of calculating the identification information in the above step S21, that is, if the latest recorded data is processed by using SHA-512 in the above step S21 to obtain the identification information, the modified sub-data should also be processed by using SHA-512 to obtain the identification information.
In the step S43, the correction identification information is the identification information corresponding to the modified sub-data calculated by the recorder in the step S42; the initial identification information is identification information corresponding to initial sub-data; when the index of the target data stream is the pre-index, the recorder can calculate the first check code of the target data stream according to the correction identification information and other identification information except the initial identification information. The manner of calculating the first check code according to each identification information is described in the above step S22.
In some embodiments, as shown in fig. 5, fig. 5 is a third flow chart of a data stream recording method according to an embodiment of the present application, which may include the following steps:
Step S51: in the process of recording the target data stream, the identification information for identifying the latest recorded data is calculated every time the preset recording condition is reached. The same as in step S41 described above.
Step S52: and judging whether the index of the target data stream is a front index.
In the embodiment of the present application, if the recorder determines that the index of the target data stream is the leading index, the following steps S53 and S54 may be executed; if the recorder determines that the index of the current target data stream is not the pre-index, if the index of the current target data stream is the post-index, step S55 is directly performed.
Step S53: the identification information for identifying the modified sub data is calculated as the correction identification information. The same as in step S42 described above.
Step S54: and calculating to obtain a first check code according to the correction identification information and other identification information except the initial identification, wherein the initial identification information is the identification information of the initial sub-data. The same as in step S43 described above.
Step S55: and calculating to obtain a first check code of the target data stream according to the obtained identification information.
In the embodiment of the application, the recorder can calculate the sub-check codes in a unified mode in the process of recording the target data stream, and does not need to intentionally judge whether the index of the target data stream is a leading index or not, after the target data stream is recorded, whether the index of the target data stream is the leading index or not is judged, if the index of the target data stream is the leading index, correction identification information can be calculated, and the first check code is determined according to the correction identification information and other identification information except the initial identification information; if the index of the target data stream is not the pre-index, the correction identification information is not required to be calculated, and the first check code is directly determined according to the existing identification information. Therefore, the method and the device can be suitable for the situation that the target data stream is the leading index and the non-leading index by using one set of flow, and the flow for calculating the first check code is not required to be additionally set for the situation that the index of the target data stream is the leading index, so that the architecture of the program is simplified, and the applicability is improved.
In other embodiments, before recording the target data stream, the recorder may determine whether the index of the target data stream is a leading index, if the index of the target data stream is a leading index, in the process of recording the target data stream, the identification information of the initial sub-data may not be calculated first, after recording is completed, the modified sub-data may be directly obtained, the identification information of the modified sub-data may be calculated, and then the first check code may be calculated according to the identification information of the modified sub-data and the identification information calculated in the process of recording the target data stream. Thus, the calculation amount can be reduced, and the calculation efficiency can be improved.
In some embodiments, taking the target data stream as a video, and taking a specific algorithm for calculating the check code as a hash algorithm as an example, referring to fig. 6, fig. 6 is a fourth flowchart of a data stream recording method according to an embodiment of the present application, the method may include the following steps:
Step S61: the recorder starts to record video;
step S62: the recorder records the video and calculates a hash value; the hash value may be understood as the first check code in fig. 2, and the manner of calculating the first check code may be described in fig. 2;
step S63: the recorder finishes recording the video;
Step S64: the recorder writes the calculated hash value and the recorder's device identification into a separate file, which is the same name as the video.
The recorder is provided with a folder for storing videos, when the recorder records the videos, a single file such as a text file, a Document file and the like can be automatically generated for each recorded video, the name of the file is named as the name of the recorded video and is stored in the folder for storing the videos, and after the recorder finishes recording the videos, the calculated hash value and the equipment identifier (such as the equipment number) of the recorder for recording the videos can be stored in the file, so that the file can be also called as a hash file.
Step S65: the recorder writes information such as the hash value of the video, the name of the video, and the device identifier of the recorder into the protection area of the terminal.
For example, taking an operating system of the terminal as an android system as an example, the terminal may be written into a TEE protection area of the android system, where the TEE protection area in the example is a protection area of the android system. The recorder finishes recording, and stores the hash value (i.e. the first check code) of the video, the name of the video, the equipment identifier of the recorder recording the video and other information into the TEE protection area, namely, the hash file is stored into the TEE protection area, and then, even if the system is restored to factory setting, the information stored in the TEE protection area is not lost. See for details the description in step S23 above.
In some embodiments, referring to fig. 7, fig. 7 is a fifth flowchart of a data stream recording method according to an embodiment of the present application, which may include the following steps:
Step S71: the recorder starts to record the video;
Step S72: the recorder processes the video stream A1 by using a hash algorithm to obtain a hash stream A1 and caches the hash stream A1.
The video stream A1 may be understood as data recorded before a preset recording condition is reached for the first time in a recording process of the recorder, the recording is not stopped at this time, and after the video stream A1 is processed by the recorder by using a hash algorithm, a hash stream A1 corresponding to the video stream A1 may be obtained and the hash stream A1 is buffered. Here, the hash stream A1 can be understood as the above-described initial identification information.
Step S73: the recorder processes the video stream A2 by using a hash algorithm to obtain a hash stream A2 and caches the hash stream A2.
The video stream A2 can be understood as data recorded between the first time reaching the preset recording condition and the second time reaching the preset recording condition in the recording process of the recorder, the recording is not stopped at this time, and after the video stream A2 is processed by the recorder by using a hash algorithm, a hash stream A2 corresponding to the video stream A2 can be obtained and the hash stream A2 is buffered. Here, the hash stream A2 can be understood as identification information of the video stream A2.
Step S74: the recorder processes the video stream A3 by using a hash algorithm to obtain a hash stream A3 and caches the hash stream A3.
The video stream A3 can be understood as data which reaches a preset recording condition for the last time in the recording process of the recorder, at this time, the recording is stopped, and after the recorder processes the video stream A3 by using a hash algorithm, a hash stream A3 corresponding to the video stream A3 can be obtained, and the hash stream A3 is cached. Here, the hash stream A3 can be understood as identification information of the video stream A3.
Step S75: and the recorder combines the A1, the A2 and the A3 to obtain a final hash value (namely a first check code), and stores the final hash value and the corresponding video into a TEE protection area of the recorder. See in particular the above-mentioned step S22, and the contents shown in step S23.
In some embodiments, taking the target data stream as the video and the algorithm for calculating the check code as the hash algorithm as an example, referring to fig. 8, fig. 8 is a schematic diagram of a sixth flow chart of the data stream recording method according to the embodiment of the present application, when the video is a video with a pre-index, the recorder may generate the first check code by adopting the following steps:
Step S81: the recorder starts to record the video;
step S82: the recorder processes the video stream A1 by using a hash algorithm to obtain a hash stream A1 and caches the hash stream A1;
step S83: the recorder processes the video stream A2 by using a hash algorithm to obtain a hash stream A2 and caches the hash stream A2;
Step S84: the recorder processes the video stream A3 by using a hash algorithm to obtain a hash stream A3 and caches the hash stream A3;
the steps S81 to S84 are the same as the steps S71 to S74 in fig. 7, and are not repeated here.
Step S85: the recorder processes the modified video stream A1 using a hash algorithm to obtain a hash stream a11, and replaces Ha Xiliu A1 with the hash stream a 11.
In the embodiment of the present application, the video stream A1 may be understood as initial sub-data, and the hash stream A1 may be understood as initial identification information; the modified video stream A1 may be understood as modified sub-data and the hash stream a11 may be understood as the correction identification information. See in particular the description of fig. 4 above.
Step S86: and the recorder combines the A11, the A2 and the A3 to obtain a final hash value (namely a first check code), and stores the final hash value and the corresponding video into a TEE protection area of the recorder. See for details the description of step S22 and step S23 above.
In some embodiments, based on the above data stream recording method, the terminal may verify the integrity of the data stream (i.e. the target data stream) recorded by the recorder by the following method, referring to fig. 9, fig. 9 is a first flowchart of the data stream detection method provided by the embodiment of the present application, and may include the following steps:
step S91: acquiring a check code stored corresponding to the target data stream from the platform as a third check code;
Step S92: calculating a check code of the target data stream as a second check code;
step S93: and judging whether the third check code is the same as the second check code, and if the third check code is different from the second check code, determining that the target data stream does not have the integrity.
In the technical scheme provided by the embodiment of the application, the terminal can acquire the target data stream from the platform, and can acquire the third check code stored in the platform, after the terminal obtains the second check code through calculation, the terminal can directly compare whether the second check code is identical to the third check code, if the second check code is different from the third check code, the target data stream can be determined to have no integrity, the first check code does not need to be acquired from the recorder any more, and whether the first check code is identical to the second check code is determined, so that the calculation resource is saved, and the calculation efficiency is improved.
In the step S91, the recorder may send the target data stream and the first check code to the platform, so that the platform stores the target data stream and the first check code correspondingly, and thus, the terminal may acquire the first check code of the target data stream stored in the platform and use the first check code as the third check code while acquiring the target data stream from the platform.
It can be understood that after the platform correspondingly stores the target data stream and the first check code, the target data stream and the first check code in the platform are at risk of being modified by a user, so that the check code corresponding to the target data stream acquired by the terminal from the platform is not necessarily the first check code sent to the platform by the recorder, and therefore, the first check code acquired by the terminal from the platform is used as the third check code.
In step S92, the target data stream is stored in the platform, and the terminal may acquire the target data stream from the platform and calculate the check code of the target data stream as the second check code, that is, the second check code may represent the target data stream acquired by the terminal from the platform. It can be understood that, here, the manner of calculating the second check code is the same as the manner of calculating the first check code according to the identification information in the step S22, that is, if the step S22 uses SHA-512 to process the identification information to obtain the first check code, the SHA-512 should also be used to process the obtained target data stream to obtain the second check code of the target data stream.
In step S93, the terminal may compare the third check code with the second check code, and if the third check code is different from the second check code, it indicates that the target data stream acquired by the terminal from the platform is inconsistent with the target data stream stored in the platform, and it may be determined that the target data stream does not have integrity. And if the third check code is the same as the second check code, indicating that the target data stream acquired from the platform by the terminal is consistent with the target data stream stored in the platform.
In some embodiments, when the third check code is the same as the second check code, it indicates that the target data stream acquired by the terminal from the platform is consistent with the target data stream in the platform, but it cannot indicate that the target data stream acquired by the terminal from the platform is consistent with the target data stream recorded by the recorder, so, when the third check code is the same as the second check code, to further determine the integrity of the target data stream, the terminal may acquire the device identifier from the platform, and based on the device identifier, acquire the first check code corresponding to the target data stream from the recorder recording the target data stream. Then, the terminal can determine whether the first check code is the same as the second check code, and when the first check code is the same as the second check code, the terminal indicates that the target data stream stored in the platform is consistent with the target data stream recorded by the recorder, and can determine that the target data stream stored in the platform has integrity; when the first check code is different from the second check code, the target data stream stored in the platform is inconsistent with the target data stream recorded by the recorder, and the target data stream stored in the platform can be determined to have no integrity.
In the embodiment of the application, when the second check code is the same as the third check code, the integrity of the target data stream can be directly determined, or in order to improve the accuracy of verifying the integrity of the target data stream, the equipment identifier corresponding to the target data stream can be obtained from the platform, the first check code is obtained from the recorder according to the equipment identifier, for example, the first check code is obtained from the TEE protection area of the recorder, and whether the second check code is the same as the first check code or not is further verified, so that the accuracy of verifying whether the integrity of the target data stream is the integrity is improved.
In some embodiments, after the terminal obtains the target data stream from the platform, the terminal may not obtain the check code of the target data stream stored in the platform, that is, may not obtain the third check code, but directly obtain the device identifier corresponding to the target data stream stored in the platform, determine the recorder recording the target data stream according to the device identifier, further obtain the first check code corresponding to the target data stream from the TEE protection area of the recorder, and compare the first check code with the second check code obtained by calculating the terminal, if the first check code is the same as the second check code, it indicates that the target data stream obtained by the terminal is consistent with the target data stream recorded by the recorder, and if the first check code is different from the second check code, it indicates that the target data stream obtained by the terminal is inconsistent with the target data stream recorded by the recorder, that is, the target data stream does not have integrity.
It can be understood that the first check code is a check code calculated when the recorder records the target data stream, and can represent the complete target data stream, and the second check code is a check code calculated by the terminal according to the acquired target data stream, and the mode of calculating the first check code is the same as the mode of calculating the second check code, so that the first check code and the second check code are directly compared, and the integrity of the target data stream can be verified.
In some embodiments, referring to fig. 10, fig. 10 is a schematic diagram illustrating a second structure of a recording system according to an embodiment of the present application, where the recording system includes a front end device 101, an acquisition device 102, and a platform 12, where the front end device 101 establishes a communication connection with the acquisition device 102, and the acquisition device 102 establishes a communication connection with the platform 12; the head-end 101 can be understood as the recorder in the above embodiment. Acquisition device 102 may obtain the data stream, the first check code corresponding to the data stream, and the number of the front-end device recording the data stream from front-end device 101 (taking the example shown in fig. 6 as an example, acquisition device 102 may obtain the video and the hash file corresponding to the video from front-end device 101), and upload the obtained information to platform 12 for storage. It will be appreciated that one acquisition device 102 may be connected to a plurality of head-end devices 101, and that only one head-end device, one acquisition device, and one platform are described herein as examples and are not intended to be limiting.
In some embodiments, referring to fig. 11, fig. 11 is a second flowchart of a data flow detection method according to an embodiment of the present application, which may include the following steps:
step S111: the terminal determines a video A in a platform as a target data stream;
In the embodiment of the application, a plurality of videos and hash files corresponding to each video are stored in a platform. In response to a user operation, the terminal may determine a video specified by the user and take the video as a target data stream, e.g., in response to a user operation, the terminal may take video a stored in the platform as a target data stream.
Step S112: the terminal downloads the video A and the hash file corresponding to the video A from the platform;
In the embodiment of the application, the terminal can acquire the video A and the HASH file corresponding to the video A from the platform, wherein the HASH file (such as an A-HASH file) corresponding to the video A comprises the HASH value (such as HASH-1) of the video A, namely the third check code, the equipment identifier (such as equipment A) of the front-end equipment for recording the video A and other information. See in particular the description of fig. 6 above, and fig. 9.
After the terminal obtains the video a from the platform, a HASH algorithm may be used to calculate the HASH value of the obtained video a to obtain a new HASH value (such as HASH-2), that is, the second check code, which may be specifically described in step S92.
Step S113: the terminal finds out a corresponding device A through the hash file;
In the embodiment of the application, the device identifier of the front-end device for recording the video A is stored in the hash file corresponding to the video A, so that after the terminal obtains the hash file corresponding to the video A from the platform, the device A for recording the video A can be determined according to the hash file. See for details the description in step S93 above.
Step S114: the terminal derives hash file information of all historical video records of the equipment A from the equipment A, and searches hash values of corresponding videos A;
In the embodiment of the application, after the terminal determines the device A for recording the video A, HASH file information of all historical videos can be derived from a TEE protection area of the device A, further, HASH files corresponding to the video A are determined, and HASH values (i.e. HASH-3) of the video A stored in the TEE protection area, namely the first check codes, are determined from the HASH files corresponding to the video A. See for details the description in step S93 above.
Step S115: the terminal judges whether the hash value obtained from the device a and the hash value derived from the platform can correspond.
In the embodiment of the application, after the terminal obtains the HASH value (i.e., HASH-1) of the video a stored in the platform, the HASH value (i.e., HASH-2) of the video a recalculated when the video a is obtained from the platform, and the HASH value (i.e., HASH-3) of the video a stored in the TEE protection area of the device a recording the video a, it is determined whether the HASH-1, the HASH-2, and the HASH-3 can correspond, and if so, it can be indicated that the video a has integrity.
Specifically, the terminal may directly determine whether HASH-2 and HASH-3 can correspond, and if so, may indicate that the video a has integrity. Or the terminal can firstly determine whether HASH-1 and HASH-2 can be corresponding or not, and if the HASH-1 and the HASH-2 cannot be corresponding, the terminal can determine that the video A does not have the integrity; if HASH-1 and HASH-2 can correspond, then it can be determined that video a has integrity, or to further verify the integrity of video a, it can be determined whether HASH-2 and HASH-3 can correspond, and when HASH-1 and HASH-2 can correspond, and HASH-2 and HASH-3 can correspond, it is determined that video a has integrity. See for details the description in step S93 above.
By applying the technical scheme provided by the embodiment of the application, the following technical effects can be realized:
(a) In the process of recording the target data stream, identification information can be calculated while recording, so that a great amount of time is saved, video is prevented from being modified by technical means in the process of recording, and the authenticity and integrity of the video are maintained;
(b) The integrity of the target data stream can be checked together through the check codes stored in multiple ends, so that the possibility that the target data stream cannot be detected due to frame extraction, frame adding and other operations is reduced;
(c) The TEE protection area in the recorder is used for storing the hash file corresponding to the recorded data stream, and the data stored in the TEE protection area is not easy to modify, so that the integrity of the target data stream acquired by the terminal from the platform can be accurately determined by comparing the second check code with the first check code;
(d) The method for calculating the first check code while recording the index of the target data stream is the leading index is provided, and the problem that when the index of the target data stream is the leading index, initial sub-data may change to cause inconsistent first check code and second check code is solved.
With continued reference to the recording system shown in fig. 1, described above, in combination with the data stream recording method and the data stream detecting method described above, the recorder 11, the platform 12, the terminal 13 in the recording system are mainly used to execute the following,
The recorder 11 is configured to calculate, during recording of the target data stream, identification information for identifying the latest recorded data every time a preset recording condition is reached; after the target data stream is recorded, calculating to obtain a first check code according to each piece of identification information, and storing the recorded target data stream corresponding to the first check code in the local of the recorder; the identification information is intermediate data obtained in the process of calculating the check code of the data, and the first check code is used for checking the integrity of the target data stream; see in particular the description of fig. 2 above.
The recorder 11 is further configured to send the target data stream, the first check code, and an equipment identifier of the recorder to a platform; see for details the description in step S23 above.
The platform 12 is configured to receive the target data stream sent by the recorder, the first check code, and an equipment identifier of the recorder, and store the target data stream and the first check code correspondingly; see for details the description in step S23 above.
The platform 12 is further configured to send the target data stream, the first check code, and a device identifier of the recorder to the terminal; see for details the description in step S23 above.
The terminal 13 is used for accessing the platform to download and play the target data stream, and acquiring a first check code and a device identifier of the recorder from the platform; see for details the description in step S23 above.
A terminal 13, configured to receive the target data stream and the device identifier of the recorder, which are sent by the platform; receiving the first check code sent by the platform as a third check code; calculating a check code of the target data stream as a second check code; acquiring a first check code corresponding to the target data stream from the recorder according to the equipment identifier; and verifying the integrity of the target data stream according to the second check code and the third check code, and/or verifying the integrity of the target data stream according to the first check code and the second check code. See in particular the description of the embodiment shown in fig. 9.
Corresponding to the above data stream recording method, the embodiment of the present application further provides a data stream recording device, which is applied to a recorder, as shown in fig. 12, and the device includes:
The identification calculation module 121: in the process of recording the target data stream, calculating the identification information for identifying the latest recorded data when the preset recording condition is met, wherein the identification information is intermediate data obtained in the process of calculating the check code of the data;
The check code calculation module 122: the first check code is used for verifying the integrity of the target data stream;
the storage module 123: the method comprises the steps of storing a recorded target data stream corresponding to a first check code in a local part of a recorder, storing the target data stream, the first check code and a device identifier of the recorder in a platform, downloading the target data stream by a terminal and playing the target data stream by the platform, and verifying the integrity of the target data stream stored by the platform by the device identifier.
The technical scheme provided by the embodiment of the application is as follows: in the process of recording the target data stream, when preset recording conditions are met, the identification information for identifying the latest recorded data is calculated, and after the target data stream is recorded, the first check code is calculated according to each sub-identification, so that the time interval from the latest recorded data to the identification information is shorter, before the latest recorded data is modified by a user, the identification information of the latest recorded data is obtained by the recorder, and even if the latest recorded data is modified by the user, the corresponding identification information is the identification information of the latest recorded data before the modification, and the check code of the data stream with the first check code being unmodified is obtained, namely, the first check code can represent the complete data stream recorded by the recorder.
After the recorder calculates the first check code, the recorded target data stream is stored in the local of the recorder corresponding to the first check code, and the target data stream, the first check code and the equipment identifier of the recorder are stored in the platform, so that the terminal can conveniently acquire the target data stream and the first check code of the target data stream, and after the terminal acquires the target data stream and the first check code, the terminal can verify the integrity of the acquired video stream by calculating the acquired check code of the target data stream and comparing the calculated check code with the first check code.
In some embodiments, the index of the target data stream is a leading index; the above-mentioned check code calculation module 122 is specifically configured to:
Calculating identification information for identifying modified sub-data as correction identification information, wherein the modified sub-data is data obtained by changing initial sub-data after the recording of a target data stream is completed, and the initial sub-data is data recorded before a preset recording condition is reached for the first time;
And calculating to obtain a first check code according to the correction identification information and other identification information except the initial identification information, wherein the initial identification information is identification information for identifying initial sub-data.
In some embodiments, the above-mentioned identification calculating module 121 is specifically configured to:
And processing the latest recorded data through a hash rule to obtain a hash stream which is used as the identification information of the latest recorded data when the preset recording condition is met.
In some embodiments, the storage module 123 is specifically configured to:
And storing the recorded target data stream in a TEE protection area of the recorder corresponding to the first check code, wherein the TEE protection area is used for protecting data in the process of restoring factory settings of the recorder.
In some embodiments, the terminal is configured to detect the target data stream by:
acquiring a check code stored corresponding to the target data stream from the platform as a third check code;
Calculating a check code of the target data stream as a second check code;
judging whether the third check code is the same as the second check code;
if the third check code is different from the second check code, determining that the target data stream does not have integrity.
In some embodiments, the terminal is further configured to obtain the first check code from the recorder if the third check code is the same as the second check code;
if the first check code is different from the second check code, determining that the target data stream does not have the integrity.
In correspondence to the above data stream recording method, an embodiment of the present application provides a recorder, as shown in fig. 13, including a recording unit 131, a processing unit 132, and a storage unit 133;
A recording unit 131 for recording the target data stream and storing the recorded target data stream in the storage unit 133;
a processing unit 132, configured to calculate, during the recording of the target data stream by the recording unit, identification information for identifying the latest recorded data each time a preset recording condition is reached;
The processing unit 132 is further configured to calculate a first check code according to each identification information after the recording of the target data stream is completed;
the processing unit 132 is further configured to store the recorded target data stream in the storage unit 133 corresponding to the first check code; storing the target data stream, the first check code and the equipment identifier of the recorder in the platform;
the identification information is intermediate data obtained in the process of calculating the check code of the data; the first check code is used for verifying the integrity of the target data stream; the platform is used for the terminal to download and play the target data stream, and the equipment identifier is used for checking the integrity of the target data stream stored by the platform.
In some embodiments, the storage unit 133 includes a first storage subunit (e.g., a memory card) for storing the recorded target data stream, and a second storage subunit; the second storage subunit (e.g., TEE protection area in the recorder) is used to store the first check code.
In the embodiment of the application, the first storage subunit is used for storing the recorded target data stream, and can correspondingly store the contents (such as the first check code, the equipment identifier and the like corresponding to the target data stream (for example, the hash file generated for the target data stream); the second storage subunit may be configured to store a hash file corresponding to the target data stream, where the hash file includes the first check code.
The recorder can also comprise a communication bus and/or a communication interface, and the processor, the communication interface and the memory can complete communication with each other through the communication bus.
The communication bus mentioned by the recorder may be a peripheral component interconnect standard (PERIPHERAL COMPONENT INTERCONNECT, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, etc. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface is used for communication between the recorder and other devices.
The Memory may include random access Memory (Random Access Memory, RAM) or may include Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but may also be a digital signal Processor (DIGITAL SIGNAL Processor, DSP), application SPECIFIC INTEGRATED Circuit (ASIC), field-Programmable gate array (Field-Programmable GATE ARRAY, FPGA) or other Programmable logic device, discrete gate or transistor logic device, discrete hardware components.
In yet another embodiment of the present application, a computer readable storage medium is provided, in which a computer program is stored, the computer program implementing the steps of any of the above-mentioned data stream recording methods when executed by a processor.
In yet another embodiment of the present application, a computer program product containing instructions that, when run on a computer, cause the computer to perform the method of recording a data stream of any of the above embodiments is also provided.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present application, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, for example, by wired (e.g., coaxial cable, optical fiber, digital Subscriber Line (DSL)), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, tape), an optical medium (e.g., DVD), or a Solid state disk (Solid STATE DISK, SSD), etc.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for the system, device, terminal, recorder embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments for relevant points.
The foregoing description is only of the preferred embodiments of the present application and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.
Claims (10)
1. A method of recording a data stream, for use with a recorder, the method comprising:
In the process of recording a target data stream, calculating identification information for identifying the latest recorded data when preset recording conditions are met, wherein the identification information is intermediate data obtained in the process of calculating check codes of the data; the latest recorded data is recorded from the position of the last time reaching the preset recording condition to the position of the next time reaching the preset recording condition;
Until the recording of the target data stream is completed, calculating to obtain a first check code according to each piece of identification information, wherein the first check code is used for verifying the integrity of the target data stream;
Storing the recorded target data stream corresponding to the first check code in the local of the recorder, and storing the target data stream, the first check code and a device identifier of the recorder in a platform, wherein the platform is used for a terminal to download and play the target data stream, and the device identifier is used for verifying the integrity of the target data stream stored in the platform.
2. The method of claim 1, wherein the index of the target data stream is a preamble index;
the calculating to obtain the first check code according to each piece of the identification information comprises the following steps:
Calculating identification information for identifying modified sub-data as correction identification information, wherein the modified sub-data is data obtained by changing initial sub-data after the recording of the target data stream is completed, and the initial sub-data is data recorded before the preset recording condition is reached for the first time;
and calculating to obtain a first check code according to the correction identification information and other identification information except the initial identification information, wherein the initial identification information is identification information for identifying initial sub-data.
3. The method of claim 1, wherein the calculating identification information for identifying the latest recorded data each time a preset recording condition is reached comprises:
And processing the latest recorded data through a hash rule to obtain a hash stream which is used as the identification information of the latest recorded data when the preset recording condition is met.
4. The method of claim 1, wherein the storing the recorded target data stream local to the recorder corresponding to the first check code comprises:
And storing the recorded target data stream in a TEE protection area of the recorder corresponding to the first check code, wherein the TEE protection area is used for protecting data in the process of restoring factory settings of the recorder.
5. The method according to claim 1, wherein the terminal is configured to detect the target data stream by:
acquiring a check code stored corresponding to the target data stream from the platform as a third check code;
calculating a check code of the target data stream as a second check code;
Judging whether the third check code is identical to the second check code;
And if the third check code is different from the second check code, determining that the target data stream does not have the integrity.
6. The method of claim 5, wherein the terminal is further configured to obtain the first check code from the recorder if the third check code is the same as the second check code;
and if the first check code is different from the second check code, determining that the target data stream does not have the integrity.
7. A data stream recording apparatus for use with a recorder, said apparatus comprising:
The identification calculation module: in the process of recording the target data stream, calculating the identification information for identifying the latest recorded data when the preset recording condition is met, wherein the identification information is intermediate data obtained in the process of calculating the check code of the data; the latest recorded data is recorded from the position of the last time reaching the preset recording condition to the position of the next time reaching the preset recording condition;
And a check code calculation module: the first check codes are used for verifying the integrity of the target data stream according to the identification information;
And a storage module: the device identification is used for storing the recorded target data stream locally corresponding to the first check code in the recorder, storing the target data stream, the first check code and the device identification of the recorder in a platform, wherein the platform is used for downloading and playing the target data stream by a terminal, and the device identification is used for verifying the integrity of the target data stream stored by the platform.
8. A recorder, which is characterized by comprising a recording unit, a processing unit and a storage unit;
The recording unit is used for recording a target data stream and storing the recorded target data stream into the storage unit;
The processing unit is used for calculating identification information for identifying the latest recorded data when preset recording conditions are met in the process of recording the target data stream by the recording unit; the latest recorded data is recorded from the position of the last time reaching the preset recording condition to the position of the next time reaching the preset recording condition;
The processing unit is further used for calculating a first check code according to each piece of identification information after the target data stream is recorded;
the processing unit is further configured to store the recorded target data stream in the storage unit corresponding to the first check code; storing the target data stream, the first check code and the equipment identifier of the recorder in a platform;
the identification information is intermediate data obtained in the process of calculating the check code of the data; the first check code is used for verifying the integrity of the target data stream; the platform is used for the terminal to download and play the target data stream, and the equipment identifier is used for checking the integrity of the target data stream stored by the platform.
9. The recorder of claim 8, wherein the storage unit comprises a first storage subunit and a second storage subunit, the first storage subunit for storing the recorded target data stream; the second storage subunit is configured to store the first check code.
10. A recording system, which is characterized by comprising a platform, a terminal and a recorder; wherein,
The recorder is used for calculating identification information for identifying the latest recorded data when preset recording conditions are met in the process of recording the target data stream; after the target data stream is recorded, calculating to obtain a first check code according to each piece of identification information, and storing the recorded target data stream corresponding to the first check code in the local of the recorder; the identification information is intermediate data obtained in the process of calculating the check code of the data, and the first check code is used for checking the integrity of the target data stream; the latest recorded data is recorded from the position of the last time reaching the preset recording condition to the position of the next time reaching the preset recording condition;
The recorder is further configured to send the target data stream, the first check code, and an equipment identifier of the recorder to a platform;
The platform is used for receiving the target data stream, the first check code and the equipment identifier of the recorder, which are sent by the recorder, and storing the target data stream, the first check code and the equipment identifier of the recorder correspondingly;
the platform is further configured to send the target data stream, the first check code, and an equipment identifier of the recorder to the terminal;
the terminal is used for receiving the target data stream sent by the platform and the equipment identifier of the recorder; receiving the first check code sent by the platform as a third check code; calculating a check code of the target data stream as a second check code; acquiring a first check code corresponding to the target data stream from the recorder according to the equipment identifier; and verifying the integrity of the target data stream according to the second check code and the third check code, and/or verifying the integrity of the target data stream according to the first check code and the second check code.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202410381967.2A CN117979118B (en) | 2024-03-29 | 2024-03-29 | Data stream recording method, device, recorder and recording system |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202410381967.2A CN117979118B (en) | 2024-03-29 | 2024-03-29 | Data stream recording method, device, recorder and recording system |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN117979118A CN117979118A (en) | 2024-05-03 |
| CN117979118B true CN117979118B (en) | 2024-07-02 |
Family
ID=90855033
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202410381967.2A Active CN117979118B (en) | 2024-03-29 | 2024-03-29 | Data stream recording method, device, recorder and recording system |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN117979118B (en) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN118368472B (en) * | 2024-06-20 | 2024-09-13 | 广州佰锐网络科技有限公司 | Video recording and transmitting realization method, computer program product and system |
| CN119622699A (en) * | 2024-11-21 | 2025-03-14 | 珠海格力电器股份有限公司 | Data security management method, device, electronic device and computer readable medium |
Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114691622A (en) * | 2020-12-31 | 2022-07-01 | 京东科技信息技术有限公司 | A data storage system, method, apparatus, device and storage medium |
Family Cites Families (11)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102325167A (en) * | 2011-07-21 | 2012-01-18 | 杭州微元科技有限公司 | Verifying method for network file transmission |
| CN106815530B (en) * | 2016-12-26 | 2020-04-24 | 北京爱接力科技发展有限公司 | Data storage method, data verification method and device |
| CN110933349B (en) * | 2019-11-19 | 2022-03-04 | 北京奇艺世纪科技有限公司 | Audio data generation method, device and system and controller |
| CN112883427A (en) * | 2019-11-29 | 2021-06-01 | 航天信息股份有限公司 | Method and device for detecting integrity of file |
| CN111414334B (en) * | 2020-02-21 | 2024-04-05 | 平安科技(深圳)有限公司 | File fragment uploading method, device, equipment and storage medium based on cloud technology |
| CN116579025A (en) * | 2021-04-20 | 2023-08-11 | 支付宝(杭州)信息技术有限公司 | File storage method, device and equipment |
| CN115248940A (en) * | 2021-04-28 | 2022-10-28 | 中移动金融科技有限公司 | Blockchain-based video certificate storage method, verification method and device |
| CN115618428B (en) * | 2022-12-19 | 2023-03-17 | 江西曼荼罗软件有限公司 | Data integrity checking method and system based on block chain technology |
| CN115795565A (en) * | 2022-12-22 | 2023-03-14 | 东软集团股份有限公司 | Log tamper-proofing method, device, equipment and storage medium |
| CN116366789A (en) * | 2023-03-13 | 2023-06-30 | 杭州海康威视数字技术股份有限公司 | Video storage and playback method, device and system |
| CN117201038A (en) * | 2023-09-25 | 2023-12-08 | 重庆长安汽车股份有限公司 | Data transmission verification method, system, electronic equipment and storage medium |
-
2024
- 2024-03-29 CN CN202410381967.2A patent/CN117979118B/en active Active
Patent Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114691622A (en) * | 2020-12-31 | 2022-07-01 | 京东科技信息技术有限公司 | A data storage system, method, apparatus, device and storage medium |
Also Published As
| Publication number | Publication date |
|---|---|
| CN117979118A (en) | 2024-05-03 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN117979118B (en) | Data stream recording method, device, recorder and recording system | |
| CN108563532B (en) | Data processing method and related device | |
| WO2017113677A1 (en) | User behavior data processing method and system | |
| US20150067316A1 (en) | Electronic device and testing method | |
| CN111757037B (en) | Video file reading and writing method and device | |
| CN110851535B (en) | Data processing method and device based on block chain, storage medium and terminal | |
| CN113934758A (en) | Vehicle fault repair method, device, vehicle terminal, server and storage medium | |
| CN115297104B (en) | File uploading method and device, electronic equipment and storage medium | |
| CN110795129A (en) | Data flashing method, device and equipment | |
| CN108197041B (en) | Method, device and storage medium for determining parent process of child process | |
| CN114913864A (en) | Audio data processing method, device, equipment and storage medium | |
| CN112148789A (en) | Processing method and system for controlling multimedia playing | |
| CN116820528A (en) | Firmware version upgrading method and device, chip and electronic equipment | |
| CN112015443A (en) | Upgrading method, device, electronic device and storage medium for electronic equipment | |
| CN113327063B (en) | Resource detection method, device, electronic equipment and computer readable storage medium | |
| CN112527371B (en) | Boot loader upgrading method and device, electronic equipment and storage medium | |
| CN106227665A (en) | A kind of equipment starting method and device | |
| US20190303547A1 (en) | Authorizing file access with user i/o and hardware usage patterns | |
| CN110362534B (en) | Snapshot verification method and system, electronic equipment and storage medium | |
| CN113890757B (en) | Flow playback method, system and equipment | |
| CN110727574A (en) | Method and device for testing stability of operating system and electronic equipment | |
| CN114372095B (en) | Method and device for determining unique identifier of equipment | |
| CN112068864B (en) | Terminal device camera software update method, device and terminal device | |
| CN110187658B (en) | Chip processing method and device, chip and elevator outbound board | |
| CN109684870B (en) | A self-contained file information configuration method and system |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant |