CN116805974A - Media asset data distribution method and device, storage medium and electronic equipment - Google Patents

Media asset data distribution method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN116805974A
CN116805974A CN202310999075.4A CN202310999075A CN116805974A CN 116805974 A CN116805974 A CN 116805974A CN 202310999075 A CN202310999075 A CN 202310999075A CN 116805974 A CN116805974 A CN 116805974A
Authority
CN
China
Prior art keywords
media
template
data
channel side
channel
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310999075.4A
Other languages
Chinese (zh)
Inventor
刘欢春
余家奇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hunan MgtvCom Interactive Entertainment Media Co Ltd
Original Assignee
Hunan MgtvCom Interactive Entertainment Media Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hunan MgtvCom Interactive Entertainment Media Co Ltd filed Critical Hunan MgtvCom Interactive Entertainment Media Co Ltd
Priority to CN202310999075.4A priority Critical patent/CN116805974A/en
Publication of CN116805974A publication Critical patent/CN116805974A/en
Pending legal-status Critical Current

Links

Landscapes

  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The invention provides a media data distribution method and device, a storage medium and electronic equipment, wherein the method comprises the following steps: when receiving a media resource request sent by a channel side, judging whether the channel side accords with distribution conditions; if the condition is met, analyzing the media resource request to obtain a video resource identifier; determining a media asset data set corresponding to the video resource identifier; determining a target template; the target template is a template configured based on the interface specification standard of the channel side; filling the media resource data set into a target template, and taking the filled target template as interface response content; and exporting the interface response content into an interface response file and sending the interface response file to the channel side. By applying the method of the invention, the interface response content is obtained by filling the data into the template, and then the media data distribution is realized. When the channel side or the interface specification of the newly added cooperation changes, the corresponding template is configured, the interface development work is not required to be repeated, the workload can be reduced, and the efficiency is improved.

Description

