CN118042194A - Flow settlement method and device suitable for live broadcast scene - Google Patents

Flow settlement method and device suitable for live broadcast scene Download PDF

Info

Publication number
CN118042194A
CN118042194A CN202410071366.1A CN202410071366A CN118042194A CN 118042194 A CN118042194 A CN 118042194A CN 202410071366 A CN202410071366 A CN 202410071366A CN 118042194 A CN118042194 A CN 118042194A
Authority
CN
China
Prior art keywords
producer
flow data
settlement
flow
data
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
CN202410071366.1A
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.)
Beijing Quantum Song Technology Co ltd
Original Assignee
Beijing Quantum Song Technology 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 Beijing Quantum Song Technology Co ltd filed Critical Beijing Quantum Song Technology Co ltd
Priority to CN202410071366.1A priority Critical patent/CN118042194A/en
Publication of CN118042194A publication Critical patent/CN118042194A/en
Pending legal-status Critical Current

Links

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention provides a flow settlement method and a device suitable for a live broadcast scene, and the corresponding method comprises the following steps: acquiring flow data of a plurality of live broadcast users in real time; sending the flow data to a message middleware in a multi-process or multi-thread mode; obtaining the flow data from the message middleware according to a producer-consumer model; and settling the flow data and sending settlement results to the plurality of live broadcast users. The invention can greatly reduce the risk of traffic settlement errors in a live broadcast scene, ensures that the cost paid by a user is matched with the actual use amount of the traffic settlement errors, has extremely small occupation to the system, and can reasonably use the system resources of a settlement party so as to improve the performance and response speed of the system.

Description

