Broadcasting and television non-intrusive multiplexing cache plug-in

By introducing non-invasive multiplexed cache plug-in in the broadcast and television business system, using Spring AOP and reflection technology, efficient data caching and resource scheduling are achieved, performance bottlenecks and code invasive problems in high concurrency scenarios are solved, and system stability and response speed are improved.

CN120371264APending Publication Date: 2025-07-25华数传媒网络有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510212392.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-25
Publication Date
2025-07-25

AI Technical Summary

Technical Problem

In the high concurrency scenarios, the existing broadcasting and television business systems have problems such as reverse proxy machine performance bottlenecks, high program architecture complexity, strong invasiveness of cache component code, low data update flexibility and poor fault tolerance.

Method used

Spring AOP, annotation and reflection technology is adopted to enhance the original service interface method through a surround entry method to realize the non-invasive cache of data requests. Combined with data pool, resource listener and scheduler, data synchronization and health status monitoring are performed to optimize resource scheduling.

Benefits of technology

Without modifying the business source code, data retrieval capabilities and request response speed are improved, data consistency and high service availability are ensured, program complexity and maintenance costs are reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120371264A_ABST
    Figure CN120371264A_ABST
Patent Text Reader

Abstract

The invention provides a broadcast and television non-intrusive multiplexing cache plug-in, which adopts Spring AOP, annotation and reflection technologies, enhances an original service interface method based on a surrounding cut-in mode, and efficiently retrieves a data cache pool by splicing request parameters as a unique identifier of a queried service request so as to quickly respond to a user request. In addition, the health degree of the data resource service is monitored through a heartbeat mechanism, real-time alarm is performed, health data resources are scheduled preferentially, and high availability of the service is ensured. Resource disaster recovery control is achieved, and normal operation of interface service can be continuously guaranteed; a data asynchronous updating mechanism effectively ensures data consistency; in addition, the plug-in technology has the advantages of being ready to use after being opened, light in weight, free of source code invasion and the like, and the data retrieval capacity and the request response speed of the application can be effectively improved on the premise that service source codes are not modified.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a radio and television service resource scheduling technology, and in particular to a radio and television non-intrusive multiplexing cache plug-in. Background Art

[0002] The broadcasting and television business has strict standards for the response speed of data requests, thereby ensuring users' actual needs for high-definition and stable playback of media assets. In particular, the number of network requests shows a sharp increase in the period after the release of popular content, which places high demands on the broadcasting and television platform's concurrent data reading capabilities.

[0003] At present, the main feasible technologies for realizing the above business requirements are divided into the following categories:

[0004] Reverse proxy: After receiving user requests, the reverse proxy server can distribute user requests according to the performance of the machine where the service is deployed as a weight to achieve load balancing, which can protect business servers to a greater extent in high-concurrency scenarios.

[0005] Redis: A high-performance in-memory data structure storage system, often used as a cache. It provides extremely fast data read and write speeds through in-memory storage and supports a variety of data structures, such as strings, hashes, lists, etc. Redis provides a variety of caching strategies, such as LRU, LFU, and TTL, to help manage the life cycle of data. Its persistence option can restore data after restart, which is suitable for caching needs such as session management, database query acceleration, and real-time data processing.

[0006] Memcache: A high-performance distributed memory object caching system, mainly used to accelerate the access speed of dynamic Web applications and reduce database load. It provides fast data read and write operations by caching data and objects in memory. Memcache uses a simple key-value pair storage method, supports distributed expansion, and is suitable for caching database query results, session data, etc., which can significantly improve system performance and response speed.

[0007] However, the existing methods have the following disadvantages:

[0008] Disadvantage 1: The reverse proxy technology solution requires additional reverse proxy machines and the addition of traffic distribution rules, and will have two impacts: on the one hand, it will increase the complexity of the program architecture and increase the difficulty and cost of program maintenance; on the other hand, a single reverse proxy machine has a performance bottleneck and cannot withstand high concurrent traffic. Although this can be solved by setting up two or even multiple layers of proxies, this will invisibly increase the deployment and maintenance costs of the enterprise.

[0009] Disadvantage 2: After the existing cache component is introduced into the program, it has many advantages in improving system performance and response speed, but there are also some disadvantages. For example: code intrusion, additional coding is required to implement data caching actions and maintain data cache identifiers; low data update flexibility, additional cache logic and mechanisms need to be designed and maintained, such as cache invalidation strategies, data synchronization mechanisms, etc.; low fault tolerance, when the cache service is unavailable, it cannot effectively maintain or quickly restore the normal operation of the business interface. Summary of the Invention

[0010] In order to overcome the deficiencies of the prior art, the present invention provides a non-intrusive multiplexing cache plugin for radio and television.

[0011] In order to achieve the above object, a non-intrusive multiplexing cache plugin for radio and television provided by the present invention includes:

[0012] Plugin interface, when a label Spring AOP aspect is set on the business method entry, based on the received data request, the data request is spliced into a unique identifier of the business request according to the set rules, and the corresponding business data is read based on the unique identifier of the business request and fed back to the business method entry through the Java reflection mechanism;

[0013] Data pool, including a data cache pool and a data resource pool, for storing business data of multiple data sources, and the data sources perform data synchronization through a data synchronizer;

[0014] Resource listener, used to monitor the health status of the data pool and send the health status of the data resource to the resource scheduler;

[0015] Resource scheduler, based on the health status of the data resource pool, performs disaster tolerance, priority, and data timeliness control on the resources to complete resource scheduling.

[0016] Preferably, if the label Spring AOP aspect is not configured on the business method, the business data is read from the data resource pool based on the MVC three-layer architecture mode to respond to the user request; if the label Spring AOP aspect is configured, the business data is read from the data resource pool for the first request and written into the data cache pool, and subsequent requests directly read from the data cache pool.

[0017] Preferably, if the target business data in the data cache pool does not exist or has expired, the business data is read in the way that the label Spring AOP aspect is not configured, and the result is stored in the data cache pool.

[0018] Preferably, the data pool manages multiple data sources in the pool in the form of a Map<key, ConnectionVo> structure, where key is the unique name of the data source and ConnectionVo is the connection object; the data synchronizer updates business data asynchronously.

[0019] Preferably, the process of the resource scheduler performing resource disaster tolerance control is: selecting a data source link based on the health status of the data resource.

[0020] Preferably, the process of the resource scheduler performing priority control is: sorting the data sources based on the health status of the data sources, and preferentially scheduling the data source link with the best health status.

[0021] Preferably, the process of the resource scheduler performing timeliness control is:

[0022] Annotate the two input time parameters and use them as the return value of the business method;

[0023] When the return value contains business data, use the larger time parameter as the expiration identifier, and store the business data in the cache pool for quick return of requests;

[0024] When the return value does not contain business data, write a null value identifier to the cache pool.

[0025] A non-intrusive multiplexing cache plugin for radio and television provided by the present invention has the following beneficial effects compared with the prior art:

[0026] 1. This cache plugin has the advantages of being ready to use out of the box, not increasing program complexity, low coupling degree, and being lightweight. For the business situation of the radio and television industry with a prime viewing period, without modifying the original business code, the cache action of the interface response data can be easily implemented, greatly improving the concurrency of the interface.

[0027] 2. This cache plugin can access multiple data sources simultaneously, greatly improving the availability of data services. In addition, a resource listener is introduced to monitor the health status of the data sources and report it to the resource scheduler, and load balancing of data reading is achieved based on the health status, effectively protecting the stability of the data resource service in high-concurrency scenarios.

[0028] 3. A data synchronizer is built into the cache plugin to achieve data synchronization between data sources, thereby ensuring data consistency among multiple data sources. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 It is a flowchart of scheduling data resources of a non-intrusive multiplexing cache plugin for radio and television provided by the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0030] The following describes the implementation modes of the present invention through specific examples. Those skilled in the art can easily understand the other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific implementation modes. All details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that, without conflict, the following embodiments and the features in the embodiments can be combined with each other.

[0031] Term Explanation:

[0032] Spring AOP: The full name is Aspect Orient Programming, translated as Aspect-Oriented Programming, which is a technology that can dynamically and uniformly add additional functions to a program without modifying the source code. Usability: The degree to which a software system can be operated and accessed when it is put into use, or the probability of realizing its specified system functions. High concurrency: The ability of a system to process multiple requests in parallel at the same time.

[0033] As Figure 1 shown, a non-intrusive multiplexing cache plugin for radio and television provided by the present invention includes:

[0034] A plugin interface. When a label Spring AOP aspect is set at the business method entry, based on the received data request, the data request is concatenated into a unique identifier of the business request according to the set rules, and the corresponding business data is read based on the unique identifier of the business request and fed back to the business method entry through the Java reflection mechanism;

[0035] A data pool, including a data cache pool and a data resource pool, for storing business data of multiple data sources, and data synchronization between the data sources is performed through a data synchronizer;

[0036] A resource listener, used to monitor the health status of the data pool and send the health status of the data resources to the resource scheduler;

[0037] A resource scheduler, based on the health status of the data resource pool, performs disaster tolerance, priority, and data timeliness control on the resources to complete resource scheduling.

[0038] The present invention is a lightweight non-intrusive multiplexing cache plugin developed by custom coding. By setting three key components, namely a resource scheduler, a resource listener, and a data synchronizer, the plugin can perform real-time resource health monitoring, disaster tolerance control, and data asynchronous update. In the business scenario where radio and television industry users frequently request media asset data, by applying this cache plugin, it can non-intrusively and friendly to the source code achieve a quick return of user requests and improve the concurrency of the interface.

[0039] The lightweight non-invasive multi-channel caching plugin developed by custom coding adopts Spring AOP, annotation and reflection technologies. Based on the around advice method, it enhances the original service interface method. By splicing the request parameters as the business identifier for query (i.e., the unique business request identifier), it efficiently retrieves the data cache pool and then quickly responds to user requests. In addition, through the heartbeat mechanism (dynamic load balancing scheduling strategy), it monitors the health of the data resource service, gives real-time alarms, preferentially schedules healthy data resources to ensure high availability of the service; has resource disaster tolerance control to continuously ensure the normal operation of the interface service; and has a data asynchronous update mechanism to effectively ensure data consistency. This plugin technology has the characteristics of being ready to use, lightweight and source code non-invasive, and can effectively improve the data retrieval ability and request response speed of the application without modifying the business source code.

[0040] Specifically as follows:

[0041] In terms of business methods, by configuring the AOP aspect entry in the plugin interface annotation, it is spliced based on the rule of key = "unique business request identifier" = "business method" + "business parameters", and then the return result is encapsulated into a Value object, and then the data is stored in the data cache pool in the <key, value> structure. By splicing different request participants into a unique identifier, it can flexibly cache multiple return data according to different requests.

[0042] Specifically, the AOP aspect intercepts the user request at the business method entry, and splices the request data at the business method entry into a key (unique business request identifier) according to a unified rule. Use the key to call the cache plugin. If the data exists in the data cache pool, the target method is not called, and the user request is directly responded; otherwise, the target method is called, the response result is first saved to the cache pool, and then the user request is responded, so as to cache various return data according to different requests.

[0043] Among them, AOP aspect: is a technology that dynamically and uniformly adds additional functions to the program without modifying the source code. Reflection mechanism: Java reflection is a mechanism that allows a program to inspect and operate on the internal structure of a class at runtime. It can dynamically obtain the type, attributes and behaviors of an object, and can create an instance or call a method without knowing the specific class. Reflection is mainly used in some dynamic operation scenarios, such as automatically handling dependency relationships in frameworks, or handling tasks that require flexibility. Business method entry: refers to the starting point of the method or function responsible for handling specific business logic in the application. This entry is the first step in the execution of business logic, usually used to distribute tasks, call other services or handle the core business process.

[0044] Multiple data sources can be integrated inside the plug-in. The plug-in manages multiple data sources in the data pool in the form of Map<key, ConnectionVo>. Here, key is the unique name of the data source, and ConnectionVo is the connection object containing information such as "IP address", "port", and "health status", effectively improving the availability of the data source. And data synchronization is achieved between multiple data sources through a synchronizer. Taking the data resource pool and the data cache pool as examples, when data is updated, data synchronization is achieved between them through the asynchronous method in the data synchronizer, thus ensuring data consistency. The reason for adopting the asynchronous method is that this method does not block data access and achieves data synchronization at a relatively small cost to the business. In addition, each data synchronization by the data synchronizer will generate a synchronized data object containing "unique ID", "creation time", "data", and "MD5 value of the data". During the data synchronization process, the ID, "data", and MD5 value of the synchronized data are all verified for consistency to ensure data consistency.

