CN-122027682-A - Content distribution method, device, electronic equipment and storage medium
Abstract
The disclosure provides a content publishing method, a content publishing device, electronic equipment and a storage medium, and relates to the technical fields of data processing and artificial intelligence. The method comprises the steps of receiving content release request information, obtaining an alternative character set for content generation according to the request information and a field registry, determining a directed acyclic graph DAG for content release according to the request information, wherein the DAG comprises nodes corresponding to components participating in content release and edges between the nodes, the edges between the nodes represent the dependency relationship between the components participating in content release, generating target content according to the DAG and the alternative character set, and releasing the target content.
Inventors
- SUN CHAOFAN
- DOU PINGFANG
- XIE YANGYANG
- JING WENZHONG
- ZHANG ZHIKUAN
- PAN XIN
Assignees
- 百度时代网络技术(北京)有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20260127
Claims (20)
- 1. A content distribution method, wherein the method comprises: Receiving content release request information; acquiring an alternative character set for content generation according to the request information and the field registry; Determining a directed acyclic graph DAG for content release according to the request information, wherein the DAG comprises nodes corresponding to components participating in the content release and edges between the nodes, and the edges between the nodes represent the dependency relationship between the components participating in the content release; and generating target content according to the DAG and the alternative character set, and publishing the target content.
- 2. The method of claim 1, wherein the obtaining the set of alternative fields for content generation from the request information and field registry comprises: analyzing the request information, and extracting input parameters from different components of the request information to obtain a parameter set; And identifying the fields in the parameter set according to the field registry to obtain the alternative field set.
- 3. The method of claim 2, wherein the identifying the fields in the parameter set according to the field registry to obtain the alternative field set comprises: traversing the fields in the parameter set; mapping the currently traversed field to the field registry, and determining a registered field corresponding to the currently traversed field from the field registry; and checking the currently traversed field according to the field description information of the registration field to obtain the alternative field set.
- 4. A method according to claim 3, wherein the method further comprises: Determining that the currently traversed field is a field in the error field set in response to the currently traversed field failing verification; recording and/or alarming the error field set.
- 5. A method according to claim 3, wherein the method further comprises: and determining the currently traversed field as an unknown field in response to the field registry not having a registered field corresponding to the currently traversed field, and recording and/or monitoring and alarming the unknown field.
- 6. The method of claim 1, wherein the determining a directed acyclic graph DAG for content publication from the request information comprises: determining a content release type according to the request information; Determining a corresponding release template according to the content release type; And determining the DAG for content release according to the corresponding release template.
- 7. The method of any of claims 1-6, wherein the generating target content from the DAG and the set of alternative fields comprises: determining the topological order among the components participating in the content release according to the dependency relationship among the components participating in the content release; scheduling the components participating in the content distribution from a component factory based on the topological order; Generating an instance of the scheduled component that participates in content publication; And executing the example of the component participating in content release, and processing the alternative character field set to generate the target content.
- 8. The method of claim 7, wherein the executing the instance of the component that participates in content publishing processes the set of alternative fields to generate the target content, comprising: The fields in the alternative field set are encapsulated and abstracted to obtain instance input parameters matched with the components participating in content release; and executing the instance of the component participating in the content release, and processing the instance input parameters to obtain an execution result of the instance of the component participating in the content release.
- 9. The method of claim 8, wherein the encapsulating abstractions of the fields in the set of alternative fields to obtain instance input parameters that match the component involved in content distribution comprises: determining interfaces corresponding to the components participating in content release; and according to the interfaces corresponding to the components participating in content release, carrying out encapsulation abstraction on the fields in the alternative field sets to obtain instance input parameters meeting the requirements of the interfaces.
- 10. The method of claim 7, wherein the method further comprises: Scheduling a plurality of components participating in content distribution in the same topological order from the component factory based on the topological order; And carrying out parallel processing on the alternative character segment set through the scheduled multiple instances of the components participating in content release.
- 11. The method of claim 7, wherein the method further comprises: and distributing system resources to a plurality of instances of the components participating in content distribution through a load balancing strategy.
- 12. The method of claim 7, wherein the scheduling the components participating in content publication from a component factory based on the topological order comprises: determining a component which participates in content release and is currently scheduled based on the topological order; Identifying the state of the component participating in the content publication to be currently scheduled, and scheduling the component participating in the content publication to be currently scheduled from the component factory in response to the state of the component participating in the content publication to be currently scheduled being in a ready state.
- 13. The method of claim 12, wherein the identifying the status of the component participating in the content publication to be currently scheduled, responsive to the status of the component participating in the content publication to be currently scheduled being in a ready state, comprises: According to the dependency relationship, other components on which the components participating in content release to be scheduled currently depend are determined; Responsive to the status of all other components being relied upon being in a successful state, the status of the respective component of the participating content is determined to be a ready state.
- 14. The method of claim 7, wherein the method further comprises: And in the process of generating the target content, monitoring the state of the node in the DAG, and switching the state of the node according to a node state machine.
- 15. The method of claim 7, wherein the method further comprises at least one of: monitoring the performance of a component in a content release system, acquiring at least one performance parameter of the execution time, resource consumption and calling frequency of the component, and generating a performance report of the component according to the at least one performance parameter; Generating performance optimization information of the component according to the performance report of the component; monitoring the abnormality of the component in the executing process, and monitoring the abnormality of the component in real time; In response to the occurrence of an anomaly, an automatic recovery operation and/or alarm information is performed on the component.
- 16. The method of claim 7, wherein the method further comprises at least one of: monitoring fields in the field registry to obtain usage data of the fields; Performing exception and redundancy monitoring on the fields in the field registry; And monitoring the input and output conditions of the fields in the field registry.
- 17. A content distribution apparatus, wherein the apparatus comprises: the receiving module is used for receiving the content release request information; The acquisition module is used for acquiring an alternative character set for content generation according to the request information and the field registry; The determining module is used for determining a directed acyclic graph DAG for content release according to the request information, wherein the DAG comprises nodes corresponding to components participating in the content release and edges between the nodes, and the edges between the nodes represent the dependency relationship between the components participating in the content release; And the generation module is used for generating target content according to the DAG and the alternative character set and publishing the target content.
- 18. An electronic device, comprising: at least one processor, and A memory communicatively coupled to the at least one processor, wherein, The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-16.
- 19. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-16.
- 20. A computer program product comprising computer programs/instructions which, when executed by a processor, implement the method of any of claims 1-16.
Description
Content distribution method, device, electronic equipment and storage medium Technical Field The disclosure relates to the technical field of data processing and artificial intelligence, in particular to a content publishing method, a content publishing device, electronic equipment and a storage medium. Background The efficiency and stability of the content distribution system directly affect the smoothness of the business operation. In current content distribution systems, the definition and use of fields lacks unified standards and specifications, increasing learning and use costs, and leading to misuse and loss of data. Moreover, the interaction logic of a plurality of components in the content release system is complex, and the page loading speed and the user experience are greatly influenced. Disclosure of Invention The present disclosure provides a method, an apparatus, an electronic device, and a storage medium for content distribution. According to one aspect of the disclosure, a content publishing method is provided, which comprises the steps of receiving content publishing request information, obtaining an alternative character segment set for content generation according to the request information and a field registry, determining a directed acyclic graph DAG for content publishing according to the request information, wherein the DAG comprises nodes corresponding to components participating in content publishing and edges between the nodes, the edges between the nodes represent the dependency relationship between the components participating in content publishing, generating target content according to the DAG and the alternative character segment set, and publishing the target content. According to another aspect of the disclosure, a content publishing device is provided, which comprises a receiving module, an acquisition module, a determining module and a generating module, wherein the receiving module is used for receiving content publishing request information, the acquisition module is used for acquiring an alternative character segment set for content generation according to the request information and a field registry, the determining module is used for determining a directed acyclic graph DAG for content publishing according to the request information, the DAG comprises nodes corresponding to components participating in content publishing and edges between the nodes, the edges between the nodes represent the dependency relationship between the components participating in content publishing, and the generating module is used for generating target content according to the DAG and the alternative character segment set and publishing the target content. According to another aspect of the present disclosure, there is provided an electronic device comprising at least one processor, and a memory communicatively coupled to the at least one processor, wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the content distribution method of the embodiments of the above aspect. According to another aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium having stored thereon computer instructions for causing the computer to execute the content distribution method according to the embodiment of the above aspect. According to another aspect of the present disclosure, there is provided a computer program product comprising a computer program/instruction which, when executed by a processor, implements the content distribution method according to the embodiment of the above aspect. It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification. Drawings The drawings are for a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein: fig. 1 is a schematic flow chart of a content publishing method according to an embodiment of the present disclosure; FIG. 2 is a flowchart of another content distribution method according to an embodiment of the present disclosure; FIG. 3 is a flowchart illustrating another content distribution method according to an embodiment of the present disclosure; Fig. 4 is a flow chart illustrating a state transition relationship of a node according to an embodiment of the present disclosure; FIG. 5 is a schematic flow chart of a content distribution system according to an embodiment of the present disclosure; FIG. 6 is a schematic diagram of a component execution flow provided by an embodiment of the present disclosure; Fig. 7 is a schematic structural diagram of a content distribution apparatus according to an embodiment of the present disclosure; Fig. 8 is