Flow settlement method and device suitable for live broadcast scene
Technical Field
The application belongs to the technical field of communication, in particular to the technical field of flow settlement, and particularly relates to a flow settlement method and device suitable for a live broadcast scene.
Background
Currently, flow cost settlement systems have become an important component in many industries. The traffic cost accounting system aims to effectively track and manage the use condition of resources and provide an accurate cost allocation mechanism for related parties.
In existing flow billing systems, a resource user pays a fee based on the amount of resources he uses. This method typically involves manual recording and calculation, is error prone and time and effort consuming.
Some existing systems use a time-based billing method in which a resource user pays a fee for the length of time that the resource is used. Although this approach may reduce computational errors to some extent, it may not accurately reflect the actual use of resources.
Another common approach is to use a quota charge, i.e. a fixed charge is allocated to the resource. However, this approach may result in wasted resources, as the user may be limited to the allocated quota, regardless of the actual need.
Secondly, the existing flow settlement method has too large resource occupation for a flow provider, and is not beneficial to popularization.
Disclosure of Invention
The invention aims to provide a flow settlement method suitable for a live broadcast scene, which can greatly reduce the risk of flow settlement errors, ensure that the cost paid by a user is matched with the actual use amount of the flow settlement method, has extremely small occupation to a system, can reasonably use system resources of a settlement party so as to improve the performance and response speed of the system, and can predict the use condition of future resources according to historical data and trends. Thereby enabling the system to provide more accurate cost estimates to the user, helping them make more informed resource allocation decisions.
Another object of the present invention is to provide a traffic settlement device suitable for use in live scenes. It is still another object of the present invention to provide an electronic device, which includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program implementing the steps of the above-mentioned traffic settlement method applicable to a live scene. It is a further object of the present invention to provide a readable medium having stored thereon a computer program which, when executed by a processor, implements the steps of the above-described flow settlement method adapted to live scenarios.
In order to solve the technical problems in the background technology of the application, the application provides the following technical scheme:
in a first aspect, the present invention provides a traffic settlement method applicable to a live scene, including:
acquiring flow data of a plurality of live broadcast users in real time;
Sending the flow data to a message middleware in a multi-process or multi-thread mode;
obtaining the flow data from the message middleware according to a producer-consumer model;
And settling the flow data and sending settlement results to the plurality of live broadcast users.
In some embodiments of the present invention, a traffic settlement method applicable to a live scene further includes:
Deploying a plurality of consumers on the container;
The plurality of consumers are registered with nacos registry.
In some embodiments of the invention, said obtaining said traffic data from said message middleware in a producer-consumer mode comprises:
presenting the plurality of consumers to a producer through the nacos registry when the producer is in a different service than the consumers;
receiving selected results of the producer for the plurality of consumers;
and sending the flow data acquired from the message middleware to a consumer in a selected result.
In some embodiments of the invention, sending the traffic data obtained from the message middleware to a consumer in a selected result includes:
Judging whether the ID of the producer in the selected result hits in a cache;
Searching the ID of the producer in a preset relational database when the cache does not hit the ID of the producer;
And sending the flow acquired from the message middleware to a producer corresponding to the ID.
In some embodiments of the present invention, before sending the traffic data to the message middleware in a multi-process or multi-threaded manner, further comprising:
analyzing the flow data to obtain abstract information of the flow data;
and authenticating the flow data according to the gateway and the abstract information.
In a second aspect, the present invention provides a traffic settlement device suitable for use in a live scene, the device comprising:
the flow data receiving module is used for acquiring flow data of a plurality of live broadcast users in real time;
The flow data sending module is used for sending the flow data to the message middleware in a multi-process or multi-thread mode;
a flow data acquisition module for acquiring the flow data from the message middleware according to a producer-consumer mode;
And the flow settlement module is used for settling the flow data and sending settlement results to the plurality of live broadcast users.
In some embodiments of the present invention, a traffic settlement device suitable for use in a live scene further includes:
A consumer deployment module for deploying a plurality of consumers on the container;
and the consumer registration module is used for registering the plurality of consumers to a nacos registration center.
In some embodiments of the invention, the traffic data acquisition module comprises:
a consumer presentation unit for presenting the plurality of consumers to the producer through the nacos registry when the producer and the consumers are located in different services;
a selected result receiving unit configured to receive selected results of the producer for the plurality of consumers;
And the flow data transmitting unit is used for transmitting the flow data acquired from the message middleware to the consumer in the selected result.
In some embodiments of the present invention, the traffic data transmitting unit includes:
A hit judgment unit configured to judge, in a cache, whether an ID of a producer in the selected result hits;
An ID searching unit, configured to search, when the cache does not hit the ID of the producer, the ID of the producer in a preset relational database;
And the flow data sending subunit is used for sending the flow acquired from the message middleware to the producer corresponding to the ID.
In some embodiments of the present invention, a traffic settlement device suitable for use in a live scene further includes:
the abstract information acquisition module is used for analyzing the flow data to acquire abstract information of the flow data;
and the flow data authentication module is used for authenticating the flow data according to the gateway and the abstract information.
In a third aspect, the present invention provides a computer program product comprising computer programs/instructions which, when executed by a processor, implement the steps of a method for flow settlement in a live scenario.
In a fourth aspect, the present invention provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing steps of a flow settlement method suitable for use in a live scenario when the program is executed by the processor.
In a fifth aspect, the present invention provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements steps of a method for flow settlement applicable in live scenarios.
As can be seen from the above description, the embodiment of the present invention provides a method and an apparatus for settling traffic in a live broadcast scene, where the method for settling traffic in a live broadcast scene includes: firstly, acquiring flow data of a plurality of live broadcast users in real time; then, according to the mode of multiprocessing or multithreading, send the flow data to the message middleware; obtaining flow data from the message middleware according to the producer-consumer model; and finally, settling the stream data and sending the settlement result to a plurality of live broadcast users.
Flow settlement device suitable for under live broadcast scene includes: the flow data receiving module is used for acquiring flow data of a plurality of live broadcast users in real time; the flow data sending module is used for sending the flow data to the message middleware in a multi-process or multi-thread mode; the flow data acquisition module is used for acquiring flow data from the message middleware according to the producer-consumer mode; and the flow settlement module is used for settling the flow data and sending the settlement result to a plurality of live broadcast users.
The invention can greatly reduce the risk of traffic settlement errors in a live broadcast scene, ensures that the cost paid by a user is matched with the actual use amount of the traffic settlement errors, has extremely small occupation to the system, and can reasonably use the system resources of a settlement party so as to improve the performance and response speed of the system.
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 in the embodiments or the description of the prior art will be briefly described, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flow chart of a flow settlement method suitable for a live scene according to an embodiment of the present invention;
Fig. 2 is a second flow chart of a flow settlement method suitable for a live scene in an embodiment of the invention;
Fig. 3 is a flowchart illustrating a flow of a method 300 for settling a flow in a live scene according to an embodiment of the present invention;
fig. 4 is a flowchart illustrating a step 303 of a flow settlement method suitable for a live scene according to an embodiment of the present invention;
fig. 5 is a flow chart diagram III of a flow settlement method suitable for a live scene in an embodiment of the invention;
FIG. 6 is a block diagram of a flow settlement system suitable for use in a live scenario in accordance with embodiments of the present invention;
fig. 7 is a flow chart of a flow settlement method applicable to a live scene in an embodiment of the invention;
FIG. 8 is a block diagram of a flow settlement device suitable for use in live scenes according to an embodiment of the present invention;
fig. 9 is a block diagram of a flow settlement device suitable for use in a live scene according to the embodiment of the invention;
FIG. 10 is a block diagram of the traffic data acquisition module 30 according to an embodiment of the present invention;
Fig. 11 is a block diagram of the traffic data transmitting unit 30c in the embodiment of the present invention;
fig. 12 is a block diagram III of a flow settlement device suitable for use in a live scene according to an embodiment of the present invention;
fig. 13 is a schematic structural diagram of an electronic device in an embodiment of the invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. 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.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
It is noted that the terms "comprises" and "comprising," and any variations thereof, in the description and claims of the present application and in the foregoing figures, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed or inherent to such process, method, article, or apparatus. Embodiments of the application and features of the embodiments may be combined with each other without conflict. The application will be described in detail below with reference to the drawings in connection with embodiments.
According to the technical scheme, the data are acquired, stored, used and processed according with relevant regulations of laws and regulations.
The embodiment of the invention provides a specific implementation manner of a flow settlement method suitable for a live broadcast scene, referring to fig. 1, the method specifically comprises the following steps:
step 100: acquiring flow data of a plurality of live broadcast users in real time;
Step 200: sending the flow data to a message middleware in a multi-process or multi-thread mode;
step 300: obtaining the flow data from the message middleware according to a producer-consumer model;
Step 400: and settling the flow data and sending settlement results to the plurality of live broadcast users.
As can be seen from the above description, the embodiment of the present invention provides a traffic settlement method suitable for a live scene, including: firstly, acquiring flow data of a plurality of live broadcast users in real time; then, according to the mode of multiprocessing or multithreading, send the flow data to the message middleware; obtaining flow data from the message middleware according to the producer-consumer model; and finally, settling the stream data and sending the settlement result to a plurality of live broadcast users.
The invention adopts advanced data acquisition technology, and can accurately track and record the actual use condition of resources. Compared with the traditional manual recording, the automatic method can greatly reduce the risk of calculation errors, and ensures that the cost paid by a user is matched with the actual use amount of the user. The invention adopts an intelligent algorithm and an analysis model, and can predict future resource use conditions according to historical data and trends. This enables the system to provide more accurate cost estimates to the user, helping them make more informed resource allocation decisions.
In summary, the flow cost settlement system effectively solves the problems of insufficient accuracy, opaque cost, resource waste and the like in the prior art by innovative technical means. By providing personalized, intelligent and flexible solutions, the invention can bring significant improvements in the fields of resource management and cost allocation, and meet the actual demands of different industries and fields.
For step 100, the traffic data of the plurality of live users may be obtained from the mobile terminal or the web terminal, and in addition, the traffic data may include historical traffic data of the plurality of live users in addition to current traffic data of the plurality of live users, and the purpose of obtaining the historical traffic data of the plurality of live users is to predict future traffic data of the plurality of live users.
For step 200, message middleware is a software solution for asynchronous communication and messaging in a distributed system. Which allows communication between different applications, services or components by sending and receiving messages. Message middleware may provide reliable messaging, persistent storage of messages, subscription and publishing of messages, and the like. By using message middleware, the system can implement decoupled and loosely coupled architectures, and the different components can evolve and expand independently without directly relying on each other. In addition, the message middleware can also process high-concurrency message processing, and ensure the reliability and stability of the system.
On the other hand, multiprocessing and multithreading are two ways for implementing concurrent programming. Multiprocessing refers to creating multiple independent processes in an operating system, each process having its own independent memory space and resources. The processes can be executed in parallel and are independent of each other. Communication between processes may be implemented through inter-process communication (IPC) mechanisms such as pipes, message queues, shared memory, etc. The advantage of multiple processes is high stability, one process crashes without affecting other processes, but the process switching overhead is large.
Multithreading refers to creating multiple threads in the same process, with all threads sharing the memory space and resources of the process. Multiple threads can execute concurrently, share data and context, and communicate between threads through a shared memory. The advantage of multithreading is that the overhead of creating threads is relatively small, as is the overhead of switching between threads, but multithreading is more complex to program, and thread security needs to be considered.
Preferably, the message middleware in step 200 is RocketMQ, rocketMQ a low-latency, high-concurrency, high-availability, high-reliability distributed message middleware. The message queue RocketMQ can provide asynchronous decoupling and peak clipping and valley filling capabilities for the distributed application system, and simultaneously has the characteristics of mass message accumulation, high throughput, reliable retry and the like required by the Internet application. RocketMQ in the present application comprises the following components:
Topic: the message topic is used to categorize a class of messages, such as an order topic, i.e., all order related messages can be carried by the topic to which the producer sends the message.
The producer: responsible for producing the message and sending the message to the Topic role.
The consumer: takes care of the role of receiving and consuming messages from Topic.
Message: the content sent by the producer to Topic will be consumed by the consumer.
Message attributes: the producer may customize some business related attributes for the message at the time of sending, such as MESAGE KEY and Tag.
Group: a class of producers or consumers typically produce or consume the same class of messages and the logic of message publication or subscription is consistent.
It will be appreciated that the producer-consumer mode in step 300 is a concurrent programming mode for addressing data interaction between the producer and consumer. In this mode, the producer is responsible for generating and placing data or tasks into a shared buffer, and the consumer takes the data or tasks from the buffer and processes them. The producer and consumer may be separate processes or threads.
At the heart of the producer-consumer model is a shared buffer (message middleware), which may be a queue, buffer pool, or other data structure. The producer adds data to the buffer, and if the buffer is full, the producer needs to wait; the consumer retrieves the data from the buffer and if the buffer is empty, the consumer needs to wait. This enables decoupling and coordination between the producer and consumer. To ensure thread security, a synchronization mechanism is also required to protect access to the shared buffer. Preferably, the synchronization mechanism includes mutex locks, condition variables, and the like. The mutual exclusion lock is used for protecting access to the buffer area and ensuring that only one thread can access the buffer area at the same time; the condition variables are used to wait and wake up a thread when the buffer is empty or full.
The producer-consumer mode can effectively solve the problem of data interaction between the producer and the consumer in the live broadcast flow settlement scene, and the concurrency and throughput of the system are improved.
In some embodiments of the present invention, referring to fig. 2, a traffic settlement method suitable for use in a live scene further includes:
step 500: deploying a plurality of consumers on the container;
Preferably, the container in step 500 is a Docker. In implementation, step 100 is specifically to first create a Docker mirror image: multiple consumers (applications or processing modules) and their dependent software environments are packaged into one Docker image. The Docker image is a read-only template that contains all the components and configurations needed to run the application. Next, write Dockerfile, dockerfile is a text file that defines the Docker mirror build process. In Dockerfile, base images, install software dependencies, copy application code, set environment variables, etc. can be specified. Docker images are built using a Docker command line tool or a Docker graphical interface tool. According to the definition of Dockerfile, the system automatically downloads the base image and performs the build process to generate an executable Docker image.
The Docker mirror image is tested in the local environment, ensuring that the application can run normally in the container. The container may be launched using a Docker command line tool and the application tested by accessing the IP address and port of the container. The constructed Docker image is pushed to a container warehouse for deployment and use in other environments. Docker Hub is a common public container warehouse, and private warehouses such as Docker Registry may also be used.
In the target environment, a Docker command line tool or container orchestration tool (e.g., kubernetes) is used to deploy Docker containers. The Docker mirror may be pulled from the container warehouse and the container run.
In addition, related tools may be used to monitor and manage running containers, such as the Docker command line tools, docker dashboards, kubernetes Dashboard, and the like.
Step 600: the plurality of consumers are registered with nacos registry.
Specifically, a dependency program for nacos is added at each consumer, then Nacos address and registration information are configured in each consumer's application.
In some embodiments of the present invention, referring to fig. 3, step 300 comprises:
step 301: presenting the plurality of consumers to a producer through the nacos registry when the producer is in a different service than the consumers;
step 302: receiving selected results of the producer for the plurality of consumers;
step 303: and sending the flow data acquired from the message middleware to a consumer in a selected result.
In step 301 and step 303, the request across services is exposed to the producer (calling end) via nacos. The back-end service firstly queries redis cache data according to the user request, and if the data is not hit, database query is performed. Considering the part of the computing service that takes longer, the producer sends the message to rocketmq, and the consumer consumes the message in rocketmq to perform the computation, thereby decoupling the production from the consumer.
In some embodiments of the present invention, referring to fig. 4, step 303 comprises:
step 3031: judging whether the ID of the producer in the selected result hits in a cache;
Step 3032: searching the ID of the producer in a preset relational database when the cache does not hit the ID of the producer;
a relational database is a data storage and management database based on a relational model. It organizes data using the structure of tables and rows and uses relationships (i.e., associations between tables) to represent associations between data. The main characteristics of the relational database include:
The data are organized in the form of tables: the data is stored in tables having a predefined structure, each table being made up of columns and rows. Columns in the table define attributes of the data, while rows in the table represent instances of the data.
There is an association between the data: by defining foreign key relationships (ForeignKey), associations can be established between tables. Relational databases use these associations to implement relationships and references between data.
Support the SQL query language: relational databases use Structured Query Language (SQL) for data queries and operations. SQL is a standard database query language that can be used for selecting, inserting, updating, and deleting data.
Support ACID transactions: the relational database provides ACID (atomicity, consistency, isolation, and durability) transaction support. The transaction ensures the integrity and consistency of the data.
Step 3033: and sending the flow acquired from the message middleware to a producer corresponding to the ID.
In some embodiments of the present invention, referring to fig. 5, a method for settling traffic in a live scene, further includes, before step 200:
Step 700: analyzing the flow data to obtain abstract information of the flow data;
Preferably, the summary information in step 700 includes source IP and destination IP, source port and destination port, protocol type, packet length, time stamp.
Step 800: and authenticating the flow data according to the gateway and the abstract information.
Specifically, the gateway authenticates the flow data according to the summary information. Further, authentication rules and policies are configured in the gateway. Gateway tools (e.g., ng nx, kong, spring Cloud Gateway, etc.) may be used to implement gateway functions and configure corresponding authentication policies. In the gateway, abstract information in the traffic data, such as source IP address, destination IP address, protocol type, port number, etc., is extracted. These digest information will be used as a basis for authentication.
And carrying out authentication judgment on the abstract information according to the authentication strategy and the rule. Different authentication rules, such as an IP white list, API access rights, user identity verification and the like, can be defined according to service requirements and security policies.
And determining whether to allow the traffic to pass or not according to the authentication result. If the authentication is successful, the flow is continuously forwarded backwards; if the authentication fails, an error response may be returned, redirected to another page, or other custom operations may be performed.
In addition, related log information including authentication results, time stamps, request sources and the like can be recorded in the authentication process. These logs can be used for monitoring and auditing to help track and analyze the authentication of traffic data.
In a specific embodiment, the invention further provides a specific embodiment of the flow settlement method suitable for the live broadcast scene, which specifically comprises the following steps.
Firstly, the invention provides a flow settlement system suitable for a live broadcast scene, wherein the front end and the rear end of the system are separated. The front-end uses a modern front-end framework (exact, vue or angullar, etc.) responsible for user interface presentation and user interaction. The rear end: the method is developed by using java language and constructed by using Spring Boot, and mainly comprises a Controller (Controller), a Service layer (Service), a persistence layer (persistence), a Model layer (Model) and the like. Load balancing: and load balancing is realized by using the nginx, so that the average distribution of the requests among all nodes in the cluster is ensured, and the availability and performance of the system are improved. Database: mySQL is used as the primary relational database for storing and managing data for applications. Database operations are simplified using SPRING DATA JPA or MyBatis persistent layer frameworks. Message middleware: the integration RocketMQ is used as a message middleware for realizing message communication between distributed systems, decoupling service systems and improving maintainability and expansibility of the systems. And (3) caching: redis is used as cache storage, so that the data reading speed is improved, and the pressure of a database is reduced. And the distributed cache is realized by utilizing the high-performance characteristic of Redis, and the distributed storage and the quick access of the cache data are supported. And (3) containerized deployment: the items are containerized by adopting a Docker, and the whole application and the dependent items thereof are packaged into a container, so that the environment consistency and the rapid deployment are realized. Container orchestration and management using Kubernetes ensures smooth running of applications in clusters. Safety: and realizing a Security authentication and authorization mechanism, and adopting frames such as Spring Security and the like to carry out user identity authentication and authority control. Support mobile end and Web end: the front-end and back-end separated design enables the project to support mobile end and Web end access, and provides services through RESTful API. Monitoring and logging: an integrated monitoring tool (e.g., spring Boot Actuator) enables monitoring and management of applications. Log collection, storage and visual analysis was performed using log management tools such as ELK Stack (ELASTICSEARCH, LOGSTASH, KIBANA). Continuous integration and deployment: continuous integration and deployment is achieved using CI/CD tools (e.g., jenkins, gitLab CI), improving development efficiency and project delivery speed.
Referring to fig. 6, the flow settlement system suitable for the live broadcast scene includes an own flow module, a settlement single management module, an ROI calculation configuration module, a settlement audit module, a nonstandard settlement audit module, a policy entry module, a financial data overview module, a financial data detail module, an account checking overview module, an account checking detail table module, and an account checking abnormal table module.
The self-flow module: the method is used for inputting the generated cost data of each three-party media, and the granularity reaches the month latitude.
And a settlement single management module: used for displaying, newly creating agency media, uploading consumption excel data and producing audit sheets
Specific: the user creates a agency media on the front page of the module, generates agency media records after selecting agency abbreviations, media names, channel names, company main bodies, throwing personnel, settlement classifications (standard and nonstandard), cooperation modes (standard: flow marks, service marks, operation marks; cps, cps, cpa, cpt) and charging modes (fixed and ladder), creates a verification list through the agency media records, after creating a verification single click confirmation, the portal service sends rocketmq information to the computing service, the computing service can call a big data service interface through parameters to pull conversion data within a specified date range, and the computing service can calculate the final settlement amount through own computing logic after taking the conversion data. Selecting a corresponding settlement formula through a settlement bill type, wherein the settlement type is a nonstandard settlement type, the cooperation mode is cpa, and the settlement formula is as follows: final settlement amount = settlement total amount = settlement amount + prize amount = unit price x number of entries (or GMV/reduction ratio) +settlement amount x prize ratio = unit price x number of entries (or GMV/reduction ratio) +unit price x number of entries x prize ratio). If the cooperation mode is cps, the settlement formula is: final settlement amount = settlement total amount = settlement amount + prize amount = conversion amount x return + settlement amount x prize ratio = conversion amount x return + conversion amount x return x prize ratio.
ROI calculation configuration module: for exclusion, some channels are not settled online, i.e. there is no cost, and when calculating the ROI, the channels are excluded, so that a relatively accurate ROI can be calculated.
A settlement auditing module: the module is used for auditing standard statement of financial staff, the module displays the statement after the completion of new calculation in the statement management module, the financial staff can audit and finally determine the settlement amount of the statement, and the bank payment process can be entered after the audit is passed.
Specific: the financial staff enters the module, selects the calculated settlement bill, checks the settlement amount, the final settlement amount and the bank payment amount, and if the check is not passed, the market staff re-processes the settlement bill and then enters the check state again, and after the check is passed, the financial staff can pay for the three-party media.
A nonstandard settlement auditing module: the function of the accounting module is similar to that of the accounting auditing module, and the accounting module is mainly used for financial staff to process nonstandard accounting sheets.
Policy entry module: the module can record CPA-monovalent policy, rewarding policy and CPS-return point policy, and the three policies mainly act on the settlement amount calculation formula to influence the final settlement amount calculation.
Financial data overview module: the service can pull financial data of the three-party media to initialize through a date interval and a media type after clicking the media to initialize. The method is used for inquiring data such as consumption of specified media and specified date range by financial staff.
Financial data detail module: and the system is used for displaying the data such as account consumption, frame return consumption, pay consumption, cash consumption and the like of the designated media account. Different from a financial data overview module, the module consumes and shows the appointed account number of which the granularity can reach the appointed media, and is used for financial staff to inquire the consumption of a certain media delivery account number in the appointed media and other data.
And (5) checking an overview module: the method is used for financial reconciliation, and data such as reconciliation dates, media, the number of reconciliation IDs, total consumption (advertisers), total consumption (plans), reconciliation differences, reconciliation, advertiser single sides, plan single sides, differences, creation dates and the like are displayed.
The account checking detail table module and the account checking exception table module: the method is used for displaying data such as account checking conditions, consumption (advertisers), consumption (plans), account checking difference values, account checking results and the like, and provides a downloading function.
Based on the above-mentioned flow settlement system suitable for live broadcast scene, referring to fig. 7, the embodiment of the invention provides a flow settlement method suitable for live broadcast scene, which comprises the following steps.
S1: acquiring flow data of a plurality of live broadcast users in real time;
S2: analyzing the flow data to obtain abstract information of the flow data;
S3: and authenticating the streaming data according to the gateway and the abstract information.
S4: according to the mode of multiple processes or threads, the flow data is sent to the message middleware;
S5: when the producer and the consumer are in different services, a plurality of consumers are presented to the producer through nacos registry;
s6: receiving a producer's selected results for a plurality of consumers;
s7: judging whether the ID of the producer in the selected result hits in the cache;
s8: searching the ID of the producer in a preset relational database when the cache does not hit the ID of the producer;
s9: and sending the flow acquired from the message middleware to the producer corresponding to the ID.
S10: deploying a plurality of consumers on the container;
s11: a plurality of consumers are registered with nacos registry.
S12: and settling the stream data and transmitting the settlement result to a plurality of live users.
In steps S1 to S12, the user accesses the settlement system item through the mobile terminal or the web, requests authentication through the gateway (Spring Cloud Gateway), and after the authentication, services distributed to each module through the nginx (service modules such as the own traffic module, the settlement management module and the like) are deployed through containerization, the container uses a docker container, and the container management platform uses kubernetes. The services are uniformly registered to nacos, the service call adopts the dubbo technology, and requests related to cross-service are exposed to a calling end through nacos. The back-end service firstly queries redis cache data according to the user request, and if the data is not hit, database query is performed. And part of the calculation service which takes longer time, the producer sends the message to rocketmq, and the consumer consumes the message in rocketmq to calculate, so that the decoupling of production and consumer is achieved. The whole service is monitored for 24 hours, prometheus is used for collecting log data, grafana displays and alarms according to the collected log, and when problems occur in settlement data or media consumption data, the alarms are immediately sent to inform relevant responsible persons of each module.
The data of each media side is pulled from each media open http interface or sdk, the data driving platform is based on xxl-job, the job service has pulling business related to each media financial data, account data and advertisement data, the business is configured on the xxl-job platform in a timing task mode, and the corresponding cron expression is configured for setting the job execution period and the corresponding execution parameters.
S13: and predicting the flow data of the corresponding live user according to the historical data of the flow data.
Specifically, historical traffic data of live users is collected. This may include traffic usage by each user over a particular period of time, such as bandwidth, download speed, upload speed, etc. Preprocessing the collected data. Preferably, the preprocessing process includes data cleansing, missing value processing, outlier detection and processing, and the like. Meaningful features are extracted from the historical traffic data. Preferably, the features include, for example, mean, variance, maximum, minimum, etc., as well as other live traffic specific features such as peak time, user activity, etc.
The collected data is divided into a training set and a test set. Typically, most of the data is used to train the model, and a small portion of the data is used to evaluate the performance of the model. An appropriate machine learning model is selected based on the requirements of the predictive task. Common models include linear regression, decision trees, random forests, neural networks, and the like. The selected model is trained using a training set. The performance of the trained model is evaluated using the test set. Common evaluation criteria include Root Mean Square Error (RMSE), mean Absolute Error (MAE), decision coefficient (R 2), etc. And (5) optimizing the model according to the evaluation result. This may involve adjusting the hyper-parameters of the model, selecting different feature combinations, trying different model algorithms, etc. And predicting the new live user flow data by optimally using the optimized model. The historical data is input into the model, and the flow use condition in a future period of time can be predicted.
The performance of the model is monitored periodically and the model is updated as needed. The behavior and traffic patterns of live users may change over time, thus requiring timely adjustments and updates to the model.
As can be seen from the above description, the embodiment of the present invention provides a traffic settlement method suitable for a live scene, including: firstly, acquiring flow data of a plurality of live broadcast users in real time; then, according to the mode of multiprocessing or multithreading, send the flow data to the message middleware; obtaining flow data from the message middleware according to the producer-consumer model; and finally, settling the stream data and sending the settlement result to a plurality of live broadcast users.
The flow cost settlement system provided by the invention adopts an advanced data acquisition technology, and can accurately track and record the actual use condition of resources. Compared with the traditional manual recording, the automatic method can greatly reduce the risk of calculation errors, and ensures that the cost paid by a user is matched with the actual use amount of the user.
The system adopts an intelligent algorithm and an analysis model, and can predict future resource use conditions according to historical data and trends. This enables the system to provide more accurate cost estimates to the user, helping them make more informed resource allocation decisions. And the bonus and return parameters are added in settlement, so that the enthusiasm and conversion efficiency of the three-party media are effectively improved. The clearing house audit of the invention requires the participation of market and financial staff, saves the communication cost, ensures more strict flow and more transparent and safe approval.
In summary, the flow cost settlement system effectively solves the problems of insufficient accuracy, opaque cost, resource waste and the like in the prior art by innovative technical means. By providing personalized, intelligent and flexible solutions, the invention can bring significant improvements in the fields of resource management and cost allocation, and meet the actual demands of different industries and fields.
Based on the same inventive concept, the embodiment of the application also provides a flow settlement device suitable for a live broadcast scene, which can be used for realizing the method described in the above embodiment, such as the following embodiment. The principle of solving the problem of the flow settlement device suitable for the live broadcast scene is similar to that of the flow settlement method suitable for the live broadcast scene, so that the implementation of the flow settlement device suitable for the live broadcast scene can be realized by referring to the flow settlement method suitable for the live broadcast scene, and repeated parts are not repeated. As used below, the term "unit" or "module" may be a combination of software and/or hardware that implements the intended function. While the system described in the following embodiments is preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
The embodiment of the invention provides a specific implementation manner of a flow settlement device suitable for a live broadcast scene, which can implement a flow settlement method suitable for the live broadcast scene, referring to fig. 8, the flow settlement device suitable for the live broadcast scene specifically comprises the following contents:
the flow data receiving module 10 is used for acquiring flow data of a plurality of live broadcast users in real time;
a flow data sending module 20, configured to send the flow data to a message middleware in a multi-process or multi-thread manner;
a flow data acquisition module 30 for acquiring the flow data from the message middleware according to a producer-consumer mode;
And the traffic settlement module 40 is used for settling the traffic data and sending settlement results to the plurality of live users.
In some embodiments of the present invention, referring to fig. 9, a traffic settlement device suitable for use in a live scene further includes:
a consumer deployment module 50 for deploying a plurality of consumers on a container;
consumer registration module 60 is configured to register the plurality of consumers with nacos registry.
In some embodiments of the present invention, referring to fig. 10, the flow data acquisition module 30 includes:
A consumer presentation unit 30a for presenting the plurality of consumers to the producer through the nacos registry when the producer and the consumers are located in different services;
A selected result receiving unit 30b for receiving selected results of the producer for the plurality of consumers;
and the flow data sending unit 30c is used for sending the flow data acquired from the message middleware to the consumer in the selected result.
In some embodiments of the present invention, referring to fig. 11, the traffic data transmitting unit 30c includes:
a hit determination unit 30c1 for determining in a cache whether the ID of the producer in the selected result hits;
An ID search unit 30c2, configured to search a preset relational database for the ID of the producer when the cache does not hit the ID of the producer;
And a traffic data transmitting subunit 30c3, configured to transmit the traffic acquired from the message middleware to a producer corresponding to the ID.
In some embodiments of the present invention, referring to fig. 12, a traffic settlement device suitable for use in a live scene further includes:
a summary information obtaining module 70, configured to parse the flow data to obtain summary information of the flow data;
and the traffic data authentication module 80 is configured to authenticate the traffic data according to the gateway and the summary information.
As can be seen from the above description, the embodiment of the present invention provides a traffic settlement device suitable for a live broadcast scenario, including: the flow data receiving module is used for acquiring flow data of a plurality of live broadcast users in real time; the flow data sending module is used for sending the flow data to the message middleware in a multi-process or multi-thread mode; the flow data acquisition module is used for acquiring flow data from the message middleware according to the producer-consumer mode; and the flow settlement module is used for settling the flow data and sending the settlement result to a plurality of live broadcast users.
The invention can greatly reduce the risk of traffic settlement errors in a live broadcast scene, ensures that the cost paid by a user is matched with the actual use amount of the traffic settlement errors, has extremely small occupation to the system, and can reasonably use the system resources of a settlement party so as to improve the performance and response speed of the system.
The embodiment of the present application further provides a specific implementation manner of an electronic device capable of implementing all the steps in the flow settlement method applicable to the live broadcast scenario in the foregoing embodiment, and referring to fig. 13, the electronic device specifically includes the following contents:
a processor 1201, a memory 1202, a communication interface (Communications Interface) 1203, and a bus 1204;
Wherein the processor 1201, the memory 1202 and the communication interface 1203 perform communication with each other through the bus 1204; the communication interface 1203 is configured to implement information transmission between the server device and the client device;
The processor 1201 is configured to invoke a computer program in the memory 1202, and when the processor executes the computer program, the processor implements all the steps in the flow settlement method applicable to the live scene in the above embodiment, for example, when the processor executes the computer program, the processor implements the following steps:
step 100: acquiring flow data of a plurality of live broadcast users in real time;
Step 200: sending the flow data to a message middleware in a multi-process or multi-thread mode;
step 300: obtaining the flow data from the message middleware according to a producer-consumer model;
Step 400: and settling the flow data and sending settlement results to the plurality of live broadcast users.
The embodiment of the present application also provides a computer-readable storage medium capable of implementing all the steps in the flow settlement method applicable to a live scene in the above embodiment, and a computer program stored on the computer-readable storage medium, which when executed by a processor implements all the steps in the flow settlement method applicable to a live scene in the above embodiment, for example, the processor implements the following steps when executing the computer program:
step 100: acquiring flow data of a plurality of live broadcast users in real time;
Step 200: sending the flow data to a message middleware in a multi-process or multi-thread mode;
step 300: obtaining the flow data from the message middleware according to a producer-consumer model;
Step 400: and settling the flow data and sending settlement results to the plurality of live broadcast users.
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 hardware+program class embodiment, the description is relatively simple, as it is substantially similar to the method embodiment, as relevant see the partial description of the method embodiment.
The foregoing describes specific embodiments of the present disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
Although the application provides method operational steps as an example or a flowchart, more or fewer operational steps may be included based on conventional or non-inventive labor. The order of steps recited in the embodiments is merely one way of performing the order of steps and does not represent a unique order of execution. When implemented by an actual device or client product, the instructions may be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment) as shown in the embodiments or figures.
For convenience of description, the above devices are described as being functionally divided into various modules, respectively. Of course, when implementing the embodiments of the present disclosure, the functions of each module may be implemented in the same or multiple pieces of software and/or hardware, or a module that implements the same function may be implemented by multiple sub-modules or a combination of sub-units, or the like. The above-described apparatus embodiments are merely illustrative, for example, the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
Those skilled in the art will also appreciate that, in addition to implementing the controller in a pure computer readable program code, it is well possible to implement the same functionality by logically programming the method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers, etc. Such a controller can be regarded as a hardware component, and means for implementing various functions included therein can also be regarded as a structure within the hardware component. Or even means for achieving the various functions may be regarded as either software modules implementing the methods or structures within hardware components.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
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 system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, as relevant to see a section of the description of method embodiments. In the description of the present specification, a description referring to terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the embodiments of the present specification. In this specification, schematic representations of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, the different embodiments or examples described in this specification and the features of the different embodiments or examples may be combined and combined by those skilled in the art without contradiction.
The foregoing is merely an example of an embodiment of the present disclosure and is not intended to limit the embodiment of the present disclosure. Various modifications and variations of the illustrative embodiments will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, or the like, which is within the spirit and principles of the embodiments of the present specification, should be included in the scope of the claims of the embodiments of the present specification.