Media asset data distribution method and device, storage medium and electronic equipment
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and apparatus for distributing media data, a storage medium, and an electronic device.
Background
In the operation scene of the video website, in order to obtain more popularization and display and user playing quantity, the video website platform is usually required to be promoted in cooperation with external channel parties such as various search engines and video aggregation websites, and video content of the platform is put on the platform of each channel party for playing, so that the platform is required to distribute media data such as video playing links, posters and titles to the channel parties according to requirements.
At present, the distribution of media data is usually realized based on interface development, namely, an interface program for resource distribution is developed based on interface specification standards provided by a channel side, the developed interface is online, and the needed media data is sent to the channel side through the interface.
The video website platform generally needs to be in butt joint with a large number of channel parties, each channel party has own interface standard, and the interface standard of each channel party is different from each other. Based on the existing media data distribution method, a set of media distribution interfaces need to be developed for each channel side. When the standard of the newly added channel or the channel side interface specification changes, the interface development process needs to be carried out again, the workload is large, the process is complex, and the efficiency of realizing channel access is low.
Disclosure of Invention
In view of the above, the embodiment of the invention provides a media data distribution method to solve the problems of frequent interface development work, large workload, complicated process and low efficiency based on the existing media data distribution method.
The embodiment of the invention also provides a media data distribution device which is used for guaranteeing the practical implementation and application of the method.
In order to achieve the above object, the embodiment of the present invention provides the following technical solutions:
a media asset data distribution method comprising:
when receiving a media resource request sent by a channel side, judging whether the channel side accords with preset distribution conditions;
if the channel side accords with the distribution condition, analyzing the media resource request to obtain a video resource identifier corresponding to the media resource request;
data screening is carried out in the created media asset data list, and a media asset data set corresponding to the video resource identifier is obtained; the media asset data collection comprises at least one group of media asset data; the media data list comprises all stored media data;
determining a target template corresponding to the channel side; the target template is a template which is pre-configured based on the interface specification standard corresponding to the channel side;
Filling each group of media data in the media data set into the target template, and taking the target template with the data filling processing completed as interface response content;
performing file export processing on the interface response content to obtain an interface response file corresponding to the interface response content;
and sending the interface response file to the channel side to complete the media resource data distribution process.
In the above method, optionally, the determining whether the channel side meets a preset distribution condition includes:
determining channel identifiers corresponding to the channel parties;
judging whether a template matched with the channel identifier exists in a preset template library or not; the template library comprises a plurality of preset templates;
if the template library has the template matched with the channel identifier, taking the template matched with the channel identifier in the template library as a candidate template;
judging whether the candidate template is in an effective state or not;
and if the candidate template is in an effective state, determining that the channel side meets the distribution condition.
The method, optionally, further comprises:
and if the candidate template is not in an effective state, determining that the channel side does not accord with the distribution condition.
In the above method, optionally, the determining the target template corresponding to the channel side includes:
and taking the candidate template as the target template.
In the above method, optionally, the performing data filtering in the created media asset data list to obtain a media asset data set corresponding to the video resource identifier includes:
determining a resource identification type corresponding to the video resource identification;
if the resource identification type represents the identification of the video resource identification as a single video, acquiring media resource data corresponding to the video resource identification from the media resource data list, and forming the media resource data set by the media resource data corresponding to the video resource identification;
if the resource identification type represents the video resource identification as the identification of the video aggregation set, determining each target video identification corresponding to the video resource identification;
and acquiring the media data corresponding to each target video identifier from the media data list, and forming the media data set by the media data corresponding to each target video identifier.
In the above method, optionally, the performing a file export process on the interface response content to obtain an interface response file corresponding to the interface response content includes:
Determining the type of the interface file corresponding to the channel side;
and generating a file corresponding to the interface file type based on the interface response content, and taking the file as the interface response file.
The method, optionally, further comprises:
and if the channel side does not meet the distribution condition, rejecting the media resource request.
A media asset data distribution device comprising:
the judging unit is used for judging whether the channel side accords with preset distribution conditions or not when receiving a media resource request sent by the channel side;
the analysis unit is used for analyzing the media resource request if the channel side accords with the distribution condition, and obtaining a video resource identifier corresponding to the media resource request;
the screening unit is used for carrying out data screening in the created media resource data list to obtain a media resource data set corresponding to the video resource identifier; the media asset data collection comprises at least one group of media asset data; the media data list comprises all stored media data;
a determining unit, configured to determine a target template corresponding to the channel side; the target template is a template which is pre-configured based on the interface specification standard corresponding to the channel side;
The filling unit is used for filling each group of media data in the media data set into the target template, and taking the target template after finishing data filling processing as interface response content;
the export unit is used for conducting file export processing on the interface response content to obtain an interface response file corresponding to the interface response content;
and the sending unit is used for sending the interface response file to the channel side to complete the media data distribution process.
A storage medium comprising stored instructions that, when executed, control a device on which the storage medium resides to perform a media data distribution method as described above.
An electronic device comprising a memory, and one or more instructions, wherein the one or more instructions are stored in the memory and configured to be executed by one or more processors as a media data distribution method as described above.
Based on the above method for distributing media data provided by the embodiment of the invention, the method comprises the following steps: when receiving a media resource request sent by a channel side, judging whether the channel side accords with preset distribution conditions; if the channel side accords with the distribution condition, analyzing the media resource request to obtain a video resource identifier corresponding to the media resource request; data screening is carried out in the created media asset data list to obtain a media asset data set corresponding to the video resource identifier, wherein the media asset data set comprises at least one group of media asset data; the media data list comprises all stored media data; determining a target template corresponding to a channel side; the target template is a template pre-configured based on interface specification standards corresponding to the channel side; filling each group of media data in the media data set into a target template, and taking the target template after finishing data filling processing as interface response content; performing file export processing on interface response content to obtain an interface response file corresponding to the interface response content; and sending the interface response file to the channel side to complete the media resource data distribution process. When the method provided by the embodiment of the invention is applied, when media data is required to be distributed to a channel side, the media data to be distributed is filled into the template configured based on the interface standard of the channel side, so that interface response content can be obtained, after the file is exported, the corresponding file is sent to the channel, so that the data distribution can be realized conveniently, and the interface response about the media data distribution is completed. The data filling template is configured based on the interface standard of the channel side, so that the channel side can identify the media data in the file after obtaining the file, and then can acquire the resource. When a new channel is added on the service, the channel access can be realized only by configuring a template based on the interface specification standard of the new channel. When the interface standard of the channel side changes, only the corresponding template is required to be modified. In the process of realizing media resource data distribution, the interface development work is not required to be repeated, the workload is small, the implementation process is simple and convenient, and the efficiency of realizing channel access can be improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present invention, and that other drawings can be obtained according to the provided drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method for distributing media data according to an embodiment of the present invention;
FIG. 2 is a flowchart of another method for distributing media data according to an embodiment of the present invention;
FIG. 3 is an exemplary diagram of a template configuration interface provided by an embodiment of the present invention;
FIG. 4 is an exemplary diagram of a media data distribution process provided by an embodiment of the present invention;
FIG. 5 is a schematic diagram of a media data distribution device according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In the present disclosure, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
As known from the background art, the existing media data distribution process is implemented by an interface program. Specifically, after the business is cooperated with the channel side, the interface standard document of the channel side is obtained, the development department performs development scheduling, and a set of interface for the channel side is developed according to the interface standard document, and the channel side obtains media data by calling the interface. Different channels usually adopt different interface standards, so when channels are newly added, interfaces need to be redeveloped, and when the interface standards of the existing channels change, interface programs need to be modified. Development and change of the interface program all need development departments to carry out development scheduling, the development and test work is completed, the workload is large, the process is tedious, the time consumption is long, the channel access efficiency is low, and a plurality of inconveniences are brought to media data distribution work.
Therefore, the embodiment of the invention provides a media data distribution method, which fills media data into a preset template to obtain interface response content and realize the distribution of the media data. When the newly added channel or channel interface standard changes, only the template is required to be configured, interface development work is not required, the workload is small, the implementation is simple and convenient, and the channel access realization efficiency is improved.
The embodiment of the invention provides a media data distribution method, which can be applied to a data distribution system of media data of a video website, wherein an execution subject of the method can be a processor of the system, and a flow chart of the method is shown in fig. 1 and comprises the following steps:
s101: when receiving a media resource request sent by a channel side, judging whether the channel side accords with preset distribution conditions;
in the method provided by the embodiment of the invention, the distribution condition is preset in the system, namely, the condition which needs to be met for distributing the media data to the system in response to the request of the channel side, the specific condition content can be set according to the actual requirement, for example, the request of the channel side needs to be compliant, the channel side needs to be the channel side with the cooperative relationship at present, and the available template corresponding to the channel side is currently configured in the system.
When the processor of the system receives the media resource request sent by the channel side, judging whether the channel side accords with the preset distribution condition according to the related information.
S102: if the channel side accords with the distribution condition, analyzing the media resource request to obtain a video resource identifier corresponding to the media resource request;
in the method provided by the embodiment of the invention, if the current channel side is judged to be in accordance with the preset distribution condition, the request parameter is analyzed for the media resource request, and the video resource identifier carried in the request is obtained. The video resource identifier is an identifier for representing the video resource, namely media resource data of the video resource requested by the current channel.
In a specific application scenario, the video resource identifier may be an identifier for characterizing a certain video, or may be an identifier for characterizing a certain video aggregate, or may be multiple or only one video resource identifier carried in the media resource request, if multiple video resource identifiers are carried in the media resource request, processing in subsequent steps S103 and S105 is performed for each video resource identifier, and then media resource data sets corresponding to all video resource identifiers are filled into the target template. It should be noted that, the type of video resource represented by the video resource identifier in the media resource request, the number of video resource identifiers, etc. do not affect the implementation function of the method provided by the embodiment of the invention.
S103: data screening is carried out in the created media asset data list, and a media asset data set corresponding to the video resource identifier is obtained; the media asset data collection comprises at least one group of media asset data; the media data list comprises all stored media data;
in the method provided by the embodiment of the invention, a media asset data list is pre-created in the system, wherein all media asset data stored in the system are recorded. And all of the stored asset data is asset data for all of the video assets available in the video database of the video website. The media asset data list may be stored in a cache, and the media asset data in the media asset data list is updated in real time according to the data in the video database through a Message Queue (MQ).
In the media resource data distribution process, data screening can be performed in a media resource data list according to a video resource identifier corresponding to a media resource request, media resource data matched with the video resource identifier is acquired from media resource data recorded in the media resource data list, and the acquired media resource data form a media resource data set.
S104: determining a target template corresponding to the channel side; the target template is a template which is pre-configured based on the interface specification standard corresponding to the channel side;
In the method provided by the embodiment of the invention, the templates corresponding to each cooperation channel are configured in advance according to the interface specification standard of each cooperation channel, and the field labels conforming to the corresponding interface specification standard are defined in the content of the templates. In the system, each collaborative channel can be represented by a channel identifier, and a template corresponding to each collaborative channel can be associated with the channel identifier of the corresponding collaborative channel.
In the media data distribution process, a template configured based on an interface specification standard corresponding to a channel side can be found according to the channel identifier corresponding to the current channel side, and the template is used as a target template.
S105: filling each group of media data in the media data set into the target template, and taking the target template with the data filling processing completed as interface response content;
according to the method provided by the embodiment of the invention, each group of media data in the media data set is filled into the corresponding position in the target template according to the corresponding relation between the data attribute in the media data and the field label in the template. And after the data filling operation is completed, taking the target template subjected to the data filling processing as interface response content.
S106: performing file export processing on the interface response content to obtain an interface response file corresponding to the interface response content;
In the method provided by the embodiment of the invention, the interface response content is taken as the file content, the file with the specified format is exported, and the file is taken as the interface response file.
S107: and sending the interface response file to the channel side to complete the media resource data distribution process.
In the method provided by the embodiment of the invention, the interface response file is sent to the appointed address, so that the interface response file is sent to the channel side, and the current media resource data distribution process corresponding to the media resource request is completed. After receiving the interface response file, the channel side can acquire media data from the interface response file.
Based on the method provided by the embodiment of the invention, when a media resource request is received, whether the corresponding channel side accords with a preset distribution condition is judged; if the condition is met, analyzing the media resource request to obtain a video resource identifier; data screening is carried out in the created media asset data list to obtain a media asset data set corresponding to the video resource identifier, wherein the media asset data set comprises at least one group of media asset data; the media data list comprises all stored media data; determining a target template corresponding to a channel side; the target template is a template pre-configured based on interface specification standards corresponding to the channel side; filling each group of media data in the media data set into a target template, and taking the target template after finishing data filling processing as interface response content; performing file export processing on interface response content to obtain an interface response file; and sending the interface response file to the channel side. When the method provided by the embodiment of the invention is applied, when media data is required to be distributed to a channel side, the media data to be distributed is filled into the template configured based on the interface standard of the channel side, so that interface response content can be obtained, after the file is exported, the corresponding file is sent to the channel, so that the data distribution can be realized conveniently, and the interface response about the media data distribution is completed. The data filling template is configured based on the interface standard of the channel side, so that the channel side can identify the media data in the file after obtaining the file, and then can acquire the resource. When a new channel is added on the service, the channel access can be realized only by configuring a template based on the interface specification standard of the new channel. When the interface standard of the channel side changes, only the corresponding template is required to be modified. In the process of realizing media resource data distribution, the interface development work is not required to be repeated, the workload is small, the implementation process is simple and convenient, and the efficiency of realizing channel access can be improved.
On the basis of the method shown in fig. 1, referring to the flowchart shown in fig. 2, the process for determining whether the channel side meets the preset distribution condition in step S101 includes:
s201: determining channel identifiers corresponding to the channel parties;
in the method provided by the embodiment of the invention, the media resource request can be analyzed, the channel identifier carried in the media resource request can be obtained, and the channel identifier is used as the channel identifier corresponding to the current channel side.
S202: judging whether a template matched with the channel identifier exists in a preset template library or not; the template library comprises a plurality of preset templates;
in the method provided by the embodiment of the invention, the front end interface of template configuration is provided, a worker can set the templates corresponding to each cooperation channel through the front end interface in advance, and each preset template can be stored in the template library. Meanwhile, staff can also configure information such as the effective state of the templates, associated channel identifiers and the like through the front end interface, and the configuration information of each template can also be correspondingly stored.
In the process of judging whether the current channel side accords with the distribution condition, comparing the channel identification of the channel side with the channel identification associated with each template in the template library so as to identify whether the template library has a template matched with the channel identification of the channel side. If the channel identifier of the channel side is the same as the channel identifier associated with a certain template in the template library, the template library is considered to have the template matched with the channel identifier of the channel side, and if the channel identifier of the channel side is different from the channel identifier associated with each template, the template library is considered to have no template matched with the channel identifier of the channel side.
S203: if the template library has the template matched with the channel identifier, taking the template matched with the channel identifier in the template library as a candidate template;
in the method provided by the embodiment of the invention, if the template matched with the channel identification of the channel side exists in the template library through judgment, the matched template is used as a candidate template.
If the template matched with the channel identification of the channel party does not exist in the template library, determining that the channel party does not accord with the preset distribution condition.
S204: judging whether the candidate template is in an effective state or not;
in the method provided by the embodiment of the invention, the staff can configure the effective state of the template, namely, whether the template is effective or not is set. And inquiring whether the candidate template is in an effective state or not in the configuration information, namely inquiring whether the candidate template is effective currently or not.
S205: and if the candidate template is in an effective state, determining that the channel side meets the distribution condition.
In the method provided by the embodiment of the invention, if the candidate template is in the effective state currently, the channel side is determined to accord with the preset distribution condition.
Based on the method provided by the embodiment of the invention, whether the preset template exists or not and whether the template takes effect or not is taken as judgment content of the distribution condition, the data acquisition authority of the channel can be flexibly controlled, and after the cooperation with the channel is finished, the template is set to be in a failure state, so that the distribution of media data to the corresponding channel can be stopped, and the operation is convenient and quick.
On the basis of the method provided by the embodiment, the method provided by the embodiment of the invention further comprises the following steps:
and if the candidate template is not in an effective state, determining that the channel side does not accord with the distribution condition.
In the method provided by the embodiment of the present invention, if the candidate template is not in the effective state after being determined in the determining process of step S204, it is determined that the channel side does not meet the preset distribution condition.
On the basis of the method provided by the above embodiment, in the method provided by the embodiment of the present invention, the process for determining the target template corresponding to the channel side mentioned in step S104 includes:
and taking the candidate template as the target template.
In the method provided by the embodiment of the invention, the template matched with the channel identification of the channel side in the template library is used as the target template.
Based on the method shown in fig. 1, in the method provided by the embodiment of the present invention, the process of performing data screening on the created media asset data list mentioned in step S103 to obtain the media asset data set corresponding to the video resource identifier includes:
determining a resource identification type corresponding to the video resource identification;
in the method provided by the embodiment of the invention, the type identification can be carried out on the video resource identifier to obtain the type of the resource identifier corresponding to the video resource identifier, and the type of the resource identifier can be understood as an identifier attribute, namely, an identifier which characterizes the video resource identifier. For example, the video asset identifier may be a video ID or a video collection ID, and the corresponding asset identifier type characterizes the video asset identifier as an identifier of a single video or an identifier of a video collection.
If the resource identification type represents the identification of the video resource identification as a single video, acquiring media resource data corresponding to the video resource identification from the media resource data list, and forming the media resource data set by the media resource data corresponding to the video resource identification;
in the method provided by the embodiment of the invention, if the video resource identifier is an identifier of a single video, comparing the video identifier corresponding to each piece of media resource data in the media resource data list with the video resource identifier, and taking the media resource data corresponding to the video identifier which is the same as the video resource identifier as the media resource data corresponding to the video resource identifier, acquiring the media resource data, and forming a media resource data set.
If the resource identification type represents the video resource identification as the identification of the video aggregation set, determining each target video identification corresponding to the video resource identification;
in the method provided by the embodiment of the invention, if the video resource identifier is an identifier of a video collection, namely, the video resource identifier represents one video collection, then each target video identifier corresponding to the video resource identifier is determined, and each target video identifier is the video identifier of each video in the video collection represented by the video resource identifier. For example, the video resource identifier is the first season of the program a, and then the video identifier of the program video of each period in the first season of the program a is the target video identifier.
And acquiring the media data corresponding to each target video identifier from the media data list, and forming the media data set by the media data corresponding to each target video identifier.
In the method provided by the embodiment of the invention, based on the matching of the video identifications, the media asset data corresponding to each target video identification is obtained from the media asset data list, and the obtained media asset data form a media asset data set.
Based on the method provided by the embodiment of the invention, the media data distribution of a single video can be realized, and the media data distribution of a video aggregate can be realized, thereby being beneficial to meeting various data distribution requirements.
On the basis of the method shown in fig. 1, in the method provided by the embodiment of the present invention, a process of obtaining an interface response file corresponding to the interface response content by performing file export processing on the interface response content mentioned in step S106 includes:
determining the type of the interface file corresponding to the channel side;
in the method provided by the embodiment of the invention, the staff can pre-configure the interface file type corresponding to each cooperation channel, the interface file type corresponding to each cooperation channel can also be set based on the interface specification standard of the cooperation channel, and the interface file type corresponding to each cooperation channel and the template corresponding to the cooperation channel are stored in an associated way.
In the media resource data distribution process, the interface file type associated with the target template can be queried in the configuration information, and the interface file type is the interface file type corresponding to the channel side. The interface file type corresponding to the channel side specifically refers to a file format specified by the channel side receiving interface response data, such as xml files, json files, and the like.
And generating a file corresponding to the interface file type based on the interface response content, and taking the file as the interface response file.
In the method provided by the embodiment of the invention, the interface response content is generated into the file corresponding to the interface file type, so as to obtain the interface response file. For example, if the interface file type is an xml file, an xml format file whose file content is the same as the interface response content is exported.
On the basis of the method shown in fig. 1, the method provided by the embodiment of the invention further includes:
and if the channel side does not meet the distribution condition, rejecting the media resource request.
In the method provided by the embodiment of the invention, if the current channel side is judged to be not in accordance with the preset distribution condition in the judgment process of the step S101, the current media resource request is refused, namely the response is not needed, and the media resource data distribution process is not executed.
In order to better explain the method provided by the embodiment of the present invention, on the basis of the method provided by the foregoing embodiment, in combination with an actual application scenario, the embodiment of the present invention provides another media data distribution method. The method provided by the embodiment of the invention is applied to a media data distribution system of a video website, the back end of the system is developed by using a SpringBoot frame and a freemaker, and the front end of the system is developed by using a Layu.
In the method provided by the embodiment of the invention, the system can realize channel management, namely, through developing a front-end interface, staff can configure the template and related information corresponding to each cooperation channel through the front end. When a new cooperative channel is added, that is, a channel party needing to distribute media data is newly added, the staff can add the channel information of the channel party in the system. Specifically, the staff can input information such as the name of the channel, the code of the channel (equivalent to the channel identifier in the previous embodiment), whether the channel is valid, the type of the channel, etc. through the function of channel management, so as to increase the channel of data distribution or modify the information of the channel side. The canalisation code may be provided to the canalisation party for interface invocation. When the cooperation with the channel side is finished, the attribute value of the attribute of whether the channel information is valid or not can be directly modified into NO, so that the channel can be forbidden, and the corresponding channel side is prevented from continuously pulling media data.
In the method provided by the embodiment of the invention, the system can realize channel template management, namely, for the established channels in the system, staff can configure and manage information such as template content and the like corresponding to the channels through the front end, and the information comprises attribute parameters such as whether the template is effective, file type and the like. The template configuration interface may be shown in fig. 3, where the template configuration interface includes attributes such as a channel, whether valid, template type, version number, full file name, incremental file name, generated data type, file type, template content, and sub-template content. The interface shown in fig. 3 is an interface for modifying template information corresponding to a channel side with a channel name of "XX channel", wherein the template of the channel side is in an effective state, the template type is a default template, the version number is 9, the generated data type comprises a full quantity and an increment, the file name of the generated full quantity file is "all", the file name of the generated increment file is "add", the file type of the interface file corresponding to the channel side is a json file, and in addition, the interface also comprises template content and sub-template content. It should be noted that, the interface shown in fig. 3 and the data therein are only provided to better illustrate the specific embodiment provided by the method provided by the present invention, and the configuration interface and the corresponding information configuration may be designed according to the actual requirements in the specific implementation process, and are not limited to the structure and content shown in fig. 3.
The template content corresponding to the channel side is set based on the field and the data structure matched with the interface of the channel side, specifically, the declarative label is set according to the interface standard specification of the channel side, the field label related to the media resource data is set, and the attribute of the media resource data and the corresponding field label are configured in an associated way, namely, the label data indicating that a certain attribute value in the media resource data is a certain field label. For example, the file type corresponding to the channel provider a is json file, and the content of the template set based on the interface specification standard of the channel provider a can be as follows:
{"code":"${status!1}",
"msg":"",
"dataTime":"${date!0}",
"data":[
<#list videos as video>{
"title":"${video.partNamejson_string}",
"createtime":"${video.createTimestring("yyyy-MM-dd HH:mm:ss")}",
"cover":"${video.imgurl2!video.imgurl3!}",
"video_format":"${video.fileEx!}",
"tag":"${(video.keyWord!)?json_string}",
"id":"${video.partId}",
"description":"${(video.story!)?json_string}",
"duration":${video.duration},
"linkurl":"${video.linkUrl!}",
"category":"${video.fstlvlName!}"
}<#if video_has_next>,</#if></#list>]}。
for example, the file type corresponding to the channel B is an xml file, and the content of the template set based on the interface specification standard of the channel B can be as follows:
<?xml version="1.0"encoding="utf-8"?>
<document>
<code>${status!1}</code>
<pageNo>${pageNo}</pageNo>
<pageSize>${pageSize}</pageSize>
<total>${total}</total>
<rows>
<#list videos as video>
<video>
<#if(video.op) ><op>${video.op}</op></#if>
<weburl>https://m.mgtv.com/#/b/${video.clipId}/${video.partId}?cxid=99y8v3k335w</weburl>
<appurl><![CDATA[imgotv://playerclipId=${video.clipId}&plId=0&videoI d=${video.partId}&from=migs]]></appurl>
<id>${video.partId}</id>
<order>${video.serialno}</order>
<title>${video.partName!}</title>
<play_length>${video.duration}</play_length>
<publish_time>${video.releaseTimestring("yyyy-MM-ddHH:mm:ss")}</publish_time>
</video>
</#list>
</rows>
<msg></msg>
<serverTime>${date!}</serverTime>
</document>。
the template content and corresponding configuration information corresponding to each of the channel partners may be stored in a system database.
In the method provided by the embodiment of the invention, the timing task is configured in the system, the video media asset data in the media asset database can be loaded into the redis buffer at fixed time, and the media asset data in the redis is added and deleted through the MQ, so that the content in the redis is consistent with the content in the media asset database.
When the channel side needs to pull the media resource data, the media resource request can be generated according to the agreed parameters, such as the required video resource identification, channel identification and the like, and the media resource request is sent to the media resource data distribution system in the form of an access interface. When the system receives the media resource request sent by the channel side, the media resource request can be analyzed to obtain the channel identification corresponding to the channel side, namely the channel side code. Inquiring whether the channel corresponding to the channel identifier is effective or not in the system database can be understood as inquiring whether the template corresponding to the channel identifier is effective or not, and if so, acquiring the template corresponding to the channel identifier. The video resource identification can be obtained through the analysis of the media resource request. And acquiring corresponding media data in the redis according to the video resource identifier, and then rendering a corresponding template through the acquired media data, specifically, filling corresponding attribute values in the media data into corresponding positions in the template through configuration of a template engine, so as to realize template rendering. When more data is available, paging parameters can be supported, and the data can be pulled in batches. And after the template rendering process is completed, carrying out file export according to the file type corresponding to the channel identifier to obtain an interface response file, and sending the interface response file to the channel side.
For example, taking the template content corresponding to the channel provider a provided above as an example, the main content of the rendered template may be as follows:
and exporting json format files based on the template content, and outputting interface responses to the channel side.
Taking the template content corresponding to the channel provider B provided above as an example, the main content of the rendered template may be as follows:
<document>
<code>0</code>
<pageNo>1</pageNo>
<pageSize>100</pageSize>
<total>28</total>
<rows>
<video>
<weburl>https://m.mgtv.com/#/……</weburl>
<appurl>
<![CDATA[imgotv://playerclipId……09&from=migs]]>
</appurl>
<id>18740609</id>
<order>1</order>
< title > video title 3 >
<play_length>6954</play_length>
<publish_time>2023-04-27 00:00:00</publish_time>
</video>
.......
<video>
<weburl>https://m.mgtv.com/#/……</weburl>
<appurl>
<![CDATA[imgotv://playerclipId……8&from=migs]]>
</appurl>
<id>19100438</id>
<order>28</order>
< title > video title 4 >
<play_length>3071</play_length>
<publish_time>2023-06-09 00:00:00</publish_time>
</video>
</rows>
<msg/>
<serverTime>20230613121114</serverTime>
</document>。
And exporting an xml format file based on the template content, and outputting an interface response to the channel side.
The template content is configured according to the format requirements of the channel side, so that the channel side can directly access.
In order to better explain the method provided by the embodiment of the present invention, the overall process of implementing media data distribution of a channel side is briefly described with reference to the flowchart shown in fig. 4, and the implementation process of media data distribution provided by the embodiment of the present invention mainly includes:
newly added channels: when a cooperative channel party is newly added, channel information corresponding to the channel party is configured, including whether the channel is effective or not, and the like, so that a new channel is added in the system;
and (3) configuring a template: configuring a template corresponding to the channel based on an interface standard specification corresponding to the channel side;
Set the format json/xml: setting an interface file type corresponding to a channel side, and selecting json or xml files;
access interface: when the channel side needs to pull media data, the channel side accesses the initiating request through the interface;
judging whether the channel is valid or not: when a request initiated by a channel side is received, whether a channel corresponding to the channel side is valid or not is queried in a database. If the channel is invalid, feeding back a response of the data pulling failure;
querying a template: if the channel is effective, inquiring a template corresponding to the channel side;
loading data: and acquiring corresponding media data according to the video resource identifier carried in the request, loading the media data into a template corresponding to the channel side, and carrying out file export on the template loaded with the media data.
And (3) interface return: and returning the exported file to the channel side through the interface to realize media data distribution.
It should be noted that the flow shown in fig. 4 is only a schematic diagram provided for better explaining the method provided by the present invention, and is not limited to the actual business flow, i.e. the configuration of channel information and the interface access operation of the channel side are not performed in fixed order. The staff can only perform configuration on the related information of the newly added channel once, and the interface access can be repeatedly operated by the channel side as required.
Based on the method provided by the embodiment of the invention, when the channel to be cooperated is newly added, after the interface standard specification of the channel side is obtained, corresponding configuration can be carried out in the background, such as adding channel information, configuration templates and the like. The interface can be output immediately after the configuration, and the related channel side can acquire the media resource data based on the related parameters. The interface of the corresponding channel can be responded according to the data format and the data field required by the channel side for different channel requests. Therefore, the access of channels such as a quick and seamless butt joint search engine, a video aggregation website and the like is realized. The process greatly saves communication development time, can save labor cost, achieves the purpose of quick access, and is beneficial to improving the interface access efficiency. And after the channel cooperation expires, the channel can be made unavailable, the interface is immediately disabled, and the aim can be achieved without upgrading the interface service in the whole process.
Corresponding to a media data distribution method shown in fig. 1, an embodiment of the present invention further provides a media data distribution apparatus, which is configured to implement the method shown in fig. 1, and a schematic structural diagram of the media data distribution apparatus is shown in fig. 5, and includes:
a judging unit 301, configured to, when receiving a media asset request sent by a channel side, judge whether the channel side meets a preset distribution condition;
The parsing unit 302 is configured to parse the media resource request if the channel side meets the distribution condition, so as to obtain a video resource identifier corresponding to the media resource request;
a screening unit 303, configured to perform data screening on the created media asset data list, so as to obtain a media asset data set corresponding to the video resource identifier; the media asset data collection comprises at least one group of media asset data; the media data list comprises all stored media data;
a determining unit 304, configured to determine a target template corresponding to the channel side; the target template is a template which is pre-configured based on the interface specification standard corresponding to the channel side;
a filling unit 305, configured to fill each group of media data in the media data set into the target template, and use the target template after completing the data filling process as interface response content;
the export unit 306 is configured to conduct file export processing on the interface response content, so as to obtain an interface response file corresponding to the interface response content;
and the sending unit 307 is configured to send the interface response file to the channel side, so as to complete the media data distribution process.
When the device provided by the embodiment of the invention is applied, when the media data is required to be distributed to the channel side, the media data to be distributed is filled into the template configured based on the interface standard of the channel side, so that the interface response content can be obtained, after the file is exported, the corresponding file is sent to the channel, the data distribution can be conveniently realized, and the interface response about the media data distribution is completed. The data filling template is configured based on the interface standard of the channel side, so that the channel side can identify the media data in the file after obtaining the file, and then can acquire the resource. When a new channel is added on the service, the channel access can be realized only by configuring a template based on the interface specification standard of the new channel. When the interface standard of the channel side changes, only the corresponding template is required to be modified. In the process of realizing media resource data distribution, the interface development work is not required to be repeated, the workload is small, the implementation process is simple and convenient, and the efficiency of realizing channel access can be improved.
The device provided by the embodiment of the present invention may further extend a plurality of units on the basis of the device shown in fig. 5, and the functions of each unit may be referred to in the foregoing description of each embodiment provided by the media data distribution method, which is not further illustrated herein.
The embodiment of the invention also provides a storage medium, which comprises stored instructions, wherein the equipment where the storage medium is located is controlled to execute the media data distribution method when the instructions run.
The embodiment of the present invention further provides an electronic device, whose structural schematic diagram is shown in fig. 6, specifically including a memory 401, and one or more instructions 402, where the one or more instructions 402 are stored in the memory 401, and configured to be executed by the one or more processors 403 to perform the following operations by the one or more instructions 402:
when receiving a media resource request sent by a channel side, judging whether the channel side accords with preset distribution conditions;
if the channel side accords with the distribution condition, analyzing the media resource request to obtain a video resource identifier corresponding to the media resource request;
Data screening is carried out in the created media asset data list, and a media asset data set corresponding to the video resource identifier is obtained; the media asset data collection comprises at least one group of media asset data; the media data list comprises all stored media data;
determining a target template corresponding to the channel side; the target template is a template which is pre-configured based on the interface specification standard corresponding to the channel side;
filling each group of media data in the media data set into the target template, and taking the target template with the data filling processing completed as interface response content;
performing file export processing on the interface response content to obtain an interface response file corresponding to the interface response content;
and sending the interface response file to the channel side to complete the media resource data distribution process.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for a system or system embodiment, since it is substantially similar to a method embodiment, the description is relatively simple, with reference to the description of the method embodiment being made in part. The systems and system embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative elements and steps are described above generally in terms of functionality in order to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method of media asset data distribution, comprising:
when receiving a media resource request sent by a channel side, judging whether the channel side accords with preset distribution conditions;
if the channel side accords with the distribution condition, analyzing the media resource request to obtain a video resource identifier corresponding to the media resource request;
data screening is carried out in the created media asset data list, and a media asset data set corresponding to the video resource identifier is obtained; the media asset data collection comprises at least one group of media asset data; the media data list comprises all stored media data;
determining a target template corresponding to the channel side; the target template is a template which is pre-configured based on the interface specification standard corresponding to the channel side;
filling each group of media data in the media data set into the target template, and taking the target template with the data filling processing completed as interface response content;
performing file export processing on the interface response content to obtain an interface response file corresponding to the interface response content;
and sending the interface response file to the channel side to complete the media resource data distribution process.
2. The method of claim 1, wherein said determining whether the channel side meets a preset distribution condition comprises:
determining channel identifiers corresponding to the channel parties;
judging whether a template matched with the channel identifier exists in a preset template library or not; the template library comprises a plurality of preset templates;
if the template library has the template matched with the channel identifier, taking the template matched with the channel identifier in the template library as a candidate template;
judging whether the candidate template is in an effective state or not;
and if the candidate template is in an effective state, determining that the channel side meets the distribution condition.
3. The method as recited in claim 2, further comprising:
and if the candidate template is not in an effective state, determining that the channel side does not accord with the distribution condition.
4. The method of claim 2, wherein the determining the target template corresponding to the channel comprises:
and taking the candidate template as the target template.
5. The method of claim 1, wherein the performing data filtering in the created media data list to obtain the media data set corresponding to the video resource identifier includes:
Determining a resource identification type corresponding to the video resource identification;
if the resource identification type represents the identification of the video resource identification as a single video, acquiring media resource data corresponding to the video resource identification from the media resource data list, and forming the media resource data set by the media resource data corresponding to the video resource identification;
if the resource identification type represents the video resource identification as the identification of the video aggregation set, determining each target video identification corresponding to the video resource identification;
and acquiring the media data corresponding to each target video identifier from the media data list, and forming the media data set by the media data corresponding to each target video identifier.
6. The method of claim 1, wherein the performing file export processing on the interface response content to obtain an interface response file corresponding to the interface response content includes:
determining the type of the interface file corresponding to the channel side;
and generating a file corresponding to the interface file type based on the interface response content, and taking the file as the interface response file.
7. The method as recited in claim 1, further comprising:
And if the channel side does not meet the distribution condition, rejecting the media resource request.
8. A media asset data distribution device, comprising:
the judging unit is used for judging whether the channel side accords with preset distribution conditions or not when receiving a media resource request sent by the channel side;
the analysis unit is used for analyzing the media resource request if the channel side accords with the distribution condition, and obtaining a video resource identifier corresponding to the media resource request;
the screening unit is used for carrying out data screening in the created media resource data list to obtain a media resource data set corresponding to the video resource identifier; the media asset data collection comprises at least one group of media asset data; the media data list comprises all stored media data;
a determining unit, configured to determine a target template corresponding to the channel side; the target template is a template which is pre-configured based on the interface specification standard corresponding to the channel side;
the filling unit is used for filling each group of media data in the media data set into the target template, and taking the target template after finishing data filling processing as interface response content;
The export unit is used for conducting file export processing on the interface response content to obtain an interface response file corresponding to the interface response content;
and the sending unit is used for sending the interface response file to the channel side to complete the media data distribution process.
9. A storage medium comprising stored instructions, wherein the instructions, when executed, control a device in which the storage medium is located to perform the media asset data distribution method of any one of claims 1 to 7.
10. An electronic device comprising a memory and one or more instructions, wherein the one or more instructions are stored in the memory and configured to be executed by the one or more processors to perform the media data distribution method of any of claims 1-7.
CN202310999075.4A 2023-08-09 2023-08-09 Media asset data distribution method and device, storage medium and electronic equipment Pending CN116805974A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310999075.4A CN116805974A (en) 2023-08-09 2023-08-09 Media asset data distribution method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310999075.4A CN116805974A (en) 2023-08-09 2023-08-09 Media asset data distribution method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN116805974A true CN116805974A (en) 2023-09-26

Family

ID=88080807

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310999075.4A Pending CN116805974A (en) 2023-08-09 2023-08-09 Media asset data distribution method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN116805974A (en)

Similar Documents

Publication Publication Date Title
CN110310034B (en) Service arrangement and business flow processing method and device applied to SaaS
CN105915633B (en) Automatic operation and maintenance system and method
CN110515522B (en) Access method and device of equipment data, computer equipment and storage medium
CN112689170B (en) Content playing method of display terminal, display terminal and readable storage medium
CN111966943A (en) Streaming data distribution method and system
CN113791759A (en) Code development processing method and device, electronic equipment and storage medium
CN112860308A (en) Configuration method of interface definition, service processing method, server and storage medium
CN115114044A (en) Message pushing method, device, equipment and medium
CN113760697A (en) Interface testing method and device, electronic equipment and storage medium
CN113660359B (en) Domain name resolution record management method and device, storage medium and electronic equipment
CN113778499B (en) Method, apparatus, device and computer readable medium for publishing services
CN115185841A (en) System reconfiguration test method, device, equipment and storage medium
CN116805974A (en) Media asset data distribution method and device, storage medium and electronic equipment
CN114880386B (en) Task scheduling platform and task scheduling method
CN116302250A (en) Interface multiplexing method, device, electronic equipment and storage medium
CN110971664B (en) Interface service management system
CN111625866A (en) Authority management method, system, equipment and storage medium
CN113743630A (en) Method and device for executing intelligent call reservation
CN112637288A (en) Streaming data distribution method and system
CN107566212B (en) Resource monitoring management method and device
CN115242871B (en) Service method and device of business gateway, storage medium and electronic equipment
CN109992561A (en) Industrial real-time computing technique, storage medium and calculating equipment
CN108900335A (en) Workflow management method and device based on Hadoop
CN117290016B (en) Page configuration method and device for view
CN113094192B (en) Data processing method, device, medium and equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination