Video data processing method, device, electronic device and computer readable medium
By using named pipes to transmit video data packets in the game, the network overhead problem caused by video data processing is solved, the CPU overhead is reduced, efficiency is improved, and the gaming experience is improved.
Patent Information
- Application Number
- CN202111500581.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-09
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2041-12-09
AI Technical Summary
In the game, as the number and intensity of battles increases, the network overhead caused by video data processing increases, affecting the player's gaming experience.
By using named pipes to transmit recording data packets between the battle processing process and the recording processing process, the CPU overhead is reduced and additional network overhead is avoided. The recording processing process is used to process the recording data to reduce the impact on the player's gaming experience.
It effectively reduces the CPU overhead and network overhead during video data processing, improves the efficiency and stability of video data transmission and processing, and improves the player's gaming experience.
Smart Images

Figure CN114159800B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of data processing, and in particular to a method for processing video data, a device for processing video data, an electronic device, and a computer-readable medium. Background Art
[0002] In-game recording refers to the process of recording the player's game operations. After obtaining the video file, the game battle process can be replayed.
[0003] Generally speaking, as the number of players in a battle increases and the intensity intensifies, the amount of video data will also increase. Processing this data will cause additional overhead to the battle process, which may affect the player's gaming experience.
[0004] In view of this, there is an urgent need in the art for a method for processing video data that can reduce network overhead.
[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0006] The purpose of the present disclosure is to provide a method for processing video data, a device for processing video data, an electronic device and a computer-readable medium, thereby at least to a certain extent being able to reduce the network overhead caused in the process of processing video data.
[0007] According to a first aspect of the present disclosure, a method for processing video data is provided, comprising:
[0008] During a battle of a game object, a video data packet corresponding to the game object is obtained through a battle processing process, wherein the video data packet includes protocol data generated by the game object during the battle;
[0009] Transmitting the video data packet from the battle processing process to the video processing process via a named pipe;
[0010] The protocol data in the video data packet is processed through the video processing process to obtain the video playback data corresponding to the game object.
[0011] In an exemplary embodiment of the present disclosure, before obtaining the video data packet corresponding to the game object through the battle processing process, the method further includes:
[0012] When the game object battle starts, determining the data transmission parameters between the battle processing process and the video processing process;
[0013] Initialize the data transmitter in the battle processing process, and the data receiver and data processor in the video processing process.
[0014] In an exemplary embodiment of the present disclosure, the step of obtaining a video data packet corresponding to the game object through a battle processing process includes:
[0015] Acquire the protocol data generated by the game object during the battle process, as well as the identification information and message type of the video data packet, through the data transmitter in the battle processing process;
[0016] The video data packet corresponding to the game object is obtained according to the protocol data, the identification information and the message type.
[0017] In an exemplary embodiment of the present disclosure, the transmitting the video data packet from the battle processing process to the video processing process through a named pipe includes:
[0018] Writing the serialized video data packet into the named pipe through a data sending agent corresponding to the data sender in the battle processing process;
[0019] The video data packet is read from the named pipe through a data receiving agent corresponding to the data receiver in the video processing process, and the video data packet is obtained from the data receiving agent through the data receiver in the video processing process.
[0020] In an exemplary embodiment of the present disclosure, the processing of the protocol data in the video data packet by the video processing process to obtain the video playback data corresponding to the game object includes:
[0021] Deserialize the video data packet through the data receiver in the video processing process, obtain the message type in the video data packet, and execute a corresponding processing flow according to the message type;
[0022] Acquiring identification information in the video data packet, classifying the video data packet according to the identification information, and sending the video data packet to the data processor in the video processing process;
[0023] The protocol data in the video data packet is encoded in a video format by a data processor in the video processing process to obtain video playback data corresponding to the game object.
[0024] In an exemplary embodiment of the present disclosure, the method further includes:
[0025] When the battle of the game objects ends, the video playback data is compressed and stored by the data processor in the video processing process.
[0026] In an exemplary embodiment of the present disclosure, after the data processor in the video processing process compresses and stores the video playback data, the method further includes:
[0027] Close the data transmitter in the battle processing process, the data receiver and the data processor in the video processing process, and the data sending agent corresponding to the data transmitter and the data receiving agent corresponding to the data receiver.
[0028] According to a second aspect of the present disclosure, there is provided a device for processing video data, comprising:
[0029] A video data acquisition module, used to acquire a video data packet corresponding to the game object through a battle processing process during the battle of the game object, wherein the video data packet includes protocol data generated by the game object during the battle;
[0030] A video data transmission module, used for transmitting the video data packet from the battle processing process to the video processing process through a named pipe;
[0031] The video data processing module is used to process the protocol data in the video data packet through the video processing process to obtain the video playback data corresponding to the game object.
[0032] According to a third aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any one of the above-described methods for processing video data by executing the executable instructions.
[0033] According to a fourth aspect of the present disclosure, a computer-readable medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the method for processing video data described in any one of the above is implemented.
[0034] The exemplary embodiments of the present disclosure may have the following beneficial effects:
[0035] In the method for processing video data of the example implementation of the present disclosure, a video processing process for processing video data is added to the server where the battle processing process is deployed, and the video data is transmitted between the battle processing process and the video processing process through the named pipe provided by the operating system. The method for processing video data in the example implementation of the present disclosure, on the one hand, processes video data through the video processing process, which can reduce the CPU overhead caused by the processing of video data in the battle processing process, thereby reducing the impact of the video function in the game on the player's gaming experience; on the other hand, the transmission of video data between processes through the named pipe avoids the additional network overhead caused by data transmission, and improves the efficiency and stability of the transmission and processing of video data.
[0036] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0038] Figure 1 A schematic diagram showing a flow chart of a method for processing video data according to an exemplary embodiment of the present disclosure;
[0039] Figure 2 A schematic diagram showing a flow chart of obtaining a video data packet through a battle processing process according to an exemplary embodiment of the present disclosure;
[0040] Figure 3 A schematic diagram showing a unified modeling language for video data packets according to a specific embodiment of the present disclosure is shown;
[0041] Figure 4 A schematic diagram showing a flow chart of transmitting a video data packet from a combat processing process to a video processing process according to an exemplary embodiment of the present disclosure;
[0042] Figure 5 A schematic diagram showing a flow chart of processing protocol data in a video data packet according to an exemplary embodiment of the present disclosure;
[0043] Figure 6 A schematic diagram showing a data receiver performing different operations according to different message types according to a specific implementation of the present disclosure;
[0044] Figure 7A flowchart showing an initialization process at the beginning of a battle according to an exemplary embodiment of the present disclosure is shown;
[0045] Figure 8 A schematic diagram of the process of initializing video data transmission according to a specific implementation of the present disclosure is shown;
[0046] Fig. 9 A schematic diagram of the process of video data transmission according to a specific implementation of the present disclosure is shown;
[0047] Fig.10 A schematic diagram of a process flow of ending video data transmission according to a specific implementation of the present disclosure is shown;
[0048] Fig.11 A block diagram showing a device for processing video data according to an exemplary embodiment of the present disclosure;
[0049] Fig.12 A schematic diagram of the structure of a computer system suitable for implementing the electronic device of the embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0050] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concepts of the example embodiments are fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.
[0051] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0052] In-game recording refers to the process of recording the player's game operation process. This kind of recording file can replay the game operation screen, and has three main uses: first, the recording can be published to the network platform for players to watch; second, the recording can be provided to the game administrator to support anti-cheating, anti-plug-in, feedback processing and other operational work; third, the recording can be provided to developers to reproduce and troubleshoot problems in the game. Therefore, more and more online games have added this function.
[0053] In some relevant embodiments, in-game recording can be performed mainly in two ways. The first way is to record the in-game screen and sound through the software provided by the game client or using third-party screen recording software. The second way is that the server processes the protocol data to form recording data, and then uses the client to replay the recording data to regenerate the game screen and sound to achieve the recording function.
[0054] The main disadvantage of the second method is that as the number of players in a battle increases and the intensity intensifies, the amount of video data will also increase. If this data is processed directly during the battle, it will cause additional overhead to the battle process and extend the server response time. In addition, if the video data is sent to other processes or servers through the network for processing, it will also cause additional network overhead. These additional overheads will affect the performance of the battle process and thus affect the player's battle experience.
[0055] Based on the above problems, this exemplary embodiment first provides a method for processing video data. Figure 1 As shown, the above-mentioned method for processing video data may include the following steps:
[0056] Step S110. During the battle process of the game object, a video data packet corresponding to the game object is obtained through a battle processing process, wherein the video data packet includes protocol data generated by the game object during the battle process.
[0057] Step S120: Transmit the video data packet from the battle processing process to the video processing process via the named pipe.
[0058] Step S130: Process the protocol data in the video data packet through the video processing process to obtain the video playback data corresponding to the game object.
[0059] In the method for processing video data of the example implementation of the present disclosure, a video processing process for processing video data is added to the server where the battle processing process is deployed, and the video data is transmitted between the battle processing process and the video processing process through the named pipe provided by the operating system. The method for processing video data in the example implementation of the present disclosure, on the one hand, processes video data through the video processing process, which can reduce the CPU overhead caused by the processing of video data in the battle processing process, thereby reducing the impact of the video function in the game on the player's gaming experience; on the other hand, the transmission of video data between processes through the named pipe avoids the additional network overhead caused by data transmission, and improves the efficiency and stability of the transmission and processing of video data.
[0060] Next, combine Figures 2 to 7 The above steps of this exemplary embodiment are described in more detail.
[0061] In step S110, during the battle process of the game object, a video data packet corresponding to the game object is obtained through the battle processing process, wherein the video data packet includes protocol data generated by the game object during the battle process.
[0062] In this example implementation, the game object refers to the character object controlled by the player when playing the game, such as a hero. The battle processing process refers to the process used to process battle data and realize game battles in the server for competitive game play after the player logs into the game. When playing the game, the communication data set in an agreed format generated by the interaction between the client and the server is the protocol data, and the video data is the data set used by the client to realize game replay after additional processing of the protocol data generated when playing the game. The video data packet refers to the data set suitable for transmission obtained by dividing the video data according to factors such as size and type.
[0063] In this example implementation, in addition to the protocol data generated during the game, the video data packet may also encapsulate some additional fields, such as identification information, message type, etc., wherein the identification information may include a battle identification and a player identification. The battle identification may be used to distinguish battles, and the player identification may be used to distinguish video data packets corresponding to different players. The message type (message_type) may be defined as 6 types, such as data exception, battle start, battle end, player initialization, player battle settlement, and battle protocol data, which may be distinguished by different fields. For example, each different message type may be specifically represented in the following manner:
[0064] MESSAGE_TYPE_EXCEPTION=0 #Data exception
[0065] MESSAGE_TYPE_BATTLE_START=1 #Battle starts
[0066] MESSAGE_TYPE_SOUL_INIT=2 #Player initialization
[0067] MESSAGE_TYPE_PROTOCOL_DATA=3 #Combat protocol data
[0068] MESSAGE_TYPE_SOUL_SETTLE = 4 # Player battle settlement
[0069] MESSAGE_TYPE_BATTLE_STOP=5 #Battle is over
[0070] In this example implementation, Figure 2 As shown, obtaining the video data packet corresponding to the game object through the battle processing process may specifically include the following steps:
[0071] Step S210. Acquire the protocol data generated by the game object during the battle process, as well as the identification information and message type of the video data packet, through the data transmitter in the battle processing process.
[0072] In this example implementation, the battle processing process may include a data transmitter for sending video data, through which the protocol data generated by the game object during the battle, as well as the identification information and message type of the video data packet, may be obtained, packaged, and then sent out. The identification information may include a battle identification and a player identification.
[0073] Step S220: Obtain the video data packet corresponding to the game object according to the protocol data, identification information and message type.
[0074] After receiving the protocol data generated by the game object during the battle, the data transmitter encapsulates the protocol data, identification information and message type into a video data packet and performs a serialization operation on it.
[0075] like Figure 3 The figure shows a schematic diagram of a unified modeling language for a video data packet according to a specific embodiment of the present disclosure. The video data packet (ReplayMessage) includes an encoder, a battle identifier, a player identifier in the battle, a message type, and protocol data. In addition, it also includes a serialization method when the sender writes and a deserialization method when the receiver reads. Among them, the encoder provides the implementation of data serialization and deserialization.
[0076] In step S120, the video data packet is transmitted from the battle processing process to the video processing process via a named pipe.
[0077] In this example implementation, the video processing process and the battle processing process are deployed on the same server, and the two communicate with each other through named pipes. The video processing process can be used to process the protocol data generated by the player's game operation to complete the game recording process. Named pipes are a data channel provided by the operating system that can be used for inter-process communication. Using named pipes for inter-process communication can avoid additional network overhead caused by data transmission.
[0078] In this example implementation, Figure 4 As shown in the figure, the video data packet is transmitted from the battle processing process to the video processing process through the named pipe, which may include the following steps:
[0079] Step S410. Write the serialized video data packet into the named pipe through the data sending agent corresponding to the data sender in the battle processing process.
[0080] After receiving the protocol data transmitted by the game object in the battle, the data sender encapsulates it into a video data packet, serializes it and sends it to the data sending agent. The data sending agent is a specially optimized sending agent with data buffering and sending data through named pipes. The protocol data is transmitted from the battlefield to the data sender, and finally passed to the video processing process through the data sending agent in the form of a named pipe.
[0081] Step S420: Read the video data packet from the named pipe through the data receiving agent corresponding to the data receiver in the video processing process, and obtain the video data packet from the data receiving agent through the data receiver in the video processing process.
[0082] In the video processing process, the data receiving agent is a specially optimized receiving agent with the functions of reading data from the named pipe, buffering data, and parsing the complete video data packet. The optimized design content may include opening a new thread to read the pipe content, designing an efficient data buffer, etc. The data receiving agent continuously reads and parses the video data packet from the named pipe, and the data receiver periodically pulls the video data packet from the data receiving agent.
[0083] In this example implementation, by writing targeted optimization programs for the data sending agent and the data receiving agent, the sending and receiving speeds can be increased, thereby increasing the video processing speed, and avoiding the situation where the video data processing is not completed after the battle. The purpose of the data sending agent and the data receiving agent is to achieve logical decoupling, and the algorithms used can be replaced according to actual conditions.
[0084] In step S130, the protocol data in the video data packet is processed through the video processing process to obtain the video playback data corresponding to the game object.
[0085] In this example implementation, the video data packet is processed in the video processing process to obtain corresponding video playback data. The video playback data can be downloaded and played by the client, thereby realizing the video playback function of the game.
[0086] In this example implementation, Figure 5 As shown, the protocol data in the video data packet is processed through the video processing process to obtain the video playback data corresponding to the game object, which may specifically include the following steps:
[0087] Step S510: Deserialize the video data packet through the data receiver in the video processing process, obtain the message type in the video data packet, and execute the corresponding processing flow according to the message type.
[0088] After the data receiver pulls the video data packet from the data receiving agent, it first deserializes the received video data packet to obtain the protocol data, identification information and message type in the video data packet.
[0089] In this example implementation, Figure 6 As shown, by obtaining the message type message_type in the video data packet, different operations are performed on the video data packet according to the value of message_type. When message_type=1, the message type is the start of a battle, which indicates the start of a new battle. The data receiver executes step S610 to initialize the video data packet decoder and record the battle information log; when message_type=2, it is the first time for a player to join the battle. At this time, the message type is player initialization. The data receiver executes step S620 to create an independent playback data processor for the player corresponding to the current player identifier; when message_type=3, the message type is battle protocol data, the data receiver executes step S630 to add protocol data to the playback data processor of the current player, and perform video format encoding through the playback data processor; when message_type=4, the message type is player battle settlement, the data receiver executes step S640 to save and upload the video file through the playback data processor of the current player; when message_type=5, the message type is the end of the battle, the data receiver executes step S650 to save and upload the video files of the remaining players and stop recording.
[0090] Step S520: Obtain identification information in the video data packet, classify the video data packet according to the identification information, and then send the video data packet to the data processor in the video processing process.
[0091] The identification information in the video data packet is obtained. Specifically, the player identification information can be obtained, and the video data packet is classified according to the classification, and then the video data packet is sent to the data processor in the video processing process.
[0092] Step S530: The protocol data in the video data packet is encoded in a video format by the data processor in the video processing process to obtain video playback data corresponding to the game object.
[0093] The data processor encodes the protocol data in the received video data packet in a video format to obtain the video playback data corresponding to the game object. For example, the encoding is in base64 format. In this example implementation, the video file encoding format can be set according to the actual needs of the project.
[0094] In addition, the method for processing video data in this exemplary embodiment may also include an initialization process at the beginning of a battle and a processing process after the battle ends.
[0095] In this example implementation, Figure 7 As shown, the initialization process at the beginning of the battle may specifically include the following steps:
[0096] Step S710: When the game object battle starts, determine the data transmission parameters between the battle processing process and the video processing process.
[0097] When the game object battle begins, the battle processing process and the video processing process can negotiate the video data transmission parameters, including the video data packet size, sending speed, processing speed, etc., through RPC (Remote Procedure Call) communication, and establish a named pipe based on this.
[0098] Step S720. Initialize the data transmitter in the battle processing process, and the data receiver and data processor in the video processing process.
[0099] In addition to negotiating the video data transmission parameters, it is also necessary to initialize the data transmitter and its agent in the battle processing process, the data receiver and its agent in the video processing process, and the data processor in the video processing process.
[0100] In this example implementation, when the battle of the game objects ends, the video playback data may be compressed and stored by the data processor in the video processing process.
[0101] The data processor in the video processing process can compress the acquired video playback data to save storage space. Secondly, the compressed video playback data can also be uploaded to a third-party cloud server to ensure data security and facilitate downloading and viewing. The video playback data can be uploaded to a file server, or stored in a database, local file system, etc., which is not specifically limited in this example implementation.
[0102] After the video playback data is compressed and stored by the data processor in the video processing process, the data transmitter in the battle processing process, the data receiver and the data processor in the video processing process, as well as the data sending agent corresponding to the data transmitter and the data receiving agent corresponding to the data receiver are closed.
[0103] After the battle is over, the battle processing process can notify the video processing process to stop recording through RPC communication. After receiving the notification to stop recording, the video processing process completes the processing of the buffered data in the data receiving agent, and notifies the data processor to compress the data and upload it to the file server. Then, the data transmitter in the battle processing process, the data receiver and data processor in the video processing process, and the data sending agent corresponding to the data transmitter and the data receiving agent corresponding to the data receiver are closed. At this point, a complete recording is completed. The video playback data can be downloaded and played by the client, which realizes the recording function.
[0104] In this example implementation, RPC communication is performed between the battle processing process and the video processing process only at the beginning and end of a battle. The RPC communication between the two, on the one hand, is used to negotiate the timing of starting and closing the video data transmission. Through this negotiation, it is ensured that the named pipe is only opened when a battle is in progress and closed after the battle. In this way, the applied system resources are released in time, which improves the security of the system; on the other hand, the size and speed of the data packet used to negotiate the video data transmission makes it possible to reasonably configure the data transmission mechanism according to the use requirements and system limitations, which improves the maintainability of the system. Other reliable communication methods can also be used for RPC communication at the beginning and end of a battle, which is not specifically limited in this example implementation.
[0105] like Figure 8 The figure is a schematic diagram of the process of initializing video data transmission in a specific implementation manner of the present disclosure.
[0106] When the game object battle starts, the data sender and its agent in the battle processing process are initialized, and then the video processing process is notified to prepare for recording through RPC communication, and the video data transmission parameters are negotiated, including the video data packet size, sending speed, processing speed, etc., and a named pipe is established between the battle processing process and the video processing process. At the same time, the data receiver and its agent in the video processing process, as well as the data processor in the video processing process, are initialized. After the initialization is completed, the video recording starts.
[0107] like Fig. 9 The figure is a schematic diagram of the process of video data transmission in a specific implementation manner of the present disclosure.
[0108] In the battle processing process, after the data transmitter receives the protocol data generated by the game object during the battle, it encapsulates the protocol data, identification information and message type into a video data packet, serializes it, and then sends it to the data sending agent, which is passed to the video processing process in the form of a named pipe through the data sending agent. In the video processing process, the data receiving agent continuously reads and parses the video data packet from the named pipe, and the data receiver regularly pulls the video data packet from the data receiving agent, deserializes the received video data packet, and then executes the corresponding processing flow according to the message type. Finally, the processed video data packet is sent to the data processor, and the data processor encodes the protocol data in the received video data packet in the video format to obtain the video playback data corresponding to the game object.
[0109] like Fig.10 The figure is a flow chart of the end of video data transmission in a specific implementation manner of the present disclosure.
[0110] When the game object battle ends, the battle processing process notifies the video processing process to stop recording through RPC communication. After receiving the notification to stop recording, the video processing process completes the processing of the buffered data in the data receiving agent, notifies the data processor to compress the data and upload it to the file server, and then closes the data transmitter in the battle processing process, the data receiver and data processor in the video processing process, and the data sending agent corresponding to the data transmitter and the data receiving agent corresponding to the data receiver. At this point, a complete recording ends.
[0111] It should be noted that although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0112] Furthermore, the present disclosure also provides a device for processing video data. Fig.11 As shown, the video data processing device may include a video data acquisition module 1110, a video data transmission module 1120, and a video data processing module 1130. Among them:
[0113] The video data acquisition module 1110 may be used to acquire a video data packet corresponding to the game object through a battle processing process during the battle process of the game object, wherein the video data packet includes protocol data generated by the game object during the battle process;
[0114] The video data transmission module 1120 can be used to transmit the video data packet from the battle processing process to the video processing process through a named pipe;
[0115] The video data processing module 1130 can be used to process the protocol data in the video data packet through a video processing process to obtain video playback data corresponding to the game object.
[0116] In some exemplary embodiments of the present disclosure, a video data processing device provided by the present disclosure may further include an initialization module, which may include a transmission parameter determination unit and a process initialization unit.
[0117] The transmission parameter determination unit may be used to determine the data transmission parameters between the battle processing process and the video processing process when the game object battle begins;
[0118] The process initialization unit can be used to initialize the data transmitter in the combat processing process, as well as the data receiver and data processor in the video processing process.
[0119] In some exemplary embodiments of the present disclosure, the video data acquisition module 1110 may include a protocol data acquisition unit and a protocol data packaging unit.
[0120] The protocol data acquisition unit can be used to acquire the protocol data generated by the game object during the battle process, as well as the identification information and message type of the video data packet through the data transmitter in the battle processing process;
[0121] The protocol data packaging unit can be used to obtain the video data packet corresponding to the game object according to the protocol data, identification information and message type.
[0122] In some exemplary embodiments of the present disclosure, the video data transmission module 1120 may include a data sending unit and a data receiving unit.
[0123] The data sending unit can be used to write the serialized video data packet into the named pipe through the data sending agent corresponding to the data sender in the battle processing process;
[0124] The data receiving unit can be used to read the video data packet from the named pipe through the data receiving agent corresponding to the data receiver in the video processing process, and obtain the video data packet from the data receiving agent through the data receiver in the video processing process.
[0125] In some exemplary embodiments of the present disclosure, the video data processing module 1130 may include a message type processing unit, a video data classification unit, and a video format encoding unit.
[0126] The message type processing unit can be used to deserialize the video data packet through the data receiver in the video processing process, obtain the message type in the video data packet, and execute the corresponding processing flow according to the message type;
[0127] The video data classification unit can be used to obtain identification information in the video data packet, and after classifying the video data packet according to the identification information, send the video data packet to the data processor in the video processing process;
[0128] The video format encoding unit can be used to perform video format encoding on the protocol data in the video data packet through the data processor in the video processing process to obtain the video playback data corresponding to the game object.
[0129] In some exemplary embodiments of the present disclosure, a video data processing device provided by the present disclosure may also include a compression storage module, which can be used to compress and store the video playback data through a data processor in the video processing process when the game object battle ends.
[0130] In some exemplary embodiments of the present disclosure, a video data processing device provided by the present disclosure may also include a process closing module, which can be used to close the data transmitter in the battle processing process, the data receiver and the data processor in the video processing process, and the data sending agent corresponding to the data transmitter and the data receiving agent corresponding to the data receiver.
[0131] The specific details of each module / unit in the above-mentioned video data processing device have been described in detail in the corresponding method embodiment part, and will not be repeated here.
[0132] Fig.12 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present invention is shown.
[0133] It should be noted that Fig.12The computer system 1200 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0134] like Fig.12 As shown, the computer system 1200 includes a central processing unit (CPU) 1201, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1202 or a program loaded from a storage part 1208 into a random access memory (RAM) 1203. Various programs and data required for system operation are also stored in the RAM 1203. The CPU 1201, the ROM 1202, and the RAM 1203 are connected to each other via a bus 1204. An input / output (I / O) interface 1205 is also connected to the bus 1204.
[0135] The following components are connected to the I / O interface 1205: an input section 1206 including a keyboard, a mouse, etc.; an output section 1207 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1208 including a hard disk, etc.; and a communication section 1209 including a network interface card such as a LAN card, a modem, etc. The communication section 1209 performs communication processing via a network such as the Internet. A drive 1210 is also connected to the I / O interface 1205 as needed. A removable medium 1211, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1210 as needed, so that a computer program read therefrom is installed into the storage section 1208 as needed.
[0136] In particular, according to an embodiment of the present invention, the process described below with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present invention includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 1209, and / or installed from a removable medium 1211. When the computer program is executed by a central processing unit (CPU) 1201, various functions defined in the system of the present application are executed.
[0137] It should be noted that the computer-readable medium shown in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0138] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0139] As another aspect, the present application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by an electronic device, the electronic device implements the method described in the following embodiment.
[0140] It should be noted that, although several modules of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules described above can be concretized in one module. Conversely, the features and functions of one module described above can be further divided into multiple modules to be concretized.
[0141] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any modifications, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure.
[0142] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A method for processing video data, It is characterized in that include: During a battle of a game object, a video data packet corresponding to the game object is obtained through a battle processing process, wherein the video data packet includes protocol data generated by the game object during the battle; The video data packet is transmitted from the battle processing process to the video processing process through a named pipe, including: writing the serialized video data packet into the named pipe through a data sending agent corresponding to a data sender in the battle processing process; reading the video data packet from the named pipe through a data receiving agent corresponding to a data receiver in the video processing process, and obtaining the video data packet from the data receiving agent through the data receiver in the video processing process; The protocol data in the video data packet is processed through the video processing process to obtain the video playback data corresponding to the game object.
2. The method for processing video data according to claim 1, It is characterized in that Before obtaining the video data packet corresponding to the game object through the battle processing process, the method further includes: When the game object battle starts, determining the data transmission parameters between the battle processing process and the video processing process; Initialize the data transmitter in the battle processing process, and the data receiver and data processor in the video processing process.
3. The method for processing video data according to claim 1, It is characterized in that The step of obtaining the video data packet corresponding to the game object through the battle processing process includes: Acquire the protocol data generated by the game object during the battle process, as well as the identification information and message type of the video data packet, through the data transmitter in the battle processing process; The video data packet corresponding to the game object is obtained according to the protocol data, the identification information and the message type.
4. The method for processing video data according to claim 1, It is characterized in that The processing of the protocol data in the video data packet by the video processing process to obtain the video playback data corresponding to the game object includes: Deserialize the video data packet through the data receiver in the video processing process, obtain the message type in the video data packet, and execute a corresponding processing flow according to the message type; Acquiring identification information in the video data packet, classifying the video data packet according to the identification information, and sending the video data packet to the data processor in the video processing process; The protocol data in the video data packet is encoded in a video format by a data processor in the video processing process to obtain video playback data corresponding to the game object.
5. The method for processing video data according to claim 1, It is characterized in that The method further comprises: When the battle of the game objects ends, the video playback data is compressed and stored by the data processor in the video processing process.
6. The method for processing video data according to claim 5, It is characterized in that After the data processor in the video processing process compresses and stores the video playback data, the method further includes: Close the data transmitter in the battle processing process, the data receiver and the data processor in the video processing process, and the data sending agent corresponding to the data transmitter and the data receiving agent corresponding to the data receiver.
7. A video data processing device, It is characterized in that include: A video data acquisition module, used to acquire a video data packet corresponding to the game object through a battle processing process during the battle of the game object, wherein the video data packet includes protocol data generated by the game object during the battle; The video data transmission module is used to transmit the video data packet from the battle processing process to the video processing process through a named pipe, including: writing the serialized video data packet into the named pipe through a data sending agent corresponding to a data sender in the battle processing process; reading the video data packet from the named pipe through a data receiving agent corresponding to a data receiver in the video processing process, and obtaining the video data packet from the data receiving agent through a data receiver in the video processing process; The video data processing module is used to process the protocol data in the video data packet through the video processing process to obtain the video playback data corresponding to the game object.
8. An electronic device, It is characterized in that include: processor; as well as The memory is used to store one or more programs. When the one or more programs are executed by the processor, the processor implements the method for processing video data as described in any one of claims 1 to 6.
9. A computer readable medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the method for processing video data according to any one of claims 1 to 6 is implemented.
