Data interaction method between marketing platform and media platformTechnical Field
The invention relates to the technical field of information, in particular to a data interaction method between a marketing platform and a media platform.
Background
An API, the full name Application Programming Interfaces, is an Application program interface, which is a collection of definitions, procedures and protocols. The API becomes a connecting channel among different websites, APPs and systems, and source codes or data and the like behind the API can be called through the API interface.
The Marketing API (Mkt API for short), namely the Marketing API, is a set of interface service which is externally output by media based on the functions of the advertising platform, is suitable for demanders (including advertisers, agents, third-party service providers and the like) with certain technical capability to build an integrated Marketing platform or tool which meets the personalized requirements and is communicated with the media advertising platform by means of the socket service, and is used for transmitting data and improving the working efficiency and the effect.
The Marketing API of the media platform will be an important infrastructure for one-stop platforms such as ADTech/MarTech, Marketing cloud automation, tracking Desk, etc. Basic APIs such as report export, multi-level proxy, account accounting and batch delivery management are provided; better APIs for supporting rich targeting, advertiser crowd targeting and conversion backhaul (OCPX/CPA optimization); individual ones also provide APIs for dynamic creatives, dynamic commodity libraries, self-help website building, audience estimation, and even UI suites.
The access of the MarkingAPI is an indispensable technical mode for media advertisement delivery in the Internet at present. However, data interaction between the media platform and the marketing platform also faces the following difficulties:
(1) each media has a corresponding Marking API, but due to the media side technology or resource diversity and the current single synchronization mode, the sporadic request of part of media data APIs fails or the service data is not matched, and the situations of incomplete and inaccurate returned data may exist. The access party cannot obtain accurate media data, which results in commercial loss.
(2) The data request methods in the prior art mainly include the following types: 1) and (3) ordinary request: the single network connection has the defects that the correctness and the integrity of data cannot be ensured; 2) retry request: when the request is wrong, the data is requested again, the defect is that certain times of limitation exists, and even if no times of limitation exists, the waiting of other programs can be caused, so that the time consumption is increased; 3) and (3) polling request: and writing the API information which is not requested successfully into the queue, circularly requesting in sequence, and continuously repeating the operation if the API information fails, wherein the defects that the data accuracy cannot be ensured in real time and the time consumption is long are overcome. However, as the number of demanding parties of the media platform increases, the data interaction demand between the demanding parties and the media platform also increases, and the existing data request mode cannot meet the demand, so that a more efficient and accurate data interaction method is needed.
Disclosure of Invention
In order to overcome the technical defects, the invention aims to provide a data interaction method between a marketing platform and a media platform, which comprises the following steps:
step S1, the operating system of the marketing platform starts a process and sends a data interaction request to the API interface of the media platform;
step S2, when the marketing platform monitors that the data interaction request aiming at the API fails, the program of the marketing platform starts a process splitting mode;
step S3, the marketing platform starts two or more processes and sends data request to the API interface which fails to receive the data interaction request again, if any process completes the task successfully, all processes are ended; if all processes have not completed the task, the current part or all processes continue to be split into two or more processes, respectively, until any process successfully completes the task.
The term "media platform" in this application refers to: and the data owner provides a data API. "media platform" refers to a media advertisement delivery platform, including but not limited to: a half-closed media platform such as WeChat public and QQ public platforms; short message platforms such as Xinlang microblog, today's top bar and Twitter; the system comprises an open recommendation media platform, such as fun headlines, today headlines, fox search self-media, internet easy self-media, one-point information, UC self-media, hundred family numbers, penguin numbers and the like; and video platforms such as Youkao, potato, Aiqiyi, music and Tengchi video; and the inquiry and answer platforms such as Wukong inquiry and answer, Baidu inquiry and answer, known question and answer, microblog question and answer, dog search inquiry and answer, 360 question and answer, hand hundred inquiry and answer and the like.
The "marketing platform" in this application means: and the data acquirer acquires data through a data API provided by the media platform. The marketing platform is a random marketing system which can collect and arrange the digital assets of the final users in the field, interact and reach the users through all user reach channels of the brand side, monitor, analyze and feed back the whole link reached by the users, and is beneficial to personalized digital marketing and automatic marketing.
The process is a basic unit for the dynamic execution of the operating system, and in the conventional operating system, the process is a basic allocation unit. A process is an entity. Each process has its own address space, and the operating system may have multiple processes that may be allowed simultaneously.
Further, the data interaction request refers to a request for acquiring media data of the media platform.
Further, in step S2, when no data is returned from the API interface of the media platform, or the returned data of the API interface does not match the business data of the marketing platform, it is determined that the data interaction request of the marketing platform for the API interface of the media platform has failed.
Further, in step S3, the two or more processes include a main process and a sub-process generated by the main process, the main process monitors whether the sub-process completes the task of acquiring the media data of the media platform in a process communication manner, and if the task is completed, notifies other sub-processes of ending; and if all the processes do not complete the tasks, the current part or all the sub-processes are used as new main processes and are respectively split into two or more sub-processes until any process successfully completes the task of acquiring the media data of the media platform.
Further, the data interaction request is a request for modifying media data in batches by directing to API interfaces of different media platforms.
It will be understood by those skilled in the art that the term "data interaction" in the present application is not limited to "acquiring data" and "modifying data," but may be other types of data interaction behavior.
Further, in step S3, the two or more processes include a main process and sub-processes generated by the main process, each of the sub-processes modifying different media data, respectively.
Further, the main process monitors whether all the subprocesses complete tasks of modifying different media data or not by using a process communication mode, and if the main process monitors that a request for modifying media data sent by a certain subprocess to a certain API fails, the main process regenerates two or more subprocesses to continue to complete the task of sending the request for modifying media data to the certain API until any subprocess successfully completes the task of modifying media data.
Those skilled in the art will appreciate that the "process communication means" in the present application can be implemented by using the conventional technology in the art.
Further, the splitting rule of the process splitting mode is progressive splitting. The step-by-step split refers to when a certain progress of the marketing platform is connected to a certain API interface of the media platform (for example, a certain API interface is assumed to be named as X1API interface) fails, the process is split into two or more sub-processes to continue to execute to X1The task of data interaction request sent by API interface if part or all of two or more subprocesses are sent to X1If the data interaction request task sent by the API still fails, the sub-process with the task failure can be continuously split into two or more sub-processes, and the like, and the sub-process is continuously split downwards step by step until the sub-process is towards the X1If one process in the multiple processes sending the data interaction request by the API is successful, all the processes are stopped from splitting. However, it should be noted that, if all of the split sub-processes fail to request, when performing the next split, a part of the sub-processes that fail to request should be selected to perform the next split, or all of the sub-processes that fail to request should be selected to perform the next split, and the splitting rule may be set by the user.
Further, the splitting mode of the process splitting mode is coroutine and/or multi-process. The operating system allocates system resources (resources such as CPU time slices and memory) in units of processes, and a process is the minimum unit of resource allocation. Coroutines, which are a lighter weight existence than threads, are not managed by the operating system kernel, but are completely program controlled (i.e., executed in user mode). This has the advantage of greatly improved performance without consuming resources as in thread switching. The process and the coroutine can occupy less server resources and reduce resource consumption. The self-matching is carried out according to the development language.
It should be noted that the splitting scale, the splitting rule and the splitting mode of the process splitting mode in the present application can be set by the user according to the actual needs. The splitting scale mainly depends on the performance of the server currently used by the user, for example, on a 16G and 1GCPU server, the total amount of all processes after splitting (i.e. the splitting scale) can reach 50-100 at most.
After the technical scheme is adopted, compared with the prior art, the method has the following beneficial effects:
according to the data interaction method between the marketing platform and the media platform, the wrong API requests do not need to be checked in sequence after all the requests are completed, and therefore the real-time performance of data interaction between the marketing platform and the media platform can be guaranteed; the matching between the returned data of the API interface and the business data of the marketing platform is compared, so that the accuracy and the integrity of the returned data of the API interface are ensured; the process splitting mode is adopted and the sub-process is monitored in the process communication mode, so that the high efficiency of data interaction is guaranteed, the requirements of a large amount of high-frequency data interaction between the current social marketing platform and the media platform can be met, the process splitting mode can be set by a user, and the individual requirements of different users can be met. In conclusion, the marketing platform can accurately, timely and efficiently interact with the media platform, so that the business loss caused by data interaction can be effectively avoided.
Drawings
FIG. 1 is a schematic diagram of data interaction between a marketing platform and a media platform;
FIG. 2 is a schematic diagram illustrating a splitting principle of a process splitting pattern according to an embodiment of the present application;
fig. 3 is a flowchart of a data interaction method between a marketing platform and a media platform according to the present application.
Detailed Description
The advantages of the invention are further illustrated in the following description of specific embodiments in conjunction with the accompanying drawings. It is to be understood by persons skilled in the art that the following detailed description is illustrative and not restrictive, and is not to be taken as limiting the scope of the invention. Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
The terminology used in the present disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. As used in this disclosure and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
The term "include" and variations thereof as used herein is meant to be inclusive in an open-ended manner, i.e., "including but not limited to". The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context. In the following description, suffixes such as "module" used to represent elements are used only for facilitating the explanation of the present invention and have no specific meaning in itself.
As shown in fig. 1, the technical solution of the present application mainly relates to data interaction between a marketing platform and a media platform, and a process splitting mode (for example, the process splitting principle is shown in fig. 2) is adopted to perform real-time, accurate and efficient data interaction.
The technology relies on a back-end language (e.g., PHP, GO supports multi-process or co-procedural syntax) and processes can be implemented under the control of the program code itself.
As shown in fig. 3, the data interaction method between the marketing platform and the media platform of the present application includes the following steps:
step S1, the operating system of the marketing platform starts a process and sends a data interaction request to the API interface of the media platform;
step S2, when the marketing platform monitors that the data interaction request aiming at the API fails, the program of the marketing platform starts a process splitting mode;
step S3, the marketing platform starts two or more processes and sends data request to the API interface which fails to receive the data interaction request again, if any process completes the task successfully, all processes are ended; if all processes have not completed the task, the current part or all processes continue to be split into two or more processes, respectively, until any process successfully completes the task.
The present application is distinguished from the prior art in parallel: the parallel in the prior art means that a plurality of programs operate simultaneously, the result cannot be controlled, the resource consumption cannot be controlled, and the expandability is poor. In the technical scheme of the application, the process is controlled by a program, so that resource management is facilitated, the result can be controlled, if one is successful, the split request is not continued, but the requests are continued in parallel, and server resources are wasted. In addition, if the effect is not ideal, the number of processes can be expanded by modifying the configuration, so that the technical scheme has good expandability.
Example 1: the marketing platform sends a request for acquiring media data to an API (application programming interface) of the media platform
The data interaction method between the marketing platform and the media platform specifically comprises the following steps:
1. and when monitoring that the media API is not returned or the data is not matched with the service data during request, the program starts the split mode.
2. And starting two processes or a plurality of API interfaces which simultaneously request failure, and finishing all requests when any process acquires the result. If not, the process continues to split until the acquired data completes the API data request.
3. And the main process monitors whether the sub-process completes the task or not through the developed program by using a process communication mode. And if the task is completed, informing other subprocesses to end.
Example 2: marketing platform sends request for modifying media data in batch to API interface of media platform
1. When a user wants to modify some different advertisement data in batch on business, a splitting mode can be used because the media API is not supported by the user.
2. The main process generates a plurality of sub-processes, each sub-process respectively sends data interaction requests to different API interfaces to realize the function of processing different advertisement data in batches, and each sub-process respectively processes different advertisement data to complete the media API requests. And the main process monitors whether the sub-process completes the task or not by using a process communication mode.
3. And if the main process monitors that the API request of the sub-process fails, newly generating a sub-process to continue to complete the API request aiming at the API interface until the API request is successful.
It should be noted that the embodiments of the present invention have been described in terms of preferred embodiments, and not by way of limitation, and that those skilled in the art can make modifications and variations of the embodiments described above without departing from the spirit of the invention.