Claims (13)

1. The flow settlement method suitable for the live broadcast scene is characterized by comprising the following steps of:
acquiring flow data of a plurality of live broadcast users in real time;
Sending the flow data to a message middleware in a multi-process or multi-thread mode;
obtaining the flow data from the message middleware according to a producer-consumer model;
And settling the flow data and sending settlement results to the plurality of live broadcast users.
2. The traffic settlement method suitable for use in a live scene as claimed in claim 1, further comprising:
Deploying a plurality of consumers on the container;
The plurality of consumers are registered with nacos registry.
3. The method for traffic settlement in live scenes according to claim 2, wherein said obtaining said traffic data from said message middleware according to a producer-consumer model comprises:
presenting the plurality of consumers to a producer through the nacos registry when the producer is in a different service than the consumers;
receiving selected results of the producer for the plurality of consumers;
and sending the flow data acquired from the message middleware to a consumer in a selected result.
4. A method of traffic settlement in a live scenario as claimed in claim 3, wherein the step of sending the traffic data obtained from the message middleware to the consumer in the selected result comprises:
Judging whether the ID of the producer in the selected result hits in a cache;
Searching the ID of the producer in a preset relational database when the cache does not hit the ID of the producer;
And sending the flow acquired from the message middleware to a producer corresponding to the ID.
5. The traffic settlement method for live scenarios according to any one of claims 1 to 4, further comprising, before sending the traffic data to a message middleware in a multi-process or multi-threaded manner:
analyzing the flow data to obtain abstract information of the flow data;
and authenticating the flow data according to the gateway and the abstract information.
6. Flow settlement device suitable for under live scene, its characterized in that includes:
the flow data receiving module is used for acquiring flow data of a plurality of live broadcast users in real time;
The flow data sending module is used for sending the flow data to the message middleware in a multi-process or multi-thread mode;
a flow data acquisition module for acquiring the flow data from the message middleware according to a producer-consumer mode;
And the flow settlement module is used for settling the flow data and sending settlement results to the plurality of live broadcast users.
7. The traffic settlement device for use in a live scene as claimed in claim 6, further comprising:
A consumer deployment module for deploying a plurality of consumers on the container;
and the consumer registration module is used for registering the plurality of consumers to a nacos registration center.
8. The traffic settlement device suitable for use in a live scene as claimed in claim 7, wherein the traffic data acquisition module comprises:
a consumer presentation unit for presenting the plurality of consumers to the producer through the nacos registry when the producer and the consumers are located in different services;
a selected result receiving unit configured to receive selected results of the producer for the plurality of consumers;
And the flow data transmitting unit is used for transmitting the flow data acquired from the message middleware to the consumer in the selected result.
9. The traffic settlement device applicable to a live scene as claimed in claim 8, wherein the traffic data transmission unit comprises:
A hit judgment unit configured to judge, in a cache, whether an ID of a producer in the selected result hits;
An ID searching unit, configured to search, when the cache does not hit the ID of the producer, the ID of the producer in a preset relational database;
And the flow data sending subunit is used for sending the flow acquired from the message middleware to the producer corresponding to the ID.
10. The traffic settlement device suitable for use in a live scene as claimed in any one of claims 6 to 9, further comprising:
the abstract information acquisition module is used for analyzing the flow data to acquire abstract information of the flow data;
and the flow data authentication module is used for authenticating the flow data according to the gateway and the abstract information.
11. A computer program product comprising computer programs/instructions which, when executed by a processor, implement the steps of the flow settlement method according to any one of claims 1 to 5 suitable for use in live scenarios.
12. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the flow settlement method according to any one of claims 1 to 5 adapted for use in live scenarios when executing the program.
13. A computer-readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the flow settlement method according to any one of claims 1 to 5, suitable for use in a live scenario.
CN202410071366.1A 2024-01-17 2024-01-17 Flow settlement method and device suitable for live broadcast scene Pending CN118042194A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410071366.1A CN118042194A (en) 2024-01-17 2024-01-17 Flow settlement method and device suitable for live broadcast scene

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410071366.1A CN118042194A (en) 2024-01-17 2024-01-17 Flow settlement method and device suitable for live broadcast scene

