Multimedia data downloading system and method
By using the binary stream data format to encapsulate and transmit multimedia data in the multimedia data download system, the problem of high complexity of multimedia data analysis and inability to meet the characteristics of lower-side broadcasting in the prior art is solved, and a better customer experience is achieved.
Patent Information
- Application Number
- CN202311451248.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-31
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2043-10-31
AI Technical Summary
Existing multimedia data generation and download methods lead to excessive complexity in multimedia data parsing, which cannot meet the client's side-by-side broadcasting characteristics, resulting in poor customer experience.
Provide a multimedia data download system and method, through the collaboration between the multimedia client and the server, encapsulate and transmit multimedia data using the binary stream data format, allowing the client to gradually read and synchronize the playback of multimedia data.
It simplifies the multimedia data parsing process, reduces the processing complexity of the client, satisfies the characteristics of playing at the bottom, and improves the customer experience.
Smart Images

Figure CN117579603B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of multimedia data, and in particular to a multimedia data downloading system and method. Background Art
[0002] With the development of the Internet, multimedia data has penetrated into people's lives. There are two existing methods for generating and downloading multimedia data. One is to use different parsing methods according to the response body status code: when the multimedia server executes normally, the added video description information is generally placed in the response body's response header, which has certain parsing complexity and information security leakage risks. When the multimedia server executes an error, the multimedia client needs to distinguish whether the execution is normal according to the status code type, and when the execution error occurs, another set of parsing methods needs to be used to obtain specific error information (for example, when the execution is normal, the client uses binary stream data format parsing, and when the execution error occurs, the JSON data format is used for parsing), which increases the parsing complexity of the client. One method is to write all information in the response body in JSON data format. The client must download all the response body data before parsing the response information. Only when it is judged to be normal can the video data be forwarded to the player. This does not meet the client's download and play characteristics, resulting in slow screen output, playback delay, long waiting time, and unfriendly experience.
[0003] Therefore, there is an urgent need to propose a multimedia data downloading system and method to solve the technical problems in the prior art that the multimedia data parsing complexity is too high and the transmission of multimedia data cannot meet the needs of the client, resulting in a poor customer experience. Summary of the invention
[0004] In view of this, it is necessary to provide a multimedia data downloading system and method to solve the technical problems existing in the prior art that the multimedia data parsing complexity is too high and the transmission of multimedia data cannot meet the needs of the client, resulting in a poor customer experience.
[0005] In one aspect, the present invention provides a multimedia data downloading system, the system comprising a multimedia client and a multimedia server;
[0006] The multimedia client is used to obtain user instructions and send interface call instructions to the multimedia server according to the user instructions;
[0007] The multimedia server is used to determine the multimedia data index according to the interface calling instruction when receiving the interface calling instruction, download the multimedia data according to the multimedia data index, write the response body of the response body after encapsulating the multimedia data, and return the response body to the multimedia client in binary stream data format, so that the multimedia client obtains the binary stream data of the multimedia data according to the response body, and gradually reads and synchronously plays the multimedia data according to the binary stream data.
[0008] In some possible implementations, the multimedia client is further configured to perform data parsing on the response body according to the binary stream data format to obtain binary stream data of the multimedia data.
[0009] In some possible implementations, the binary stream data format of the response body includes global error code information and response data information;
[0010] The multimedia server is also used to obtain the specific error code and error prompt information of the execution failure according to the global error code information when an error occurs during the execution of the encapsulation; when the encapsulation execution process is correct, obtain the multimedia data stream from the response data information.
[0011] In some possible implementations, the global error code information includes a binary stream version number, an error code, an error message length, and an error message character string; the version number corresponds to the parsing method used by the multimedia client to parse data; the error code is used to record the result of the current interface call; the error message length is used to record the byte length occupied by the error message character string; the error message character string is used to store the error prompt information of the multimedia client when a call error occurs.
[0012] In some possible implementations, the response data information includes a data format type, a data length, and data of a binary stream.
[0013] In some possible implementations, the response data information includes first response data information;
[0014] The first response data information is used to store multimedia description data; the data format type is used to record the data type of the following data segment; the data length is used to record the byte length occupied by the following multimedia description data segment; and the data is used to record the multimedia description data of the current segment.
[0015] In some possible implementations, the response data information further includes second response data information;
[0016] The second response data information is used to store multimedia data; the data format type is a data type used to record multimedia data; the data length is used to record the data length of multimedia data; the data is used to record the multimedia data stream played by the player, wherein the multimedia data stream includes each frame of data required for playback.
[0017] In some possible implementations, the multimedia server is further used to write the global error code information, the first response data information and the second response data information into the response body of the response body in sequence when the encapsulation execution process is correct.
[0018] In some possible implementations, the multimedia server is further used to expand the response data information to determine a third response data information, and the binary stream data format is the global error code information - the first response data information - the third response data information - the second response data information.
[0019] On the other hand, the present invention also provides a multimedia data downloading method, comprising:
[0020] When receiving an interface call instruction sent by a multimedia client, determining a multimedia data index according to the interface call instruction;
[0021] Download the multimedia data according to the multimedia data index, and write the multimedia data into the response body after encapsulating the multimedia data;
[0022] The response body is returned to the multimedia client in a binary stream data format, so that the multimedia client obtains the binary stream data of the multimedia data according to the response body, and reads and synchronously plays the multimedia data step by step according to the binary stream data.
[0023] The beneficial effects of adopting the above embodiment are as follows: the multimedia data download system provided by the present invention, the multimedia client is used to obtain user instructions, and send an interface call instruction to the multimedia server according to the user instructions; the multimedia server is used to determine the multimedia data index according to the interface call instruction when receiving the interface call instruction, and download the multimedia data according to the multimedia data index, write the response body of the response body after encapsulating the multimedia data, and return the response body to the multimedia client in a binary stream data format, so that the multimedia client obtains the binary stream data of the multimedia data according to the response body, and reads and plays the multimedia data step by step according to the binary stream data. The present invention encapsulates the multimedia data in a binary stream data format and transmits the response body to the multimedia client, which reduces the complexity of the multimedia data, thereby simplifying the process of the multimedia client obtaining the binary stream data of the response body, and reducing the complexity of the multimedia client processing the response body. Further, the binary stream data of the multimedia data is obtained by the multimedia client, so that the multimedia data can be read and played step by step, which meets the characteristics of the multimedia client downloading and playing at the same time, and improves the customer experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0025] Figure 1 A schematic diagram of an embodiment of a multimedia data downloading system provided by the present invention;
[0026] Figure 2 A schematic diagram of the structure of an embodiment of the video download and playback process provided by the present invention;
[0027] Figure 3 A schematic diagram of the structure of an embodiment of the binary stream data format of the response body provided by the present invention;
[0028] Figure 4 A schematic diagram of the structure of an embodiment of the multimedia data downloading method provided by the present invention;
[0029] Figure 5 A schematic structural diagram of an embodiment of an electronic device provided by the present invention. DETAILED DESCRIPTION
[0030] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0031] Some of the block diagrams shown in the accompanying drawings are functional entities that do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor systems and / or microcontroller systems.
[0032] Reference to an "embodiment" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiment may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0033] The embodiments of the present invention provide a multimedia data downloading system and method, which are described below respectively.
[0034] Figure 1 A schematic diagram of an embodiment of a multimedia data downloading system provided by the present invention is shown in FIG. Figure 1 As shown, the system 100 includes a multimedia client 101 and a multimedia server 102;
[0035] The multimedia client 101 is used to obtain user instructions and send interface call instructions to the multimedia server 102 according to the user instructions;
[0036] The multimedia server 102 is used to determine the multimedia data index according to the interface call instruction when receiving the interface call instruction, download the multimedia data according to the multimedia data index, write the response body of the response body after encapsulating the multimedia data, and return the response body to the multimedia client 101 in the binary stream data format, so that the multimedia client 101 can obtain the binary stream data of the multimedia data according to the response body, and gradually read and synchronously play the multimedia data according to the binary stream data.
[0037] Compared with the prior art, the multimedia data downloading system provided by the embodiment of the present invention comprises a multimedia client 101, which is used to obtain a user instruction and send an interface call instruction to a multimedia server 102 according to the user instruction; the multimedia server 102 is used to determine a multimedia data index according to the interface call instruction when receiving the interface call instruction, download the multimedia data according to the multimedia data index, write the response body of the response body after encapsulating the multimedia data, and return the response body to the multimedia client 101 in a binary stream data format, so that the multimedia client 101 obtains the binary stream data of the multimedia data according to the response body, and reads and plays the multimedia data step by step according to the binary stream data. The present invention can encapsulate the multimedia data in a binary stream data format and transmit the response body to the multimedia client 101, thereby reducing the complexity of the multimedia data, thereby simplifying the process of the multimedia client 101 obtaining the binary stream data of the response body, and reducing the complexity of the multimedia client 101 processing the response body. Furthermore, binary stream data of multimedia data is obtained through the multimedia client 101, so that the multimedia data can be read step by step and played synchronously, which satisfies the downloading and playing characteristics of the multimedia client 101 and improves the customer experience.
[0038] It should be understood that the multimedia data may be video data or other data. The multimedia data in the embodiment of the present invention is described by taking video data as an example.
[0039] In a specific embodiment of the present invention, the user can perform operations on the multimedia client 101, such as Figure 2 As shown, Figure 2 A structural diagram of an embodiment of a video download and playback process is provided. The multimedia client 101 can determine the video stream data requested for playback based on the user's operation information, and then send an interface call instruction to the multimedia server 102 based on the video stream data. The interface call instruction can be used to pull the video stream data. The multimedia server 102 can receive the interface call instruction sent by the multimedia client 101. The system may include a database. The multimedia server 102 can query the index information of the video data from the database based on the interface call instruction, and then download the video data from the cloud storage based on the index information, encapsulate the downloaded video data and write it into the response body of the response body, and then return the response body to the multimedia client 101. The multimedia client 101 processes the response body to obtain the binary stream data of the response body, and then gradually reads and synchronously plays the multimedia data based on the binary stream data.
[0040] In some embodiments of the present invention, the multimedia client 101 is further configured to parse the response body according to the binary stream data format to obtain binary stream data of the multimedia data.
[0041] In a specific embodiment of the present invention, in order to reduce the complexity of multimedia data, after receiving the interface call instruction sent by the multimedia client 101, the multimedia server 102 can determine the index information of the multimedia data from the database according to the interface call instruction, and then download the multimedia data from the cloud according to the index information. The multimedia server 102 can encapsulate the multimedia data according to the binary stream data format, and then when the multimedia client 101 obtains the encapsulated response text, in order to obtain the multimedia data in the response text, it is necessary to parse the response text to obtain the binary stream data of the multimedia data. Because the encapsulation is performed according to the binary stream data format, the parsed data is also the binary stream data, which greatly reduces the complexity of data parsing.
[0042] In some embodiments of the present invention, the binary stream data format of the response body includes global error code information and response data information;
[0043] The multimedia server 102 is also used to obtain the specific error code and error prompt information of the execution failure according to the global error code information when an error occurs during the execution of the encapsulation; when the encapsulation execution process is correct, obtain the multimedia data stream from the response data information.
[0044] In a specific embodiment of the present invention, the multimedia client 101 sends an interface call instruction to the multimedia server 102. When the multimedia server 102 encapsulates the multimedia data downloaded from the cloud storage according to the interface call instruction, if an error occurs in the process, the first layer in the binary stream data format can be executed. The first layer is the global error code information. The specific error code and error prompt information of the execution failure can be obtained from the global error code information. The specific error code and error prompt information are returned to the multimedia client 101, and the process ends; if no error occurs in the process, after the local error code information is executed, the response data information is executed. After the execution is completed, the multimedia data stream can be obtained from the response data information.
[0045] Further, such as Figure 3 As shown, Figure 3The structure diagram of an embodiment of the binary stream data format of the response body is provided. The binary stream parsing format (binary stream data format) of the response body may include a first layer, a second layer, ..., an nth layer, wherein the first layer is global error code information, and the 2 bytes starting with the global error code information are the version number version of the binary stream, wherein each version number specifies the parsing method of the binary stream of this version, so that the multimedia client 101 can redefine the data format according to the version number, update iteratively, for example, if 4 bytes of the error code are not enough and 8 bytes are needed to express it, then the version number needs to be changed to tell the front end The parsing method has changed, and when the subsequent data format needs to be redefined, the version number needs to be updated; the 2 bytes from 3 to 6 are the error code code of the int four-byte integer, which is used to record the result of the current interface call, the global error code of success or failure, for example, the global error code of success is 200; the 7th to 8th bytes are the error information length msgLen of the short two-byte integer, which is used to record the byte length occupied by the error information string; the 9th to (8+msgLen) bytes are strings of length msgLen, which can be used to store the error prompt information of the multimedia client 101 when the call error occurs. Among them, error identification and positioning: when a function call fails, the error code of this function will be passed to the global variable. Through this global variable, detailed information of the error can be obtained, including the cause of the error and the location where the error occurred. This helps to quickly locate and solve the problem. Error information retrieval: The global error code can also be passed as a parameter to other functions, such as strerror. This function can find the corresponding error information string according to the error code, and return a pointer to the address of the first character of this string, and then the error information can be printed out through the pointer and the formatted string. Business logic judgment: In some tightly coupled microservices or in the upstream and downstream of the program, the global error code can be used as an important basis for judging the business logic. Developers can make corresponding business decisions based on the error code to ensure the integrity of the overall process. In general, the global error code is an effective error handling mechanism. It helps us better understand and solve the problems by providing specific information about the error. At the same time, it is also an important tool that can help developers better design and implement programs.
[0046] The second to nth layers are response data information, which may include the data format type, data length and data of the binary stream; the response data information may include the first response data information of the second layer; wherein the first response data information may be used to store multimedia description data; the (9+msgLen) to (10+msgLen) bytes of the first response data information of the second layer may be the data format type dataType of a short 2-byte integer, which may be used to record the data type of the following data, such as video description information in JSON format; the (11+msgLen) to (14+msgLen) bytes may be int The data length dataLen of the 4-byte integer can be used to record the byte length occupied by the following multimedia description data. In practical applications, the specific length of the error message is not certain. In order to save transmission data traffic and facilitate the acquisition of variable-length error messages, the error message length msgLen is added to quickly locate the start and end offsets of the error message in the entire binary stream; the (15+msgLen) to (14+msgLen+dataLen) bytes are the multimedia description data of the current segment, which can be used to record the multimedia description data of the current segment. All description information key-value pairs can be obtained after decompiling through JSON (JavaScript Object Notation, JS object notation), such as the start and end time of the returned video, video frame rate, encoding format, etc.
[0047] The response data information may also include the second response data information of the nth layer; the second response data information of the nth layer may be used to store multimedia data; the second layer is similar to the nth layer, the data format type dataType of the short 2-byte integer at the beginning is a binary video stream data format, which is used for recording the data type of multimedia data; the data length dataLen of the int 4-byte integer is used to record the data length of the multimedia data; the following dataLen bytes of data are used to record the multimedia data stream played by the player, wherein the multimedia data stream may include each frame of data required for playback.
[0048] In some embodiments of the present invention, the multimedia server 102 is further configured to write the global error code information, the first response data information and the second response data information into the response text of the response body in sequence when the encapsulation execution process is correct.
[0049] In a specific embodiment of the present invention, the encapsulation execution process is to first execute the global error code information in the binary stream data format. If no error occurs, the first response data information and the second response data information are executed. When the encapsulation execution process is completed, the global error code information, the first response data information and the second response data information can be written into the response body of the response body in sequence to complete the encapsulation of the multimedia data.
[0050] In some embodiments of the present invention, the multimedia server 102 is further used to expand the response data information and determine the third response data information, and the binary stream data format is global error code information-first response data information-third response data information-second response data information.
[0051] In a specific embodiment of the present invention, the global error code information of the binary stream data format is used to store error information, the first response data information is used to store visual multimedia description data, and the second response data information is used to store multimedia data. The embodiment of the present invention can arbitrarily expand the response data information according to actual needs. For example, any data such as thumbnails and pages can be added between the second layer and the nth layer in the binary stream data format, and the data format type dataTypeN of 2 integers, the data length dataLenN of 4 integers, and the data dataN of dataLenN byte length can be added respectively; for example, the third response data information, the execution process of the multimedia server 102 to encapsulate the multimedia data is to first perform the global error code information, then perform the first response data information, then perform the third response data information, and finally perform the second response data information to complete the encapsulation process of the multimedia data.
[0052] The multimedia data may be video data, which includes audio frames and video frames. The video frames are divided into I frames, P frames, and B frames. When played in a player, they can be parsed and played frame by frame in sequence. In order to play quickly or in real time, the player needs to be started to play the video during the transmission process without waiting for the data of a period of time to be downloaded completely. If the third response data information (e.g., thumbnail) is displayed in the last layer, the thumbnail must be displayed after all the data is downloaded in the multimedia client 101 (generally, the thumbnail is displayed before the video is played), or the thumbnail is displayed after the video is downloaded and played simultaneously. In this way, the thumbnail is not very meaningful, so the main text of the video needs to be placed in the last layer.
[0053] The multimedia client 101 is used to obtain user instructions and send an interface call instruction to the multimedia server 102 according to the user instructions; the multimedia server 102 is used to determine the multimedia data index according to the interface call instruction when receiving the interface call instruction, download the multimedia data according to the multimedia data index, write the response body of the response body after encapsulating the multimedia data, and return the response body to the multimedia client 101 in a binary stream data format, so that the multimedia client 101 can obtain the binary stream data of the multimedia data according to the response body, and read and play the multimedia data step by step according to the binary stream data. The present invention can encapsulate the multimedia data in a binary stream data format and transmit the response body to the multimedia client 101, thereby reducing the complexity of the multimedia data, thereby simplifying the process of the multimedia client 101 obtaining the binary stream data of the response body, and reducing the complexity of the multimedia client 101 processing the response body. Further, the binary stream data of the multimedia data is obtained by the multimedia client 101, so that the multimedia data can be read and played step by step, which meets the download and play characteristics of the multimedia client 101 and improves the customer experience.
[0054] The embodiment of the present invention can query the video file index of this period according to the API call information, then download the video data from the cloud storage service according to the index information, and finally parse and return it to the multimedia client 101 for playback; when an error occurs during the execution of the multimedia service, it is necessary to return different error codes according to the type of error, and use the advantages of the global error code to feedback and solve the problem.
[0055] The present invention can be illustrated by an example in which a platform client calls a platform server to pull a video stream data interface:
[0056] When the platform client calls the platform server to pull the video stream data interface, when the platform server successfully executes the request information, it needs to return the error code information of the successful request, the description information of the video data, and the video stream data. The platform server first queries the video index in the database, and then downloads the video data from MinIO according to the index information, encapsulates all the data and writes it into the response body of the response body, and finally returns it to the platform client for parsing and playback. The response body MIME type Content-Type returned by the platform server is in the binary stream data format of application / octet-stream.
[0057] The data encapsulation process of the response body is as follows: Figure 3In the first layer shown, the platform server response body first writes the short integer 1 to mark the response body version as 1; then writes the error code int integer 200 indicating successful execution; the error message msg is "successful execution", and its string length is calculated to be 12, then continue to write the short integer 12 of the error message length msgLen, and write the error message string msg.
[0058] The platform server response body continues to write the description information of the video stream {"startTime":1689955200000,"endTime":1689994740001,"rate":30}, recording the start and end timestamps of the video and the video frame rate rate. The length of this JSON data is 61, such as Figure 3 In the second layer shown, if the JSON data format type is defined as 1, a short integer 1 is written, the data length dataLen is an int integer 61, and JSON data with a length of 61 bytes is written.
[0059] like Figure 3 In the third layer shown, the platform server response body finally writes the binary data of the video stream. The total byte length of the video stream is calculated to be 120,000 bytes (120KB). The defined binary video data format type is 2, so the short integer 2 is written, the video stream data length dataLen is written as the int integer 120,000, and the video data with a length of 120KB is written.
[0060] When the platform client receives the response body data one by one in TCP packets, it reads them one by one in the order of TCP packets, such as Figure 3 The binary stream parsing format shown in the figure first reads the version number version as 1, which means that this parsing format is used. Then the error code code is read as 200, and the error message msg is "execution successful", which means that the server is executed successfully and the response data can be read smoothly. Then read the second layer of data format type and data length, and you know that this layer is 61 bytes of JSON data. After reading 61 bytes of data, you can serialize the data into parsed JSON data {"startTime":1689955200000,"endTime":1689994740001,"rate":30}, and get the start and end time and frame rate of this video stream. Finally, after reading the third layer of data format type and data length, you know that this is the binary data of the 120KB video stream, and you can read each frame of audio and video data step by step according to the format of the video stream, and immediately forward it to the player for playback, so you can achieve download and play at the same time, and users do not have to wait for the video data to be completely downloaded before playing, which improves the user experience.
[0061] In order to better implement the multimedia data downloading system in the embodiment of the present invention, based on the multimedia data downloading system, the embodiment of the present invention also provides a multimedia data downloading method, such as Figure 4 As shown, the multimedia data downloading method includes:
[0062] S401, when receiving an interface calling instruction sent by a multimedia client, determining a multimedia data index according to the interface calling instruction;
[0063] S402, downloading multimedia data according to the multimedia data index, encapsulating the multimedia data and writing it into the response body of the response body;
[0064] S403: Return the response body in a binary stream data format to the multimedia client, so that the multimedia client obtains the binary stream data of the multimedia data according to the response body, and reads and synchronously plays the multimedia data step by step according to the binary stream data.
[0065] The multimedia data downloading method provided in the above embodiment can implement the technical solution described in the above multimedia data downloading system embodiment. The specific implementation principles of the above modules or units can refer to the corresponding contents in the above multimedia data downloading system embodiment, which will not be repeated here.
[0066] like Figure 5 As shown, the present invention also provides an electronic device 500. The electronic device 500 includes a processor 501, a memory 502 and a display 503. Figure 5 Only some components of the electronic device 500 are shown, but it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.
[0067] In some embodiments, the memory 502 may be an internal storage unit of the electronic device 500, such as a hard disk or memory of the electronic device 500. In other embodiments, the memory 502 may also be an external storage device of the electronic device 500, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 500.
[0068] Furthermore, the memory 502 may include both an internal storage unit of the electronic device 500 and an external storage device. The memory 502 is used to store application software installed in the electronic device 500 and various data.
[0069] In some embodiments, the processor 501 may be a central processing unit (CPU), a microprocessor or other data processing chip, used to run program codes or process data stored in the memory 502, such as the multimedia data downloading system of the present invention.
[0070] In some embodiments, the display 503 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, etc. The display 503 is used to display information on the electronic device 500 and to display a visual user interface. The components 501-503 of the electronic device 500 communicate with each other via a system bus.
[0071] In some embodiments of the present invention, when the processor 501 executes the multimedia data downloading program in the memory 502, the following steps may be implemented:
[0072] When receiving an interface call instruction sent by a multimedia client, determining a multimedia data index according to the interface call instruction;
[0073] Download multimedia data according to the multimedia data index, and write the multimedia data into the response body after encapsulating it;
[0074] The response body is returned to the multimedia client in a binary stream data format, so that the multimedia client obtains the binary stream data of the multimedia data according to the response body, and reads and synchronously plays the multimedia data step by step according to the binary stream data.
[0075] It should be understood that: when the processor 501 executes the multimedia data downloading program in the memory 502, in addition to the above functions, other functions can also be implemented. For details, please refer to the description of the corresponding method embodiment above.
[0076] Furthermore, the embodiment of the present invention does not specifically limit the type of the electronic device 500 mentioned, and the electronic device 500 may be a portable electronic device such as a mobile phone, a tablet computer, a personal digital assistant (PDA), a wearable device, a laptop computer, etc. Exemplary embodiments of portable electronic devices include but are not limited to portable electronic devices equipped with IOS, Android, Microsoft or other operating systems. The above-mentioned portable electronic devices may also be other portable electronic devices, such as a laptop computer with a touch-sensitive surface (e.g., a touch panel). It should also be understood that in some other embodiments of the present invention, the electronic device 500 may not be a portable electronic device, but a desktop computer with a touch-sensitive surface (e.g., a touch panel).
[0077] Accordingly, an embodiment of the present application also provides a computer-readable storage medium, which is used to store computer-readable programs or instructions. When the program or instructions are executed by a processor, the multimedia data downloading system steps or functions provided in the above-mentioned method embodiments can be implemented.
[0078] Those skilled in the art will appreciate that all or part of the processes of the above-mentioned embodiments can be implemented by instructing related hardware (such as a processor, a controller, etc.) through a computer program, and the computer program can be stored in a computer-readable storage medium, wherein the computer-readable storage medium is a disk, an optical disk, a read-only storage memory, or a random access memory, etc.
[0079] The multimedia data downloading system and method provided by the present invention are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for technical personnel in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A multimedia data downloading system, characterized in that: The system includes a multimedia client and a multimedia server; The multimedia client is used to obtain user instructions and send interface call instructions to the multimedia server according to the user instructions; The multimedia server is used to determine the multimedia data index according to the interface calling instruction when receiving the interface calling instruction, download the multimedia data according to the multimedia data index, write the response body of the response body after encapsulating the multimedia data, and return the response body to the multimedia client in a binary stream data format, so that the multimedia client obtains the binary stream data of the multimedia data according to the response body, and reads and plays the multimedia data step by step according to the binary stream data; The binary stream data format of the response body includes global error code information and response data information; The multimedia server is also used to obtain the specific error code and error prompt information of the execution failure according to the global error code information when an error occurs during the execution of the encapsulation; when the encapsulation execution process is correct, obtain the multimedia data stream from the response data information.
2. The multimedia data downloading system according to claim 1, characterized in that: The multimedia client is further used to perform data parsing on the response body according to the binary stream data format to obtain binary stream data of the multimedia data.
3. The multimedia data downloading system according to claim 1, characterized in that: The global error code information includes a binary stream version number, an error code, an error information length, and an error information string; the version number corresponds to the parsing method when the multimedia client performs data parsing; the error code is used to record the result of the current interface call; the error information length is used to record the byte length occupied by the error information string; The error message character string is used to store the error prompt information of the multimedia client when a call error occurs.
4. The multimedia data downloading system according to claim 1, characterized in that: The response data information includes the data format type, data length and data of the binary stream.
5. The multimedia data downloading system according to claim 4, characterized in that: The response data information includes first response data information; The first response data information is used to store multimedia description data; the data format type is used to record the data type of the following data segment; the data length is used to record the byte length occupied by the following multimedia description data segment; and the data is used to record the multimedia description data of the current segment.
6. The multimedia data downloading system according to claim 5, characterized in that: The response data information also includes second response data information; The second response data information is used to store multimedia data; the data format type is a data type used to record multimedia data; the data length is used to record the data length of multimedia data; The data is used to record the multimedia data stream played by the player, wherein the multimedia data stream includes each frame of data required for the playback.
7. The multimedia data downloading system according to claim 6, characterized in that: The multimedia server is also used to write the global error code information, the first response data information and the second response data information into the response body of the response body in sequence when the encapsulation execution process is correct.
8. The multimedia data downloading system according to claim 7, characterized in that: The multimedia server is further used to expand the response data information to determine the third response data information, and the binary stream data format is the global error code information - the first response data information - the third response data information - the second response data information.
9. A method for downloading multimedia data, characterized in that: include: When receiving an interface call instruction sent by a multimedia client, determining a multimedia data index according to the interface call instruction; Download the multimedia data according to the multimedia data index, and write the multimedia data into the response body after encapsulating the multimedia data; Returning the response body to the multimedia client in a binary stream data format, so that the multimedia client obtains the binary stream data of the multimedia data according to the response body, and reads and synchronously plays the multimedia data step by step according to the binary stream data; The binary stream data format of the response body includes global error code information and response data information; When an error occurs during the execution of the package, the specific error code and error prompt information of the execution failure are obtained according to the global error code information; When the encapsulation process is performed correctly, the multimedia data stream is obtained from the response data information.
Citation Information
Patent Citations
Method and equipment for video laying
CN103702240A