[0045] A resource listener is embedded inside the plug-in to detect the health status of multiple data sources and report the detection results to the resource scheduler to provide a scheduling basis for it.

[0046] Among them, the resource scheduler in the plug-in has functions of resource disaster tolerance control, priority control, and data timeliness control, which can be manifested as:

[0047] a. Implement resource disaster tolerance control and priority scheduling based on the health of data resources, automatically switch data sources, flexibly select data source connections, and achieve rapid response of the interface.

[0048] Among them, the resource disaster tolerance control is: select the data source connection based on the health status of the data resource, and the failed data sources will be automatically excluded during this selection process. Compared with the existing technology, the advantages of this method are: 1. The detection times for determining whether a data source is alive can be customized, greatly reducing the misjudgment rate and effectively improving the accuracy of judgment. 2. Failed data sources can be automatically excluded: when a data source is still found to be down after being probed for a pre-configured or default number of times, it will be excluded from the data resource pool. 3. Recovered data sources are automatically added: when a failed data service is restored through manual operation, it will be automatically added to the data resource pool. 4. Fine-grained data timeliness control, which is manifested as the effective time for a single cached data and preventing cache breakdown can be manually configured.

[0049] Compared with the existing technology for this resource disaster tolerance control method, the existing technology only achieves disaster tolerance control in the form of a homogeneous cache database cluster, while the present invention adds support for heterogeneous cache databases on the basis of homogeneity.

[0050] Similarly, the present invention sorts data sources in descending order based on their health status, and preferentially schedules the data source links with the best health status, thereby ensuring the fast response of the interface. When performing resource scheduling, the present invention adopts a dynamic load balancing scheduling strategy. Compared with the prior art, the general priority scheduling strategy is a static strategy, which performs resource scheduling according to pre-configured weights and cannot be adjusted according to the health status of resources. In contrast, the present invention uses the method of "weight + the number of existing links of the data source" to jointly determine the priority.

[0051] b. Fine-grained data timeliness control, which is reflected in the ability to manually configure the effective time of a single cached data and prevent cache penetration.

[0052] Specifically, two time parameters (one larger and one smaller) are respectively passed in through annotation parameters and applied to the return value of the business method. When the return value contains business data, the larger time parameter is used as the expiration identifier, and the business data is stored in the cache for quick return of requests. When the return value does not contain business data, a "null value identifier" is written into the cache pool to prevent a large amount of traffic from surging into the database in a short period due to cache penetration, resulting in downtime.

[0053] The way the present invention schedules data resources is as follows:

[0054] 1. If no tag aspect is configured at the entrance of the business method, that is, this cache plugin is not used for this interface, then based on the MVC three-layer architecture method, business data is read from the data resource pool.

[0055] 2. If a tag aspect has been configured at the entrance of the business method, the request parameters are concatenated according to a unified rule as the cache identifier, and business data is directly read from the data cache pool based on this identifier.

[0056] 3. If the target business data in the data cache pool does not exist or has expired, the method in step 1 is used to read the business data, and the result is stored in the data cache pool.

[0057] In the present invention, the cache plugin user can access a visualization tool to monitor the health status of the data service (such as the number of active links, throughput, average response time, etc.) in real time, and can additionally add email / sms notifications to provide resource warning services for later operation and maintenance.

[0058] The multiplexing cache plugin is produced in the form of a jar package, supports mainstream Spring projects (other projects can be correspondingly transformed), and can be adapted to most current business platform projects, including but not limited to the following scenarios: database query cache, API request cache, session cache, improving the availability of data resource services.

