Universal multi-social media platform data processing architecture setting method and device
By setting abstract classes and derived resource classes in the data processing architecture of the social media platform, calculating performance indicators and dynamically instantiating client classes, problems such as data consistency and performance bottlenecks in the existing technology are solved, and a high-performance, flexible and secure data processing architecture is realized.
Patent Information
- Application Number
- CN202510000030.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-01
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2045-01-01
AI Technical Summary
The existing social media platform data processing architecture has data consistency problems, performance bottlenecks, high complexity, large resource consumption and lack of flexibility, making it difficult to meet the needs of high performance, scalability and security.
By setting up the BaseClient abstract class and BaseResource abstract class, derived resource classes applied to social media platforms are derived, and performance indicators are calculated based on the call frequency, response time and parallel processing capabilities, dynamically instantiate the unified client class, generate data call interfaces, and realize intelligent selection and load balancing of cross-platform resources.
It improves system performance and user experience, enhances system flexibility and scalability, improves system security and reliability, and simplifies development and maintenance work.
Smart Images

Figure CN119376984B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a method, device and electronic device for setting a universal multi-social media platform data processing architecture. Background Art
[0002] The data processing architecture of a social media platform refers to the data processing architecture designed to support the operation of social media websites or applications. This architecture needs to be able to handle a large amount of user-generated content, real-time data streams, social interactions, and data analysis, while ensuring high performance, scalability, and security of the system. The data processing architecture of a social media platform usually includes:
[0003] 1. Data ingestion layer: responsible for receiving data from different sources (such as users' posts, comments, likes, etc.) and storing it after preliminary processing.
[0004] 2. Data storage system: including database and file system, used to store structured and unstructured data.
[0005] 3. Real-time processing system: such as Apache Kafka, Apache Storm or Apache Flink, used to process real-time event streams, such as message push notifications, trend topic calculations, etc.
[0006] 4. Batch processing systems: such as Hadoop MapReduce or Spark, used to perform long-running tasks such as offline data analysis, machine learning model training, etc.
[0007] 5. Search and indexing services: such as Elasticsearch or Solr, which provide fast full-text search capabilities, allowing users to easily find content.
[0008] 6. Cache mechanism: Use tools such as Redis and Memcached to reduce the pressure on the backend database and improve response speed.
[0009] 7.API Gateway: Serves as a bridge between the client and the server, managing request routing, load balancing, authentication and other functions.
[0010] The existing technology has the following defects in the development process of social media platform data processing architecture settings:
[0011] 1. Data consistency issues:
[0012] Social media platforms often use distributed systems to store massive amounts of data. However, the characteristics of distributed systems may lead to data consistency issues, especially when making a trade-off between real-time and eventual consistency. For example, in the Lambda architecture, data synchronization between the batch layer and the speed layer may lead to temporary data inconsistency.
[0013] 2. Performance bottleneck:
[0014] As the number of users grows and the frequency of social interactions increases, the data processing architecture may encounter performance bottlenecks, especially during peak hours or under burst traffic. This may affect the user experience, such as increased latency and longer response times.
[0015] 3. High complexity:
[0016] Building an efficient and scalable data processing architecture requires the integration of multiple technology stacks, including but not limited to real-time stream processing, batch processing, message queues, database management, etc. Such complexity increases the difficulty of development and increases operation and maintenance costs.
[0017] 4. High resource consumption:
[0018] Large-scale data processing tasks require a lot of computing resources, including CPU, memory, disk I / O, etc. For small and medium-sized enterprises, the high cost may be unbearable.
[0019] 5. Lack of Flexibility:
[0020] Some traditional architecture designs are too rigid and difficult to quickly adapt to the needs of emerging technologies and business changes. For example, the process of switching from batch processing to stream processing may involve a lot of code refactoring and technology selection adjustments.
[0021] The above problems become technical problems that need to be solved. Summary of the invention
[0022] In view of this, embodiments of the present invention provide a universal multi-social media platform data processing architecture setting method, device and electronic device, which at least partially solve the problems existing in the prior art.
[0023] In a first aspect, an embodiment of the present invention provides a general method for setting a multi-social media platform data processing architecture, including:
[0024] Set a BaseClient abstract class and a BaseResource abstract class, wherein the BaseClient abstract class is used to encapsulate the operation interface of a general client, and the BaseResource abstract class is used to define a resource operation interface that is independent of the social media platform;
[0025] Based on the BaseResource abstract class, derived resource classes applied to social media platforms are derived, each of which contains data processing logic required for interacting with the corresponding social media platform, and the data processing logic calculates a first performance indicator Pf of each derived resource class based on a call frequency Fd, a response time Tr, and a parallel processing capability Pc;
[0026] Create a unified client class Client inherited from the BaseClient abstract class, the unified client class includes n social media platform resource objects, dynamically instantiate the n social media platform resource objects included in the unified client class using a factory pattern, and calculate a second performance indicator Ps of the social media platform resource objects based on the data transmission rate Ts, memory usage Mu, network delay Ds, and resource allocation efficiency Ef of the social media platform resource objects;
[0027] Generate a signature random number Qs for each derived resource class based on the task complexity Tf, resource availability Rz and mapping function fy, digitally sign n social media platform resource objects based on the random number Qs, and generate a data call interface J={J1, J2, …Jn} for n social media platform resource objects based on the digital signature;
[0028] When a call request Qr for a social media platform resource is received, m resource interfaces J'={J'1,J'2,…J'm} corresponding to the call request Qr are generated based on the first performance indicator Pf, the second performance indicator Ps and the data call interface J, where m≤n, to implement calls with the same name on resources of different social media platforms, so that users can interact with different social media platforms in the same way.
[0029] According to a specific implementation of an embodiment of the present invention, the setting of the BaseClient abstract class and the BaseResource abstract class includes:
[0030] Determine common operations that all clients need to perform, the common operations including: connecting, disconnecting, sending requests, and receiving responses;
[0031] Identify shared attributes of all clients, including configuration parameters, status information, and authentication credentials, and define access methods for shared attributes;
[0032] Extension points are set by defining hook methods, and subclasses add specific behaviors through the extension points.
[0033] According to a specific implementation of an embodiment of the present invention, the setting of the BaseClient abstract class and the BaseResource abstract class further includes:
[0034] Define a set of platform-independent operation interfaces based on the characteristics of different social media platforms;
[0035] Determine in BaseResource what subclasses can adjust or override based on actual conditions;
[0036] Plan the lifecycle management of the BaseResource resource class, including the initialization, configuration, use, and destruction phases, and clarify the tasks performed by the BaseResource resource class in each phase and how it interacts with the external environment.
[0037] According to a specific implementation of an embodiment of the present invention, the data processing logic calculates the first performance indicator Pf of each derived resource class based on the call frequency Fd, the response time Tr and the parallel processing capability Pc, including:
[0038] Calculate the call frequency Fd:
[0039]
[0040] k is the number of observed events, λ1 is the average occurrence rate;
[0041] Calculate the response time Tr:
[0042]
[0043] L is the average number of requests in the system, λ2 is the request arrival rate;
[0044] Calculate the parallel processing capacity Pc:
[0045]
[0046] p is the parallelizable part of the program, and s is the speedup ratio.
[0047] According to a specific implementation of an embodiment of the present invention, the data processing logic calculates the first performance indicator Pf of each derived resource class based on the call frequency Fd, the response time Tr and the parallel processing capability Pc, and further includes:
[0048] Set the calculation formula for the first performance indicator Pf:
[0049]
[0050] Np is the total number of events observed in a specific time period, Fdi represents the frequency of the ith call, and α1, β1, γ1, δ1 are weight coefficients.
[0051] According to a specific implementation of an embodiment of the present invention, the second performance indicator Ps of the social media platform resource object is calculated based on the data transmission rate Ts, memory usage Mu, network delay Ds and resource allocation efficiency Ef of the social media platform resource object, including:
[0052] Calculate the data transmission rate Ts:
[0053]
[0054] B is the bandwidth, S / N is the signal-to-noise ratio;
[0055] Calculate the memory usage Mu:
[0056] Mu
[0057] U is the used memory and T is the total memory;
[0058] Calculate network delay Ds:
[0059] Ds=Dp+Dq
[0060] Dp is the propagation delay, Dq is the queue delay;
[0061] Calculate resource allocation efficiency Ef:
[0062]
[0063] Cc is the amount of work done and Tz is the total time.
[0064] According to a specific implementation of an embodiment of the present invention, the second performance indicator Ps of the social media platform resource object is calculated based on the data transmission rate Ts, memory usage Mu, network delay Ds and resource allocation efficiency Ef of the social media platform resource object, and further includes:
[0065] Set the calculation formula for the second performance indicator Ps:
[0066]
[0067] w1, w2, w3, w4 are weight coefficients, Bmax and Emax are the maximum data transmission rate and maximum resource allocation efficiency respectively, η1, η2 are power parameters, γ2 and β2 are parameters in the exponential decay function, which are used to adjust the impact of Mu and Ds on performance.
[0068] According to a specific implementation of an embodiment of the present invention, the generating of m resource interfaces J'={J'1, J'2, ... J'm} corresponding to the calling request Qr based on the first performance indicator Pf, the second performance indicator Ps and the data calling interface J includes:
[0069] Determine all social media platform resource objects managed by the unified client class Client in the current system;
[0070] Construct a comprehensive calculation formula:
[0071] Stotal=w5⋅Pf+w6⋅Ps
[0072] W5 and w6 are weight coefficients;
[0073] Sort all resource objects according to the comprehensive score Stotal and select the top m resource objects with the highest scores;
[0074] For the selected m resource objects, based on their data call interfaces, a new interface set J′={J1′,J2′,…,Jm′} is generated, where Ji′ contains URL path, request parameters, authentication token, etc., which are used to interact with the corresponding resource objects;
[0075] adding metadata for each interface, the metadata including a performance score, an estimated response time, and an expected throughput;
[0076] The generated J′ is returned to the caller as a resource interface option for processing the call request Qr.
[0077] In a second aspect, an embodiment of the present invention provides a general multi-social media platform data processing architecture setting device, including:
[0078] A setting module is used to set a BaseClient abstract class and a BaseResource abstract class. The BaseClient abstract class is used to encapsulate the operation interface of a general client, and the BaseResource abstract class is used to define a resource operation interface that is not related to a social media platform.
[0079] A derivation module, based on the BaseResource abstract class, derives derived resource classes applied to social media platforms, each derived resource class includes data processing logic required for interacting with the corresponding social media platform, and the data processing logic calculates a first performance indicator Pf of each derived resource class based on a call frequency Fd, a response time Tr, and a parallel processing capability Pc;
[0080] A creation module is provided to create a unified client class Client inherited from the BaseClient abstract class, wherein the unified client class includes n social media platform resource objects, and the n social media platform resource objects included in the unified client class are dynamically instantiated using a factory mode, and a second performance indicator Ps of the social media platform resource objects is calculated based on the data transmission rate Ts, memory usage Mu, network delay Ds, and resource allocation efficiency Ef of the social media platform resource objects;
[0081] A generation module generates a signature random number Qs for each derived resource class based on the task complexity Tf, resource availability Rz and mapping function fy, digitally signs n social media platform resource objects based on the random number Qs, and generates a data call interface J={J1, J2, …Jn} for n social media platform resource objects based on the digital signature;
[0082] The execution module, when receiving a call request Qr of a social media platform resource, generates m resource interfaces J'={J'1,J'2,…J'm} corresponding to the call request Qr based on the first performance indicator Pf, the second performance indicator Ps and the data call interface J, where m≤n, to implement the same-name call on resources of different social media platforms, so that users can interact with different social media platforms in the same way.
[0083] In a third aspect, an embodiment of the present invention further provides an electronic device, the electronic device comprising:
[0084] at least one processor; and,
[0085] a memory communicatively connected to the at least one processor; wherein,
[0086] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the general multi-social media platform data processing architecture setting method in any of the aforementioned first aspects or any of the implementations of the first aspect.
[0087] In a fourth aspect, an embodiment of the present invention further provides a non-transitory computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable the computer to execute the general multi-social media platform data processing architecture setting method in the aforementioned first aspect or any implementation of the first aspect.
[0088] In a fifth aspect, an embodiment of the present invention further provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer executes the general multi-social media platform data processing architecture setting method in the aforementioned first aspect or any implementation of the first aspect.
[0089] The general multi-social media platform data processing architecture setting scheme in the embodiment of the present invention includes: setting a BaseClient abstract class and a BaseResource abstract class, wherein the BaseClient abstract class is used to encapsulate the operation interface of the general client, and the BaseResource abstract class is used to define the resource operation interface independent of the social media platform; based on the BaseResource abstract class, deriving a derived resource class applied to the social media platform, each derived resource class contains the data processing logic required for interacting with the corresponding social media platform, and the data processing logic calculates the first performance indicator Pf of each derived resource class based on the call frequency Fd, the response time Tr and the parallel processing capability Pc; creating a unified client class Client inherited from the BaseClient abstract class, the unified client class contains n social media platform resource objects, and the factory mode is used to dynamically instantiate the n social media platform resource objects contained in the unified client class. Social media platform resource objects, based on the data transmission rate Ts, memory usage Mu, network delay Ds and resource allocation efficiency Ef of the social media platform resource objects, calculate the second performance indicator Ps of the social media platform resource objects; generate the signature random number Qs of each derived resource class based on the task complexity Tf, resource availability Rz and mapping function fy, digitally sign the n social media platform resource objects based on the random number Qs, and generate the data call interface J={J1,J2,…Jn} of the n social media platform resource objects based on the digital signature; when receiving the call request Qr of the social media platform resource, based on the first performance indicator Pf, the second performance indicator Ps and the data call interface J, generate the m resource interfaces J'={J'1,J'2,…J'm} corresponding to the call request Qr, m≤n, to realize the same name call on different social media platform resources, so that users can interact with different social media platforms in the same way. This scheme has the following beneficial effects:
[0090] 1. Improve system performance
[0091] By calculating the first performance index Pf and the second performance index Ps, the system can intelligently select the resource object that is most suitable for processing a specific request, thereby ensuring efficient data processing and response speed. The selection mechanism based on performance indicators helps to achieve more reasonable load distribution, avoid overloading some resources while other resources are idle, and improve the overall system throughput.
[0092] 2. Enhance user experience
[0093] By defining a unified method signature and implementing a dynamic distribution mechanism, users can interact with different social media platforms in the same way, simplifying the operation process and improving user satisfaction. The optimized resource selection and calling mechanism reduces response time and provides a smoother user experience.
[0094] 3. Increase system flexibility and scalability
[0095] The design of the abstract base class makes it easy to add new platforms, and new platforms can be seamlessly integrated without modifying existing code, reducing maintenance costs. The factory mode is used to dynamically instantiate resource objects, which can flexibly load and manage different social media platform resources as needed to adapt to changing needs.
[0096] 4. Improve system security and reliability
[0097] By generating a random number Qs and digitally signing each resource object, the security of the data call interface is ensured to prevent unauthorized access and tampering. Continuous monitoring of performance indicators Pf and Ps can help identify potential performance bottlenecks or failure points, take measures in advance to prevent problems, and improve system reliability.
[0098] 5. Simplify development and maintenance
[0099] The structured design of abstract base classes and derived classes provides a clear interface definition, making it easier for the development team to understand and implement specific business logic. By defining hook methods and reserving extension points, developers can easily add new features or adjust behaviors without destroying existing functions, simplifying development and maintenance. BRIEF DESCRIPTION OF THE DRAWINGS
[0100] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0101] Figure 1A schematic flow chart of a method for setting a universal multi-social media platform data processing architecture provided by an embodiment of the present invention;
[0102] Figure 2 A schematic flow chart of another general method for setting a multi-social media platform data processing architecture provided by an embodiment of the present invention;
[0103] Figure 3 A schematic diagram of a general multi-social media platform data processing architecture configuration device provided by an embodiment of the present invention;
[0104] Figure 4 A schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0105] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0106] The following describes the embodiments of the present disclosure through specific examples, and those skilled in the art can easily understand other advantages and effects of the present disclosure from the contents disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all of the embodiments. The present disclosure can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present disclosure. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present disclosure.
[0107] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein may be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on the present disclosure, it should be understood by those skilled in the art that an aspect described herein may be implemented independently of any other aspect, and two or more of these aspects may be combined in various ways. For example, any number of aspects described herein may be used to implement the device and / or practice the method. In addition, other structures and / or functionalities other than one or more of the aspects described herein may be used to implement this device and / or practice this method.
[0108] It should also be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present disclosure. The drawings only show components related to the present disclosure rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0109] Additionally, in the following description, specific details are provided to facilitate a thorough understanding of the examples. However, it will be understood by those skilled in the art that the aspects described may be practiced without these specific details.
[0110] The embodiment of the present disclosure provides a general method for setting a multi-social media platform data processing architecture. The general method for setting a multi-social media platform data processing architecture provided in this embodiment can be executed by a computing device, which can be implemented as software, or as a combination of software and hardware, and the computing device can be integrated in a server, terminal device, etc.
[0111] See also Figure 1 and Figure 2 The present disclosure provides a general method for setting a multi-social media platform data processing architecture, including:
[0112] S101, setting a BaseClient abstract class and a BaseResource abstract class, wherein the BaseClient abstract class is used to encapsulate an operation interface of a general client, and the BaseResource abstract class is used to define a resource operation interface that is independent of a social media platform.
[0113] In the process of setting up the BaseClient abstract class, you can encapsulate the operation interface of the common client: define the basic operations that all clients need to implement, such as connecting, disconnecting, sending requests, receiving responses, etc. You can identify and list the common operations that all clients may need to perform. Define these operations as abstract methods to ensure that each specific client class must provide a specific implementation.
[0114] Identify properties that all clients may share, such as configuration parameters (such as API keys), state information (such as connection status), and authentication credentials. Define getter and setter methods for these properties so that subclasses can access and modify them. Allow subclasses to add specific behavior or logic as needed by defining hook methods or leaving methods unimplemented. These extension points can be used to handle special cases or enhance functionality.
[0115] In the process of setting the BaseResource abstract class, you can define resource operation interfaces that are independent of social media platforms: create a set of standard operation interfaces that are applicable to specific resource classes of different social media platforms while maintaining interface consistency.
[0116] Define a set of common operation interfaces according to the characteristics of different social media platforms, such as obtaining page details, obtaining a list of followed users, publishing content, etc. Define these operations as abstract methods to ensure that any class derived from BaseResource must implement the specific logic of these operations.
[0117] Design a standard data structure or model to represent data obtained from various platforms. This helps ensure that data obtained from different platforms can be processed and displayed in a consistent manner.
[0118] In BaseResource, clearly indicate which aspects are allowed to be adjusted or rewritten by subclasses according to actual conditions. For example, some platforms may have different API calling methods, response formats, or error handling mechanisms, and these differences should be reflected in the base class. Use the polymorphism principle in object-oriented programming to ensure that although resource classes on different platforms implement the same interface, they can exhibit different behaviors based on their respective characteristics and requirements.
[0119] Plan the life cycle management of resource classes, including initialization, configuration, use, and destruction phases. Clarify the tasks that resource classes should perform in each phase, and how to interact with the external environment (such as the BaseClient class).
[0120] Through the above steps, two abstract base classes, BaseClient and BaseResource, can be created. They not only provide a solid framework for specific client and resource classes, but also promote code reuse, maintenance, and extension.
[0121] S102, based on the BaseResource abstract class, derive derived resource classes applied to social media platforms, each derived resource class contains data processing logic required for interacting with the corresponding social media platform, and the data processing logic calculates the first performance indicator Pf of each derived resource class based on the call frequency Fd, response time Tr and parallel processing capability Pc.
[0122] For each specific social media platform, analyze its unique API interface, data format, authentication mechanism, etc. Based on the platform characteristics, define a set of specific operation methods, such as obtaining user information, publishing status updates, retrieving comments, etc.
[0123] Implement data processing logic to calculate the following indicators:
[0124] Call frequency Fd:
[0125] Collect the number of calls to a specific resource class within a period of time as an important indicator to measure the activity of the resource class. The purpose of calculating the call frequency Fd is to evaluate the performance of the resource class under high concurrency and ensure that the system can stably handle a large number of requests.
[0126] Response time Tr:
[0127] Measures the time interval from sending a request to receiving a response to evaluate the responsiveness of a resource class. Shorter response time means better user experience and higher system efficiency.
[0128] Parallel processing capability Pc:
[0129] Analyzes the ability of a resource class to perform tasks in a multithreaded or distributed environment, especially when multiple requests need to be processed simultaneously. Parallel processing capability Pc reflects the degree to which a resource class can utilize hardware resources to optimize performance.
[0130] Based on the call frequency Fd, response time Tr, and parallel processing capacity Pc, a comprehensive formula is constructed to calculate the first performance indicator Pf. The calculated first performance indicator Pf is used to guide the system to select the most appropriate resource class to handle specific tasks. Resource classes with higher performance can prioritize critical or urgent tasks, thereby improving the overall response speed of the system and user experience.
[0131] Based on the results of performance indicators, the system resource configuration is dynamically adjusted, such as increasing or decreasing the number of instances of a certain platform resource class. This helps to maintain the load balance of the system and avoid resource waste or overload.
[0132] Through the above steps, derived resource classes can be created for each specific social media platform, and their first performance index Pf can be calculated through detailed data processing logic. This approach not only improves the flexibility and scalability of the system, but also ensures that each resource class can perform optimally on its specific platform.
[0133] S103, create a unified client class Client inherited from the BaseClient abstract class, the unified client class includes n social media platform resource objects, dynamically instantiate the n social media platform resource objects included in the unified client class using a factory pattern, and calculate a second performance indicator Ps of the social media platform resource objects based on the data transmission rate Ts, memory usage Mu, network delay Ds, and resource allocation efficiency Ef of the social media platform resource objects.
[0134] You can build a unified client class that can manage resource objects of multiple social media platforms. Use the factory pattern to dynamically create and manage resource objects of different platforms as needed. Calculate the second performance indicator Ps of each resource object based on the key performance indicator (KPI) to optimize resource selection and load balancing.
[0135] The Client class inherits from the BaseClient abstract class, inherits its common operation interface and shared properties, implements all necessary abstract methods, and adds functions specific to multi-platform management.
[0136] The Client class maintains a list or collection inside to store n social media platform resource objects. Each resource object is a concrete implementation derived from the BaseResource abstract class and corresponds to a different social media platform.
[0137] Design a factory class or method to dynamically create the corresponding resource object according to the platform type. The factory pattern enables the Client class to load different resource objects according to configuration or requirements at runtime without modifying the existing code. It provides flexibility and scalability and supports seamless integration of new platforms.
[0138] The data transfer rate of each resource object can be measured to reflect its ability to transmit data on the network. Ts is calculated using bandwidth and signal-to-noise ratio, for example , where B is the bandwidth and S / N is the signal-to-noise ratio.
[0139] Calculate the memory usage Mu, you can calculate the memory usage of each resource object, through the formula , where U is the used memory and T is the total memory. The memory usage reflects the occupation of system memory by resource objects during operation.
[0140] To calculate the network delay Ds, we can measure the propagation delay Dp and the queue delay Dq, and calculate the total network delay Ds = Dp + Dq. Network delay directly affects the response time and is one of the important factors in measuring the performance of resource objects.
[0141] Calculate resource allocation efficiency Ef to evaluate the ability of resource objects to complete workload, using the formula , where Cc is the amount of work completed and Tz is the total time. Resource allocation efficiency reflects the efficiency and utilization of resource objects when processing tasks.
[0142] Taking the four factors into consideration, a comprehensive scoring formula is constructed to combine Ts, Mu, Ds, and Ef to obtain a more comprehensive performance evaluation.
[0143]
[0144] w1, w2, w3, w4 are weight coefficients, Bmax and Emax are the maximum data transmission rate and maximum resource allocation efficiency respectively, η1, η2 are power parameters, γ2 and β2 are parameters in the exponential decay function, which are used to adjust the impact of Mu and Ds on performance.
[0145] Use the calculated Ps to guide resource selection and load balancing. Resource objects with higher performance can be prioritized to handle critical or urgent tasks, ensuring efficient operation of the system.
[0146] Through the above steps, a unified client class Client inherited from BaseClient can be created. This class can not only manage multiple social media platform resource objects, but also dynamically instantiate these objects and calculate the second performance indicator Ps of each resource object based on the key performance indicators. This approach not only improves the flexibility and scalability of the system, but also ensures that the resource objects can process requests under optimal performance conditions, thereby improving user experience and system efficiency.
[0147] S104, using the task complexity Tf, resource availability Rz and mapping function fy, generates a signature random number Qs for each derived resource class, digitally signs n social media platform resource objects based on the random number Qs, and generates a data call interface J={J1, J2,…Jn} of the n social media platform resource objects based on the digital signature.
[0148] In order to realize the generation of a signature random number Qs for each derived resource class based on the task complexity Tf, the resource availability Rz and the mapping function fy, and digitally sign n social media platform resource objects based on the random number Qs, and finally generate a data call interface J={J1, J2, …, Jn} of these resource objects, the following steps may be included:
[0149] 1. Generate a signature random number Qs
[0150] Analyze the types and complexity of tasks that each derived resource class needs to handle. Task complexity Tf can include factors such as the amount of computation, amount of data transmission, and expected execution time of the task. Check the availability status of each resource object in the current system, such as whether it is online, load status, etc. Resource availability Rz reflects the readiness and service capabilities of a resource object at a specific point in time.
[0151] A mapping function fy is used to convert the task complexity Tf and resource availability Rz into a numerical value or vector as the basis for generating a signature random number. The mapping function can be designed according to specific business logic and requirements to ensure that its output can reflect the characteristics of tasks and resources.
[0152] Combining the task complexity Tf, resource availability Rz and the output of the mapping function fy, a secure random number generation algorithm (such as a cryptographic hash function) is used to generate a signature random number Qs. Ensure that Qs has a high entropy value and is difficult to predict to enhance security.
[0153] 2. Digitally sign the resource object
[0154] Select a secure and efficient digital signature algorithm (such as RSA, ECDSA) to sign each resource object. The digital signature not only verifies the identity of the resource object, but also ensures the integrity and non-repudiation of the data. Take the generated signature random number Qs as one of the inputs, combined with other necessary information (such as the unique identifier of the resource object, timestamp, etc.), and generate a digital signature through the selected signature algorithm. The digital signature should be closely associated with the resource object to ensure its uniqueness and non-tamperability.
[0155] 3. Generate data call interface J
[0156] According to the characteristics and functions of each resource object, define a set of unified method signatures, such as pagedetail, pagefans, etc. The interface should include necessary parameters (such as request path, query parameters, authentication token, etc.) so that the client can correctly call the services provided by the resource object.
[0157] The corresponding digital signature is embedded in each data call interface Ji to ensure that the identity and integrity of the resource object can be verified for each call. The digital signature can be used as part of the HTTP request header or as a field in the request body. The specific form depends on the API design.
[0158] The data call interfaces of all resource objects that have been verified by digital signatures are aggregated to form a complete interface set J = {J1, J2, …, Jn}. The interface set J should be easy to manage and maintain, and support dynamic updates and expansions to adapt to future changes in demand.
[0159] Through the above steps, a unique signature random number Qs can be generated for each derived resource class, and n social media platform resource objects can be digitally signed, and finally their data call interface J is generated. This method not only enhances the security of the system, but also ensures that the interaction between resource objects on different platforms is highly consistent and reliable.
[0160] S105. When a call request Qr for a social media platform resource is received, based on the first performance indicator Pf, the second performance indicator Ps and the data call interface J, m resource interfaces J'={J'1, J'2, ... J'm} corresponding to the call request Qr are generated, where m≤n, to implement calls with the same name on resources of different social media platforms, so that users can interact with different social media platforms in the same way.
[0161] When a call request Qr of a social media platform resource is received, based on the first performance indicator Pf, the second performance indicator Ps and the data call interface J, m resource interfaces J'={J'1, J'2, ..., J'm} corresponding to the call request Qr are generated, where m≤n, to implement the same-name call on resources of different social media platforms and ensure that users can interact with different social media platforms in the same way, which may include the following steps:
[0162] 1. Receive call request Qr
[0163] After receiving the call request Qr, the request content is first parsed, including the request type, parameters, and target operation. The specific requirements of the request are determined, such as obtaining user information, publishing content, etc.
[0164] 2. Evaluate existing resource objects
[0165] Collect the first performance index Pf and the second performance index Ps of all available social media platform resource objects. These indicators reflect the performance of each resource object when processing tasks, such as response speed, load, transmission efficiency, etc.
[0166] 3. Build a comprehensive score
[0167] A comprehensive scoring formula is used to combine Pf and Ps to calculate a comprehensive score Stotal for each resource object.
[0168] An example formula could be: Stotal=w5·Pf+w6·Ps
[0169] Among them, w5 and w6 are weight coefficients, and the importance of these two factors can be adjusted according to the specific application scenario.
[0170] 4. Select the best resource object
[0171] Sort and select the top m: Sort all resource objects according to the comprehensive score Stotal. Select the top m resource objects with the highest scores, where m≤n, and n is the total number of resource objects. If there are other constraints (such as load balancing, geographical distribution, user preferences, etc.), these factors can also be considered in the selection process.
[0172] 5. Generate a new resource interface set J'
[0173] Create a new interface list: For the selected m resource objects, call interface J based on their data to generate a new interface set J'={J'1,J'2,...,J'm}. Each J'i contains the necessary information, such as URL path, request parameters, authentication token, etc., for interacting with the corresponding resource object.
[0174] Ensure that the method signatures in the newly generated interface J' are consistent with the original interface J, so that users can access different social media platform resources through the same calling method. In this way, even if the underlying resource objects are different, users can interact with each platform in a unified way.
[0175] 6. Return to the interface list
[0176] The generated J' is returned to the caller as a resource interface option for processing the call request Qr. The client can select one or more of these interfaces to execute the actual call request to ensure that the operation can be completed under optimal performance conditions.
[0177] Through the above steps, it can be ensured that when a call request Qr of a social media platform resource is received, the most suitable m resource interfaces J' are generated based on the first performance indicator Pf, the second performance indicator Ps and the data call interface J, thereby achieving efficient and consistent cross-platform interaction. This method not only improves the flexibility and performance of the system, but also enhances the consistency and simplicity of the user experience.
[0178] According to a specific implementation of an embodiment of the present invention, the setting of the BaseClient abstract class and the BaseResource abstract class includes:
[0179] Determine common operations that all clients need to perform, the common operations including: connecting, disconnecting, sending requests, and receiving responses;
[0180] Identify shared attributes of all clients, including configuration parameters, status information, and authentication credentials, and define access methods for shared attributes;
[0181] Extension points are set by defining hook methods, and subclasses add specific behaviors through the extension points.
[0182] According to a specific implementation of an embodiment of the present invention, the setting of the BaseClient abstract class and the BaseResource abstract class further includes:
[0183] Define a set of platform-independent operation interfaces based on the characteristics of different social media platforms;
[0184] Determine in BaseResource what subclasses can adjust or override based on actual conditions;
[0185] Plan the lifecycle management of the BaseResource resource class, including the initialization, configuration, use, and destruction phases, and clarify the tasks performed by the BaseResource resource class in each phase and how it interacts with the external environment.
[0186] According to a specific implementation of an embodiment of the present invention, the data processing logic calculates the first performance indicator Pf of each derived resource class based on the call frequency Fd, the response time Tr and the parallel processing capability Pc, including:
[0187] Calculate the call frequency Fd:
[0188]
[0189] k is the number of observed events, λ1 is the average occurrence rate;
[0190] Calculate the response time Tr:
[0191]
[0192] L is the average number of requests in the system, λ2 is the request arrival rate;
[0193] Calculate the parallel processing capacity Pc:
[0194]
[0195] p is the parallelizable part of the program, and s is the speedup ratio.
[0196] According to a specific implementation of an embodiment of the present invention, the data processing logic calculates the first performance indicator Pf of each derived resource class based on the call frequency Fd, the response time Tr and the parallel processing capability Pc, and further includes:
[0197] Set the calculation formula for the first performance indicator Pf:
[0198]
[0199] Np is the total number of events observed in a specific time period, Fdi represents the frequency of the ith call, and α1, β1, γ1, δ1 are weight coefficients.
[0200] According to a specific implementation of an embodiment of the present invention, the second performance indicator Ps of the social media platform resource object is calculated based on the data transmission rate Ts, memory usage Mu, network delay Ds and resource allocation efficiency Ef of the social media platform resource object, including:
[0201] Calculate the data transmission rate Ts:
[0202]
[0203] B is the bandwidth, S / N is the signal-to-noise ratio;
[0204] Calculate the memory usage Mu:
[0205] Mu
[0206] U is the used memory and T is the total memory;
[0207] Calculate network delay Ds:
[0208] Ds=Dp+Dq
[0209] Dp is the propagation delay, Dq is the queue delay;
[0210] Calculate resource allocation efficiency Ef:
[0211]
[0212] Cc is the amount of work done and Tz is the total time.
[0213] According to a specific implementation of an embodiment of the present invention, the second performance indicator Ps of the social media platform resource object is calculated based on the data transmission rate Ts, memory usage Mu, network delay Ds and resource allocation efficiency Ef of the social media platform resource object, and further includes:
[0214] Set the calculation formula for the second performance indicator Ps:
[0215]
[0216] w1, w2, w3, w4 are weight coefficients, Bmax and Emax are the maximum data transmission rate and maximum resource allocation efficiency respectively, η1, η2 are power parameters, γ2 and β2 are parameters in the exponential decay function, which are used to adjust the impact of Mu and Ds on performance.
[0217] According to a specific implementation of an embodiment of the present invention, the generating of m resource interfaces J'={J'1, J'2, ... J'm} corresponding to the calling request Qr based on the first performance indicator Pf, the second performance indicator Ps and the data calling interface J includes:
[0218] Determine all social media platform resource objects managed by the unified client class Client in the current system;
[0219] Construct a comprehensive calculation formula:
[0220] Stotal=w5⋅Pf+w6⋅Ps
[0221] W5 and w6 are weight coefficients;
[0222] Sort all resource objects according to the comprehensive score Stotal and select the top m resource objects with the highest scores;
[0223] For the selected m resource objects, based on their data call interfaces, a new interface set J′={J1′,J2′,…,Jm′} is generated, where Ji′ contains URL path, request parameters, authentication token, etc., which are used to interact with the corresponding resource objects;
[0224] adding metadata for each interface, the metadata including a performance score, an estimated response time, and an expected throughput;
[0225] The generated J′ is returned to the caller as a resource interface option for processing the call request Qr.
[0226] Corresponding to the above method embodiment, see Figure 3 The embodiment of the present invention further discloses a general multi-social media platform data processing architecture setting device 30, comprising:
[0227] Setting module 301, setting a BaseClient abstract class and a BaseResource abstract class, wherein the BaseClient abstract class is used to encapsulate the operation interface of a general client, and the BaseResource abstract class is used to define a resource operation interface that is independent of a social media platform;
[0228] A derivation module 302 derives derived resource classes applied to social media platforms based on the BaseResource abstract class, each derived resource class includes data processing logic required for interacting with the corresponding social media platform, and the data processing logic calculates a first performance indicator Pf of each derived resource class based on a call frequency Fd, a response time Tr, and a parallel processing capability Pc;
[0229] A creation module 303 is provided to create a unified client class Client inherited from the BaseClient abstract class, wherein the unified client class includes n social media platform resource objects, and the n social media platform resource objects included in the unified client class are dynamically instantiated using a factory mode, and a second performance indicator Ps of the social media platform resource objects is calculated based on the data transmission rate Ts, memory usage Mu, network delay Ds, and resource allocation efficiency Ef of the social media platform resource objects;
[0230] The generation module 304 generates a signature random number Qs for each derived resource class based on the task complexity Tf, the resource availability Rz and the mapping function fy, digitally signs n social media platform resource objects based on the random number Qs, and generates a data call interface J={J1, J2, ...Jn} for the n social media platform resource objects based on the digital signature;
[0231] The execution module 305, when receiving a call request Qr of a social media platform resource, generates m resource interfaces J'={J'1,J'2,…J'm} corresponding to the call request Qr based on the first performance indicator Pf, the second performance indicator Ps and the data call interface J, where m≤n, to implement the same-name call on different social media platform resources, so that users can interact with different social media platforms in the same way.
[0232] See also Figure 4 The embodiment of the present invention further provides an electronic device 60, the electronic device comprising:
[0233] at least one processor; and,
[0234] a memory communicatively connected to the at least one processor; wherein,
[0235] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the multi-social media platform data processing architecture setting method commonly used in the aforementioned method embodiment.
[0236] An embodiment of the present invention further provides a non-transitory computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable the computer to execute the aforementioned method embodiment.
[0237] An embodiment of the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer executes the general multi-social media platform data processing architecture setting method in the aforementioned method embodiment.
[0238] Reference below Figure 4 , which shows a schematic diagram of the structure of an electronic device 60 suitable for implementing the embodiment of the present disclosure. The electronic device in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle terminals (such as vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 4 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0239] like Figure 4 As shown, the electronic device 60 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 60 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0240] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, a gage, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 60 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 4 The electronic device 60 is shown with various devices, but it should be understood that it is not required to implement or have all the devices shown. More or fewer devices may be implemented or have instead.
[0241] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0242] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. A general method for setting up a multi-social media platform data processing architecture, characterized in that: include: Set a BaseClient abstract class and a BaseResource abstract class, wherein the BaseClient abstract class is used to encapsulate the operation interface of a general client, and the BaseResource abstract class is used to define a resource operation interface that is independent of the social media platform; Based on the BaseResource abstract class, derived resource classes applied to social media platforms are derived, each of which contains data processing logic required for interacting with the corresponding social media platform, and the data processing logic calculates a first performance indicator Pf of each derived resource class based on a call frequency Fd, a response time Tr, and a parallel processing capability Pc; Create a unified client class Client inherited from the BaseClient abstract class, the unified client class includes n social media platform resource objects, dynamically instantiate the n social media platform resource objects included in the unified client class using a factory pattern, and calculate a second performance indicator Ps of the social media platform resource objects based on the data transmission rate Ts, memory usage Mu, network delay Ds, and resource allocation efficiency Ef of the social media platform resource objects; Generate a signature random number Qs for each derived resource class based on the task complexity Tf, resource availability Rz and mapping function fy, digitally sign n social media platform resource objects based on the random number Qs, and generate a data call interface J={J1, J2, …Jn} for n social media platform resource objects based on the digital signature; When receiving a call request Qr of a social media platform resource, based on the first performance indicator Pf, the second performance indicator Ps and the data call interface J, m resource interfaces J'={J'1, J'2, ... J'm} corresponding to the call request Qr are generated, where m≤n, to implement the same-name call on resources of different social media platforms, so that users can interact with different social media platforms in the same way; in The setting of the BaseClient abstract class and the BaseResource abstract class includes: Determine common operations that all clients need to perform, the common operations including: connecting, disconnecting, sending requests, and receiving responses; Identify shared attributes of all clients, including configuration parameters, status information, and authentication credentials, and define access methods for shared attributes; Set extension points by defining hook methods and add specific logic through the extension points; Define a set of platform-independent operation interfaces based on the characteristics of different social media platforms; Determine in BaseResource what subclasses can adjust or override based on actual conditions; Plan the lifecycle management of the BaseResource resource class, including the initialization, configuration, use, and destruction phases, and clarify the tasks performed by the BaseResource resource class in each phase and how it interacts with the external environment.
2. The method according to claim 1, characterized in that The data processing logic calculates the first performance indicator Pf of each derived resource class based on the call frequency Fd, the response time Tr and the parallel processing capability Pc, including: Calculate the call frequency Fd: k is the number of observed events, λ1 is the average occurrence rate; Calculate the response time Tr: L is the average number of requests in the system, λ2 is the request arrival rate; Calculate the parallel processing capacity Pc: p is the parallelizable part of the program, and s is the speedup ratio.
3. The method according to claim 2, characterized in that The data processing logic calculates the first performance indicator Pf of each derived resource class based on the call frequency Fd, the response time Tr and the parallel processing capability Pc, and also includes: Set the calculation formula for the first performance indicator Pf: Np is the total number of events observed in a specific time period, Fdi represents the frequency of the ith call, and α1, β1, γ1, δ1 are weight coefficients.
4. The method according to claim 3, characterized in that The calculating of the second performance indicator Ps of the social media platform resource object based on the data transmission rate Ts, memory usage Mu, network delay Ds and resource allocation efficiency Ef of the social media platform resource object includes: Calculate the data transmission rate Ts: B is the bandwidth, S / N is the signal-to-noise ratio; Calculate the memory usage Mu: In U is the used memory and T is the total memory; Calculate network delay Ds: Ds=Dp+Dq Dp is the propagation delay, Dq is the queue delay; Calculate resource allocation efficiency Ef: Cc is the amount of work done and Tz is the total time.
5. The method according to claim 4, characterized in that The calculating of the second performance indicator Ps of the social media platform resource object based on the data transmission rate Ts, memory usage Mu, network delay Ds and resource allocation efficiency Ef of the social media platform resource object also includes: Set the calculation formula for the second performance indicator Ps: w1, w2, w3, w4 are weight coefficients, Bmax and Emax are the maximum data transmission rate and maximum resource allocation efficiency respectively, η1, η2 are power parameters, γ2 and β2 are parameters in the exponential decay function, which are used to adjust the impact of Mu and Ds on performance.
6. The method according to claim 5, characterized in that The generating m resource interfaces J'={J'1, J'2, ... J'm} corresponding to the calling request Qr based on the first performance indicator Pf, the second performance indicator Ps and the data calling interface J comprises: Determine all social media platform resource objects managed by the unified client class Client in the current system; Construct a comprehensive calculation formula: w5 and w6 are weight coefficients; Sort all resource objects according to the comprehensive score Stotal and select the top m resource objects with the highest scores; For the selected m resource objects, based on their data call interfaces, a new interface set J′={J1′,J2′,…,Jm′} is generated, where J′ contains the URL path, request parameters and authentication tokens, which are used to interact with the corresponding resource objects; adding metadata for each interface, the metadata including a performance score, an estimated response time, and an expected throughput; The generated J′ is returned to the caller as a resource interface option for processing the call request Qr.
7. A general multi-social media platform data processing architecture configuration device, characterized in that: include: A setting module is used to set a BaseClient abstract class and a BaseResource abstract class. The BaseClient abstract class is used to encapsulate the operation interface of a general client, and the BaseResource abstract class is used to define a resource operation interface that is not related to a social media platform. A derivation module, based on the BaseResource abstract class, derives derived resource classes applied to social media platforms, each derived resource class includes data processing logic required for interacting with the corresponding social media platform, and the data processing logic calculates a first performance indicator Pf of each derived resource class based on a call frequency Fd, a response time Tr, and a parallel processing capability Pc; A creation module is provided to create a unified client class Client inherited from the BaseClient abstract class, wherein the unified client class includes n social media platform resource objects, and the n social media platform resource objects included in the unified client class are dynamically instantiated using a factory mode, and a second performance indicator Ps of the social media platform resource objects is calculated based on the data transmission rate Ts, memory usage Mu, network delay Ds, and resource allocation efficiency Ef of the social media platform resource objects; A generation module generates a signature random number Qs for each derived resource class based on the task complexity Tf, resource availability Rz and mapping function fy, digitally signs n social media platform resource objects based on the random number Qs, and generates a data call interface J={J1, J2, …Jn} for n social media platform resource objects based on the digital signature; The execution module, when receiving a call request Qr of a social media platform resource, generates m resource interfaces J'={J'1, J'2, ... J'm} corresponding to the call request Qr based on the first performance indicator Pf, the second performance indicator Ps and the data call interface J, where m≤n, to implement the same-name call on resources of different social media platforms, so that users can interact with different social media platforms in the same way; in The setting of the BaseClient abstract class and the BaseResource abstract class includes: Determine common operations that all clients need to perform, the common operations including: connecting, disconnecting, sending requests, and receiving responses; Identify shared attributes of all clients, including configuration parameters, status information, and authentication credentials, and define access methods for shared attributes; Set extension points by defining hook methods and add specific logic through the extension points; Define a set of platform-independent operation interfaces based on the characteristics of different social media platforms; Determine in BaseResource what subclasses can adjust or override based on actual conditions; Plan the lifecycle management of the BaseResource resource class, including the initialization, configuration, use, and destruction phases, and clarify the tasks performed by the BaseResource resource class in each phase and how it interacts with the external environment.
8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the general multi-social media platform data processing architecture setting method described in any one of claims 1 to 6.
Citation Information
Patent Citations
Social media content distributed storage method and device
CN118245456A
Social media data accelerated calculation method and device
CN118296445A