Publications (1)

Publication Number Publication Date
CN118042194A true CN118042194A (en) 2024-05-14

Family

ID=90986927

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410071366.1A Pending CN118042194A (en) 2024-01-17 2024-01-17 Flow settlement method and device suitable for live broadcast scene

Country Status (1)

Country Link
CN (1) CN118042194A (en)

Similar Documents

Publication Publication Date Title
US11288142B2 (en) Recovery strategy for a stream processing system
US8812752B1 (en) Connector interface for data pipeline
Wohed et al. Pattern based analysis of BPEL4WS
US9053231B2 (en) Systems and methods for analyzing operations in a multi-tenant database system environment
CN108446975B (en) Quota management method and device
US20190394259A1 (en) Integrating logic in micro batch based event processing systems
CN100594498C (en) Mass data real time processing structure and real time need-based processing platform used for the structure
Prodan et al. Overhead analysis of scientific workflows in grid environments
CN110347719A (en) A kind of enterprise's foreign trade method for prewarning risk and system based on big data
CN109075988A (en) Task schedule and resource delivery system and method
CN112732534B (en) ESB system supporting distributed micro-service
CN112686717B (en) Data processing method and system for advertisement recall
Liu et al. Temporal QoS management in scientific cloud workflow systems
Nobrega et al. LHCb computing technical design report
CN110046974A (en) A kind of bidding for project file assessment system and method
CN102609789A (en) Information monitoring and abnormality predicting system for library
CN102790715B (en) A kind of resource allocation system based on the Internet and method
CN111984677B (en) Resource data checking method, device, computer equipment and storage medium
CN111782262A (en) Data dynamic publishing method, device, system, equipment and storage medium
Uçak et al. A scalable platform for big data analysis in public transport
CN118042194A (en) Flow settlement method and device suitable for live broadcast scene
Alonso et al. Processes in electronic commerce
US11810022B2 (en) Contact center call volume prediction
Laigner et al. A Benchmark for Data Management Challenges in Microservices
Durán et al. Business processes resource management using rewriting logic and deep-learning-based predictive monitoring

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