[0059] Developers do not need to learn the implementation principle and code logic of the plugin, and can use it out of the box with almost zero cost. The functions of the plugin can be simply summarized as follows: adding an annotation to the interface method and adding a cache data identifier to the method formal parameter, then the cache plugin can be easily integrated. Among them, the cache data identifier is obtained by splicing according to the unified rule based on the request parameters. The cache plugin has no intrusion into the original business code, and the integration process is smooth. Without additional coding and without increasing the program complexity, the cache function is added to the original interface, and the asynchronous refresh time of the cache data can be customized.

[0060] In summary, the principle of a non-intrusive multiplexing cache plugin for radio and television provided by the present invention can be understood as follows:

[0061] 1) Plugin cache principle: The plugin encapsulates the cache logic through the Java reflection mechanism and encapsulates the cache code into the "spring @ cache tag plugin"; the plugin is introduced by automatically scanning and parsing the "@ cache tag plugin" through spring AOP. Finally, the "@ cache tag plugin" is non-intrusive to the business.

[0062] 2) Data multiplexing cache: Assemble the business request parameters into a key, assemble the business data return into a value, and store the data in the form of a key-value pair. Listen to multiple paths of data such as mysql, redis, and JVM, and retrieve and store available data according to the priority.

[0063] 2) Plugin execution process: The entire business logic is executed in the way of Java reflection.

[0064] 3) Plugin introduction method: Introduce it in the form of "@ cache tag plugin", and automatically parse the introduction of the cache by parsing this tag through the spring AOP mechanism.

[0065] When performing data scheduling, if the "@ cache tag plugin" is not configured for the business method, the cache will not take effect; if the "@ cache tag plugin" is added to the business method, the cache will take effect. Spring AOP will parse the "@ cache tag plugin" and automatically execute the read and write logic of the multiplexing cache in the plugin without adding additional cache code, which is plug-and-play.

[0066] Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

Claims

1. A non-invasive multiplexing cache plugin for radio and television, characterized in that Including: A plug-in interface. When a Spring AOP aspect label is set on the business method entry, based on the received data request, the data request is concatenated into a unique identifier of the business request according to the set rules, and the corresponding business data is read based on the unique identifier of the business request and fed back to the business method entry through the Java reflection mechanism; A data pool, including a data cache pool and a data resource pool, for storing business data of multiple data sources, and the data sources are synchronized through a data synchronizer; A resource listener, for monitoring the health status of the data pool and sending the health status of the data resources to the resource scheduler; A resource scheduler, based on the health status of the data resource pool, performs disaster tolerance, priority, and data timeliness control on the resources to complete resource scheduling.

2. The non-invasive multiplexing cache plug-in for radio and television according to claim 1, wherein If the Spring AOP aspect label is not configured on the business method, the business data is read from the data resource pool based on the MVC three-layer architecture mode to respond to the user request; if the Spring AOP aspect label is configured, the business data is read from the data resource pool for the first request and written into the data cache pool, and subsequent requests are directly read from the data cache pool.

3. The non-invasive multiplexing cache plugin for radio and television according to claim 2, characterized in that, If the target business data in the data cache pool does not exist or has expired, the business data is read in the way of not configuring the Spring AOP aspect label, and the result is stored in the data cache pool.

4. The non-invasive multiplexing cache plug-in for radio and television according to claim 1, characterized in that, The data pool manages multiple data sources in the pool in the form of Map<key,ConnectionVo>, where key is the unique name of the data source and ConnectionVo is the connection object; the data synchronizer updates the business data asynchronously.

5. The non-intrusive multiplexing cache plugin for radio and television according to claim 1, characterized in that The process of the resource scheduler performing disaster tolerance control on resources is: selecting a data source link based on the health status of the data resources.

6. The non-intrusive multiplexing cache plug-in for radio and television according to claim 1, characterized in that The process of the resource scheduler performing priority control is: sorting the data sources based on the health status of the data sources, and preferentially scheduling the data source link with the best health status.

7. The non-invasive multiplexing cache plugin for radio and television according to claim 1, wherein The process of the resource scheduler performing timeliness control is: Annotating two input time parameters as the return value of the business method; When the return value contains business data, the larger time parameter is used as the expiration identifier, and the business data is stored in the cache pool for quick return of requests; When the return value does not contain business data, a null value identifier is written into the cache pool.