Multi-social media platform API unified gateway access method, device and electronic device

By designing a unified gateway access method, the problems of complexity and maintenance difficulty of multi-social media platform API integration are solved, efficient and secure data processing and management are achieved, development and maintenance costs are reduced, and system flexibility and response are improved. speed.

CN118890392BActive Publication Date: 2024-12-10ONE NETWORK INTEROPERABILITY (BEIJING) TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411353627.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2024-12-10
Estimated Expiration
2044-09-26

AI Technical Summary

Technical Problem

The existing technology faces complexity, maintenance difficulty, data inconsistency, lack of flexibility, security and performance bottlenecks when integrating APIs on multiple social media platforms. Especially when APIs are frequently updated, the code needs to be frequently modified, resulting in development. and high maintenance costs and lack unified data processing and security management.

Method used

Design a unified gateway access method for multi-social media platform API. By designing a special adapter module for each platform, setting up a unified gateway including the reception layer, business logic layer, data processing layer, security layer and cache layer, processing API requests, and verifying , conversion, standardized processing, authentication and encryption, use the cache layer to optimize data storage, and provide a unified interface and management mechanism.

Benefits of technology

Simplifies API integration and maintenance, improves data processing efficiency and security, enhances system flexibility and scalability, reduces maintenance costs, ensures data quality and privacy protection, and improves response speed and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118890392B_ABST
    Figure CN118890392B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a method, device and electronic device for accessing a unified gateway of a multi-social media platform API, belonging to the field of data processing technology. The method includes: designing a special adapter module for each social media platform, setting a unified gateway as a unified access point for all social media API interactions; using a receiving layer to process all API requests RQ from clients; converting the authentication request message RI from a client format to an internal unified format through a business logic layer; performing standardized processing on the unified data based on a data processing layer; performing identity authentication, authorization and data encryption operations on the standard data DB through a security layer; and using the cache layer to evaluate the security data DA to obtain a cache index CI, so as to determine the storage time and storage location of the security data DA in the cache layer based on the cache index CI. The present invention improves the efficiency of data access for multiple social media platforms.
Need to check novelty before this filing date? Find Prior Art

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 accessing a unified gateway of a multi-social media platform API. Background Art

[0002] As social media platforms diversify, developers face duplication of work and increased maintenance difficulty when integrating APIs from multiple platforms. The API interfaces and data formats of each platform vary greatly and are frequently updated, which brings inconvenience to development and maintenance, mainly manifested in:

[0003] 1. High complexity and maintenance difficulty

[0004] Multi-API management: Existing technologies require developers to connect to and manage the API of each social media platform separately, which increases the complexity of development and subsequent maintenance.

[0005] Frequent updates: The APIs of social media platforms may be frequently updated or changed, and developers need to constantly modify and adapt their code to comply with new API specifications, which results in a large maintenance workload.

[0006] 2. Data inconsistency

[0007] Inconsistent formats: The data formats returned by the APIs of different social media platforms vary. Developers need to write parsing code for each format, which makes the process cumbersome and error-prone.

[0008] Data quality issues: Due to the lack of a unified data processing and cleaning mechanism, the data obtained from various platforms may have inconsistent quality, affecting the final data analysis and application effects.

[0009] 3. Lack of flexibility and scalability

[0010] Difficulty in expansion: When connecting to new social media platforms, the existing system may require a lot of code refactoring, lacking flexibility and scalability.

[0011] Customization limitations: Customized development for specific business needs is limited by the inherent functions and limitations of each platform API, making it difficult to achieve highly personalized services.

[0012] 4. Security and privacy issues

[0013] Security risks: Managing authentication and authorization mechanisms for each platform individually can lead to security vulnerabilities, especially when synchronizing and managing sensitive information across multiple systems and platforms.

[0014] Data leakage risk: The lack of unified security standards and supervision when transmitting and processing user data between multiple systems increases the risk of data leakage.

[0015] 5. Performance bottleneck

[0016] Response delay: Without unified processing and optimization, collecting and processing data from multiple social media platforms may lead to prolonged response time and affect user experience.

[0017] Uneven resource utilization: Resource consumption of various API calls may be uneven, resulting in overall system inefficiency.

[0018] The above problems become technical problems that need to be solved. Summary of the invention

[0019] In view of this, the embodiments of the present invention provide a method, device and electronic device for accessing a unified gateway of multiple social media platforms API, which at least partially solve the problems existing in the prior art.

[0020] In a first aspect, an embodiment of the present invention provides a method for accessing a unified gateway of multiple social media platform APIs, including:

[0021] Design a dedicated adapter module for each social media platform and set up a unified gateway as a unified access point for all social media API interactions, the unified gateway including a receiving layer, a business logic layer, a data processing layer, a security layer, and a cache layer;

[0022] The receiving layer is used to process all API requests RQ from the client. The receiving layer is provided with a receiving function SR. The receiving function verifies the API request RQ and adds authentication information VI to the API request RQ that passes the verification to obtain an authentication request message RI=SR(VI,RQ).

[0023] The authentication request message RI is converted from the client format to the internal unified format through the business logic layer to obtain unified data DT=TS(RI), where TS is a conversion function used to convert the API call of a specific platform into a unified internal format;

[0024] Based on the data processing layer, the unified data is standardized to obtain standard data DB=NM(DT), where NM is a standardization processing function;

[0025] Perform identity authentication, authorization and data encryption operations on the standard data DB through the security layer to obtain security data DA=E(P(DB)), where P is the authority check function and E is the encryption function;

[0026] The security data DA is evaluated using the cache layer to obtain a cache index CI=CP(DA), so as to determine the storage time and storage location of the security data DA in the cache layer based on the cache index CI.

[0027] According to a specific implementation of the embodiment of the present disclosure, after designing a dedicated adapter module for each social media platform, the method further includes:

[0028] A load balancer is deployed at the receiving layer to evenly distribute the requests from the receiving layer to each processing node.

[0029] According to a specific implementation of the embodiment of the present disclosure, the receiving layer is used to process all API requests RQ from the client, and the receiving layer is provided with a receiving function SR, which verifies the API request RQ and adds authentication information VI to the API request RQ that passes the verification, and obtains the authentication request message RI=SR(VI,RQ), including:

[0030] Define the time decay function f(t), complexity calculation function g(s) and effectiveness evaluation function h(u):

[0031]

[0032] t represents the timestamp of the API request RQ, T represents the current time T, is the time threshold;

[0033]

[0034] s represents the signature string contained in the API request RQ, |s| is the length of the signature string, are the characters in the signature string;

[0035]

[0036] u represents the user ID. If f(t)+g(s)+h(u)>α1, then:

[0037] SR(VI,RQ)=C(VI,RQ)={RQ,"AtIf",VI}

[0038] α1 is the first threshold, C() is the constructor, and AtIf represents the authentication result.

[0039] According to a specific implementation of the embodiment of the present disclosure, the receiving layer is used to process all API requests RQ from the client, and the receiving layer is provided with a receiving function SR, which verifies the API request RQ and adds authentication information VI to the API request RQ that passes the verification to obtain an authentication request message RI=SR(VI, RQ), and also includes:

[0040] Calculate the priority P(RQ,W) of request RQ:

[0041]

[0042] Where W = g(s), represents the mean value of W within the preset time period;

[0043] When the value of P(RQ, W) is less than the second threshold α2, the authentication result AtIf is set to empty.

[0044] According to a specific implementation of the embodiment of the present disclosure, the authentication request message RI is converted from a client format to an internal unified format through a business logic layer to obtain unified data DT=TS(RI), including:

[0045] Parse the key information in the authentication request message RI and extract the fields that need to be converted according to the conversion rules;

[0046] Create a new internal format object and fill the converted data into the internal format object;

[0047] The assembled internal format object is returned as unified data DT to the subsequent processing layer.

[0048] According to a specific implementation of the embodiment of the present disclosure, the data processing layer performs standardization processing on the unified data to obtain standard data DB=NM(DT), including:

[0049] Get pre-defined normalization rules to perform data cleaning, data type conversion, missing value processing, and outlier detection on unified data.

[0050] According to a specific implementation of the embodiment of the present disclosure, performing identity authentication, authorization and data encryption operations on the standard data DB through the security layer to obtain security data DA=E(P(DB)) includes:

[0051] Verify the identity information in the standard data DB to confirm the user's identity;

[0052] Check the requested resources in the standard data DB according to the user's role and permissions to determine whether the user has the right to perform the requested operation;

[0053] Encrypt sensitive data in standard data.

[0054] According to a specific implementation of the embodiment of the present disclosure, the use of the cache layer to evaluate the security data DA to obtain a cache index CI=CP(DA), so as to determine the storage time and storage location of the security data DA in the cache layer based on the cache index CI, includes:

[0055] Analyze the data attributes of security data DA, including access mode, data size, and data sensitivity;

[0056] Calculate the cache index CI according to the cache strategy and the data attributes of the security data DA;

[0057] The storage time and storage location of the security data DA are determined according to the calculated cache index CI.

[0058] In a second aspect, an embodiment of the present invention provides a multi-social media platform API unified gateway access device, including:

[0059] Setting up modules, designing specialized adapter modules for each social media platform, and setting up a unified gateway as a unified access point for all social media API interactions, wherein the unified gateway includes a receiving layer, a business logic layer, a data processing layer, a security layer, and a cache layer;

[0060] The receiving module uses the receiving layer to process all API requests RQ from the client. The receiving layer is provided with a receiving function SR. The receiving function verifies the API request RQ and adds authentication information VI to the API request RQ that passes the verification to obtain an authentication request message RI=SR(VI,RQ).

[0061] The conversion module converts the authentication request message RI from the client format to the internal unified format through the business logic layer to obtain the unified data DT=TS(RI), where TS is a conversion function used to convert the API call of a specific platform into a unified internal format;

[0062] A standardization module performs standardization processing on the unified data based on the data processing layer to obtain standard data DB=NM(DT), where NM is a standardization processing function;

[0063] The security module performs identity authentication, authorization and data encryption operations on the standard data DB through the security layer to obtain security data DA=E(P(DB)), where P is the authority check function and E is the encryption function;

[0064] The storage module uses the cache layer to evaluate the security data DA to obtain a cache index CI=CP(DA), so as to determine the storage time and storage location of the security data DA in the cache layer based on the cache index CI.

[0065] In a third aspect, an embodiment of the present invention further provides an electronic device, the electronic device comprising:

[0066] at least one processor; and,

[0067] a memory communicatively connected to the at least one processor; wherein,

[0068] 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 API unified gateway access method in any of the aforementioned first aspects or any of the implementations of the first aspect.

[0069] 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 multi-social media platform API unified gateway access method in the aforementioned first aspect or any implementation of the first aspect.

[0070] 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 multi-social media platform API unified gateway access method in the aforementioned first aspect or any implementation of the first aspect.

[0071] The multi-social media platform API unified gateway access solution in the embodiment of the present invention includes: designing a special adapter module for each social media platform, setting a unified gateway as a unified access point for all social media API interactions, the unified gateway includes a receiving layer, a business logic layer, a data processing layer, a security layer and a cache layer; using the receiving layer to process all API requests RQ from the client, the receiving layer is provided with a receiving function SR, the receiving function verifies the API request RQ, and adds authentication information VI to the API request RQ that passes the verification, to obtain an authentication request message RI=SR(VI,RQ); converting the authentication request message RI from the client format to the internal format through the business logic layer The unified format is obtained to obtain unified data DT=TS(RI), where TS is a conversion function used to convert the API call of a specific platform into a unified internal format; the unified data is standardized based on the data processing layer to obtain standard data DB=NM(DT), where NM is a standardization processing function; identity authentication, authorization and data encryption operations are performed on the standard data DB through the security layer to obtain security data DA=E(P(DB)), where P is a permission check function and E is an encryption function; the security data DA is evaluated by using the cache layer to obtain a cache index CI=CP(DA), so as to determine the storage time and storage location of the security data DA in the cache layer based on the cache index CI.

[0072] The solution of this application has the following beneficial effects:

[0073] 1. Simplify integration and maintenance:

[0074] The gateway provides a unified interface, reducing the complexity of direct interaction with multiple APIs, simplifying development and subsequent maintenance. Updates and maintenance are concentrated at the gateway level. When the API of the social media platform changes, only the adapter needs to be updated in the gateway without modifying the integration code of each application.

[0075] 2. Improve data processing efficiency:

[0076] The speed and efficiency of data access are improved through a unified data processing and caching mechanism. Data standardization and cleaning are concentrated at the gateway layer to ensure data quality and provide reliable data support for subsequent analysis and application.

[0077] 3. Enhanced Security:

[0078] Unified authentication and authorization management reduces the risk of security vulnerabilities and improves data security. Data encryption and access control ensure the protection of sensitive information and comply with privacy protection regulations.

[0079] 4. Scalability and flexibility:

[0080] Through plug-in adapters and modular design, the gateway can be easily expanded to support new social media platforms or respond to API changes. The microservice architecture allows the gateway to be flexibly deployed and expanded to meet the needs of applications of different scales.

[0081] 5. Cost efficiency:

[0082] Reduce frequent updates and repeated development work caused by API changes, reduce maintenance costs, improve development efficiency, shorten product launch time, and quickly respond to market changes.

[0083] Through these advantages, the implementation of the unified gateway access of multiple social media platform APIs of the present invention provides organizations with a powerful tool to utilize social media data in a more efficient, secure and cost-effective manner to drive business growth and technological innovation. BRIEF DESCRIPTION OF THE DRAWINGS

[0084] 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.

[0085] Figure 1 A schematic diagram of a method for accessing a unified gateway of multiple social media platform APIs provided by an embodiment of the present invention;

[0086] Figure 2 A schematic diagram of another method for accessing a unified gateway to multiple social media platforms APIs provided by an embodiment of the present invention;

[0087] Figure 3 A schematic diagram of the structure of a unified gateway access device for multiple social media platforms API provided by an embodiment of the present invention;

[0088] Figure 4 A schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0089] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0090] 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.

[0091] 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.

[0092] 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.

[0093] 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.

[0094] The disclosed embodiment provides a method for accessing a unified gateway for APIs of multiple social media platforms. The method for accessing a unified gateway for APIs of multiple social media platforms 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 which can be integrated in a server, terminal device, etc.

[0095] See also Figure 1 The embodiment of the present disclosure provides a method for accessing a unified gateway of multiple social media platform APIs, including:

[0096] S101, design a dedicated adapter module for each social media platform, and set a unified gateway as a unified access point for all social media API interactions, wherein the unified gateway includes a receiving layer, a business logic layer, a data processing layer, a security layer, and a cache layer.

[0097] Design a dedicated adapter module for each social media platform. These adapters are responsible for handling specific interactions with the APIs of each social platform, including sending requests and receiving responses. The gateway serves as a unified access point for all social media API interactions, receiving API requests from clients and managing API calls in a unified manner.

[0098] As the central node for all social media API interactions, the gateway is responsible for handling the routing, forwarding, and responses of all external API calls. This includes receiving requests, applying adaptation logic, converting data formats, cache management, security authentication, and sending responses.

[0099] The gateway adopts a layered architecture, which mainly includes:

[0100] Receiving layer: Processes incoming API calls and performs preliminary validation and routing.

[0101] Business logic layer: Apply API adapters to convert business logic and convert platform-specific API calls into a unified internal format.

[0102] Data processing layer: performs data conversion and standardization, including data cleaning and format conversion.

[0103] Security layer: responsible for handling all security-related operations such as authentication, authorization, and data encryption.

[0104] Cache layer: Provides cache function for response data, reduces direct requests to the backend social media platform, and improves response speed.

[0105] S102, using the receiving layer to process all API requests RQ from the client, the receiving layer is provided with a receiving function SR, the receiving function verifies the API request RQ, and adds authentication information VI to the API request RQ that passes the verification, and obtains the authentication request message RI=SR(VI,RQ).

[0106] The receiving layer is the first checkpoint in the system that is used to receive all API requests from clients. The receiving function SR is a key component in the receiving layer and is used to process these requests.

[0107] When the API request RQ arrives at the receiving layer, the receiving function SR first verifies it. Verification usually includes checking whether the basic format of the request is correct, such as whether the HTTP header, URL parameters, POST data, etc. are as expected. If the request does not pass the verification, the request can be rejected immediately and an error message is returned to the client. If the request passes the verification, proceed to the next step.

[0108] Once the request is verified as valid, it is authenticated. Authentication is the process of confirming the identity of the request initiator, ensuring that only authorized users can access specific resources or perform certain actions. Authentication can be achieved in many ways, such as using API keys, OAuth tokens, JWT (JSON Web Tokens), etc. If authentication is successful, the receiving function will add an Authentication Passed VI to the original request.

[0109] Finally, the receiving function constructs an authentication request message RI that includes the original request RQ and the authentication pass information VI:

[0110] RI=SR(VI,RQ)

[0111] This authentication request message RI will then be passed to the subsequent processing layer of the system for further processing.

[0112] As a specific example, we can define the time decay function f(t), complexity calculation function g(s) and effectiveness evaluation function h(u):

[0113]

[0114] t represents the timestamp of the API request RQ, T represents the current time T, is the time threshold;

[0115]

[0116] s represents the signature string contained in the API request RQ, |s| is the length of the signature string, are the characters in the signature string;

[0117]

[0118] u represents the user ID. If f(t)+g(s)+h(u)>α1, then:

[0119] SR(VI,RQ)=C(VI,RQ)={RQ,"AtIf",VI}

[0120] α1 is the first threshold, C() is the constructor, and AtIf represents the authentication result.

[0121] Calculate the priority P(RQ,W) of request RQ:

[0122]

[0123] Where W = g(s), represents the mean value of W within the preset time period;

[0124] When the value of P(RQ, W) is less than the second threshold α2, the authentication result AtIf is set to empty.

[0125] S103, converting the authentication request message RI from the client format to an internal unified format through the business logic layer to obtain unified data DT=TS(RI), where TS is a conversion function used to convert the API call of a specific platform into a unified internal format.

[0126] TS functions standardize request data from different sources to meet the processing needs of internal systems. They are used to unify different field names, data types, encoding formats, etc. For different types of data structures, such as JSON, XML, CSV, etc., conversion functions convert them into an internal unified data structure.

[0127] S104, performing standardization processing on the unified data based on the data processing layer to obtain standard data DB=NM(DT), where NM is a standardization processing function.

[0128] Convert data from all platforms into a standardized format to simplify subsequent data processing and analysis, including:

[0129] Remove invalid data: Clear invalid or incomplete data records, such as null values, malformed data, etc.

[0130] Noisy data processing: Remove or correct noisy data, which may be caused by system errors or user input errors.

[0131] Duplicate data processing: Detect and remove duplicate data records to ensure data uniqueness and accuracy.

[0132] Unified data format: Convert data in different formats into a unified internal format (such as unified JSON format) for subsequent processing.

[0133] Field mapping: Map and convert data fields of different social media platforms, such as converting different fields such as "user" and "author" into "username".

[0134] Data type conversion: Convert dates and numbers in string format to standard date format, integer or floating point type to ensure the consistency of data types.

[0135] Merge data fields: Multiple fields may be merged into one as needed, for example, multiple parts of an address may be merged into one complete address field.

[0136] Derived variables: Create new data fields or variables that may be calculated or derived from existing data, such as extracting the day of the week from the date of a post.

[0137] S105, performing identity authentication, authorization and data encryption operations on the standard data DB through the security layer to obtain security data DA=E(P(DB)), where P is the authority check function and E is the encryption function.

[0138] The security layer is a critical part of API request processing. It is responsible for performing a series of security operations, including authentication, authorization, and data encryption.

[0139] Authentication typically involves verifying the authentication credentials provided in the request (such as API keys, OAuth tokens, etc.) to confirm the identity of the requester. If authentication fails, the request will be rejected.

[0140] The permission check function P performs a permission check based on the requester's identity to ensure that only users with appropriate permissions can access specific resources or perform certain operations. If the permission check fails, the request will also be rejected.

[0141] Before data transmission, the data is encrypted using the encryption function E. The choice of encryption algorithm depends on security policies and compliance requirements. The purpose of encryption is to protect the integrity and confidentiality of data during transmission. The encrypted data is used as secure data DA and is ready to be sent to the subsequent processing layer or directly responded to the client.

[0142] In this way, the security layer can effectively protect the system from unauthorized access and potential data leakage risks, ensuring the integrity and confidentiality of the data.

[0143] S106: Evaluate the security data DA using the cache layer to obtain a cache index CI=CP(DA), so as to determine the storage time and storage location of the security data DA in the cache layer based on the cache index CI.

[0144] In the process of API request processing, the cache layer can significantly improve the performance and response speed of the system. The main task of the cache layer is to decide which data can be cached and how to cache this data based on the content of the request.

[0145] The cache index CI is a quantitative indicator used to evaluate the cache value of data. Generally speaking, the higher the cache index, the more suitable the data is for caching. The evaluation function CP will consider multiple factors to calculate the cache index CI, including but not limited to the data update frequency, data importance, data size, data access frequency, etc. Depending on the cache index CI, data may be cached in different locations and have different expiration times.

[0146] If the cache index is high, it means that the data is frequently accessed and is not easily outdated, so it can be cached for a long time. Such data can be placed in a fast-access location, such as a memory cache, and has a long survival time.

[0147] If the cache index is low, it means that the data is accessed less frequently or is easily outdated, and such data can be cached for a short period of time or not cached. The storage location can choose a slower disk cache with a shorter lifetime.

[0148] If the data requested by an API is frequently accessed but updated less frequently, its cache index CI may be high. In this case, you can choose to cache this data in memory and give it a longer expiration time to reduce the number of database queries and improve response speed.

[0149] On the contrary, if the data is updated frequently or accessed less frequently, its cache index CI may be low. In this case, you can choose to cache this data on disk and give it a short expiration time, or not cache this data at all.

[0150] In this way, the cache layer can automatically adjust the cache strategy according to the characteristics of the data to achieve optimal performance and resource utilization.

[0151] By accessing multiple social media platforms through a unified API gateway, the present invention brings many advantages and is applicable to a variety of business scenarios. These advantages and applications help various organizations and developers to more effectively utilize social media data, improve business efficiency and decision-making quality, specifically in the following aspects:

[0152] The gateway provides a unified interface, reducing the complexity of direct interaction with multiple APIs, simplifying development and subsequent maintenance. Updates and maintenance are concentrated at the gateway level. When the API of the social media platform changes, only the adapter needs to be updated in the gateway without modifying the integration code of each application.

[0153] The speed and efficiency of data access are improved through a unified data processing and caching mechanism. Data standardization and cleaning are concentrated at the gateway layer to ensure data quality and provide reliable data support for subsequent analysis and application.

[0154] Unified authentication and authorization management reduces the risk of security vulnerabilities and improves data security. Data encryption and access control ensure the protection of sensitive information and comply with privacy protection regulations.

[0155] Through plug-in adapters and modular design, the gateway can be easily expanded to support new social media platforms or respond to API changes. The microservice architecture allows the gateway to be flexibly deployed and expanded to meet the needs of applications of different scales.

[0156] Reduce frequent updates and repeated development work caused by API changes, reduce maintenance costs, improve development efficiency, shorten product launch time, and quickly respond to market changes.

[0157] The main application scenarios of the present invention include:

[0158] Social media analysis: You can use a unified gateway to obtain multi-platform data for user behavior analysis, trend forecasting, and market research.

[0159] Digital marketing: The marketing team can access user data through a unified gateway to conduct precision marketing and advertising. It provides cross-platform marketing activity analysis and ROI evaluation to optimize marketing strategies.

[0160] Customer Service and Support: By integrating customer interaction data from multiple platforms, you can provide more consistent and responsive customer service. Analyze customer feedback and behavior patterns to improve customer satisfaction and loyalty.

[0161] Product development and innovation: Leverage cross-platform social media insights to develop new products or services that meet market needs. Obtain user feedback in real time to quickly iterate product features and designs.

[0162] Risk management and compliance monitoring: By monitoring content on social media platforms, timely identifying and responding to potential risks, implementing data protection and privacy policies, and ensuring data complies with relevant requirements.

[0163] Through these advantages and applications, the implementation of the unified gateway access of multiple social media platform APIs of the present invention provides organizations with a powerful tool to utilize social media data in a more efficient, secure and cost-effective manner to drive business growth and innovation.

[0164] According to a specific implementation of the embodiment of the present disclosure, after designing a dedicated adapter module for each social media platform, the method further includes:

[0165] A load balancer is deployed at the receiving layer to evenly distribute the requests from the receiving layer to each processing node.

[0166] According to a specific implementation of the embodiment of the present disclosure, the receiving layer is used to process all API requests RQ from the client, and the receiving layer is provided with a receiving function SR, which verifies the API request RQ and adds authentication information VI to the API request RQ that passes the verification, and obtains the authentication request message RI=SR(VI,RQ), including:

[0167] Define the time decay function f(t), complexity calculation function g(s) and effectiveness evaluation function h(u):

[0168]

[0169] t represents the timestamp of the API request RQ, T represents the current time T, is the time threshold;

[0170]

[0171] s represents the signature string contained in the API request RQ, |s| is the length of the signature string, are the characters in the signature string;

[0172]

[0173] u represents the user ID. If f(t)+g(s)+h(u)>α1, then:

[0174] SR(VI,RQ)=C(VI,RQ)={RQ,"AtIf",VI}

[0175] α1 is the first threshold, C() is the constructor, and AtIf represents the authentication result.

[0176] According to a specific implementation of the embodiment of the present disclosure, the receiving layer is used to process all API requests RQ from the client, and the receiving layer is provided with a receiving function SR, which verifies the API request RQ and adds authentication information VI to the API request RQ that passes the verification to obtain an authentication request message RI=SR(VI, RQ), and also includes:

[0177] Calculate the priority P(RQ,W) of request RQ:

[0178]

[0179] Where W = g(s), represents the mean value of W within the preset time period;

[0180] When the value of P(RQ, W) is less than the second threshold α2, the authentication result AtIf is set to empty.

[0181] According to a specific implementation of the embodiment of the present disclosure, the authentication request message RI is converted from a client format to an internal unified format through a business logic layer to obtain unified data DT=TS(RI), including:

[0182] Parse the key information in the authentication request message RI and extract the fields that need to be converted according to the conversion rules;

[0183] Create a new internal format object and fill the converted data into the internal format object;

[0184] The assembled internal format object is returned as unified data DT to the subsequent processing layer.

[0185] According to a specific implementation of the embodiment of the present disclosure, the data processing layer performs standardization processing on the unified data to obtain standard data DB=NM(DT), including:

[0186] Get pre-defined normalization rules to perform data cleaning, data type conversion, missing value processing, and outlier detection on unified data.

[0187] According to a specific implementation of the embodiment of the present disclosure, performing identity authentication, authorization and data encryption operations on the standard data DB through the security layer to obtain security data DA=E(P(DB)) includes:

[0188] Verify the identity information in the standard data DB to confirm the user's identity;

[0189] Check the requested resources in the standard data DB according to the user's role and permissions to determine whether the user has the right to perform the requested operation;

[0190] Encrypt sensitive data in standard data.

[0191] According to a specific implementation of the embodiment of the present disclosure, the use of the cache layer to evaluate the security data DA to obtain a cache index CI=CP(DA), so as to determine the storage time and storage location of the security data DA in the cache layer based on the cache index CI, includes:

[0192] Analyze the data attributes of security data DA, including access mode, data size, and data sensitivity;

[0193] Calculate the cache index CI according to the cache strategy and the data attributes of the security data DA;

[0194] The storage time and storage location of the security data DA are determined according to the calculated cache index CI.

[0195] Corresponding to the above method embodiment, see Figure 3 The embodiment of the present invention further discloses a multi-social media platform API unified gateway access device 30, comprising:

[0196] Setting module 301, designing a dedicated adapter module for each social media platform, and setting a unified gateway as a unified access point for all social media API interactions, wherein the unified gateway includes a receiving layer, a business logic layer, a data processing layer, a security layer, and a cache layer;

[0197] The receiving module 302 uses a receiving layer to process all API requests RQ from the client. The receiving layer is provided with a receiving function SR. The receiving function verifies the API request RQ and adds authentication information VI to the API request RQ that passes the verification to obtain an authentication request message RI=SR(VI, RQ).

[0198] The conversion module 303 converts the authentication request message RI from the client format to the internal unified format through the business logic layer to obtain unified data DT=TS(RI), where TS is a conversion function used to convert the API call of a specific platform into a unified internal format;

[0199] A standardization module 304 performs standardization processing on the unified data based on the data processing layer to obtain standard data DB=NM(DT), where NM is a standardization processing function;

[0200] The security module 305 performs identity authentication, authorization and data encryption operations on the standard data DB through the security layer to obtain security data DA=E(P(DB)), where P is a permission check function and E is an encryption function;

[0201] The storage module 306 uses the cache layer to evaluate the security data DA to obtain a cache index CI=CP(DA), so as to determine the storage time and storage location of the security data DA in the cache layer based on the cache index CI.

[0202] See also Figure 4 The embodiment of the present invention further provides an electronic device 60, the electronic device comprising:

[0203] at least one processor; and,

[0204] a memory communicatively connected to the at least one processor; wherein,

[0205] 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 API unified gateway access method in the aforementioned method embodiment.

[0206] 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.

[0207] 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 multi-social media platform API unified gateway access method in the aforementioned method embodiment.

[0208] 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.

[0209] like Figure 4As 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.

[0210] 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.

[0211] 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.

[0212] 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 method for accessing a unified gateway of multiple social media platform APIs, characterized in that: include: Design a dedicated adapter module for each social media platform and set up a unified gateway as a unified access point for all social media API interactions, the unified gateway including a receiving layer, a business logic layer, a data processing layer, a security layer, and a cache layer; The receiving layer is used to process all API requests RQ from the client. The receiving layer is provided with a receiving function SR. The receiving function verifies the API request RQ and adds authentication information VI to the API request RQ that passes the verification to obtain an authentication request message RI=SR(VI,RQ). The authentication request message RI is converted from the client format to the internal unified format through the business logic layer to obtain unified data DT=TS(RI), where TS is a conversion function used to convert the API call of a specific platform into a unified internal format; Based on the data processing layer, the unified data is standardized to obtain standard data DB=NM(DT), where NM is a standardization processing function; Perform identity authentication, authorization and data encryption operations on the standard data DB through the security layer to obtain security data DA=E(P(DB)), where P is the authority check function and E is the encryption function; The security data DA is evaluated by using the cache layer to obtain a cache index CI=CP(DA), so as to determine the storage time and storage location of the security data DA in the cache layer based on the cache index CI; wherein The receiving layer processes all API requests RQ from the client, and the receiving layer is provided with a receiving function SR, which verifies the API request RQ and adds authentication information VI to the API request RQ that passes the verification, and obtains an authentication request message RI=SR(VI, RQ), including: Define the time decay function f(t), complexity calculation function g(s) and effectiveness evaluation function h(u): t represents the timestamp of the API request RQ, T represents the current time T, is the time threshold; s represents the signature string contained in the API request RQ, |s| is the length of the signature string, are the characters in the signature string; u represents the user ID. If f(t)+g(s)+h(u)>α1, then: SR(VI,RQ)=C(VI,RQ)={RQ,"AtIf",VI} α1 is the first threshold, C() is the constructor, and AtIf represents the authentication result; Calculate the priority P(RQ,W) of request RQ: Where W = g(s), represents the mean value of W within the preset time period; When the value of P(RQ, W) is less than the second threshold α2, the authentication result AtIf is set to empty.

2. The method according to claim 1, characterized in that After designing a dedicated adapter module for each social media platform, the method further includes: A load balancer is deployed at the receiving layer to evenly distribute the requests from the receiving layer to each processing node.

3. The method according to claim 1, characterized in that: The authentication request message RI is converted from the client format to an internal unified format through the business logic layer to obtain unified data DT=TS(RI), including: Parse the key information in the authentication request message RI and extract the fields that need to be converted according to the conversion rules; Create a new internal format object and fill the converted data into the internal format object; The assembled internal format object is returned as unified data DT to the subsequent processing layer.

4. The method according to claim 3, characterized in that The data processing layer performs standardization processing on the unified data to obtain standard data DB=NM(DT), including: Get pre-defined normalization rules to perform data cleaning, data type conversion, missing value processing, and outlier detection on unified data.

5. The method according to claim 4, characterized in that The performing of identity authentication, authorization and data encryption operations on the standard data DB through the security layer to obtain security data DA=E(P(DB)) includes: Verify the identity information in the standard data DB to confirm the user's identity; Check the requested resources in the standard data DB according to the user's role and permissions to determine whether the user has the right to perform the requested operation; Encrypt sensitive data in standard data.

6. The method according to claim 5, characterized in that The step of evaluating the security data DA by using the cache layer to obtain a cache index CI=CP(DA), so as to determine the storage time and storage location of the security data DA in the cache layer based on the cache index CI, includes: Analyze the data attributes of security data DA, including access mode, data size, and data sensitivity; Calculate the cache index CI according to the cache strategy and the data attributes of the security data DA; The storage time and storage location of the security data DA are determined according to the calculated cache index CI.

7. A device for accessing a unified gateway of multiple social media platform APIs, characterized in that: include: Setting up modules, designing specialized adapter modules for each social media platform, and setting up a unified gateway as a unified access point for all social media API interactions, wherein the unified gateway includes a receiving layer, a business logic layer, a data processing layer, a security layer, and a cache layer; The receiving module uses the receiving layer to process all API requests RQ from the client. The receiving layer is provided with a receiving function SR. The receiving function verifies the API request RQ and adds authentication information VI to the API request RQ that passes the verification to obtain an authentication request message RI=SR(VI,RQ). The conversion module converts the authentication request message RI from the client format to the internal unified format through the business logic layer to obtain the unified data DT=TS(RI), where TS is a conversion function used to convert the API call of a specific platform into a unified internal format; A standardization module performs standardization processing on the unified data based on the data processing layer to obtain standard data DB=NM(DT), where NM is a standardization processing function; The security module performs identity authentication, authorization and data encryption operations on the standard data DB through the security layer to obtain security data DA=E(P(DB)), where P is the authority check function and E is the encryption function; A storage module is used to evaluate the security data DA using the cache layer to obtain a cache index CI=CP(DA), so as to determine the storage time and storage location of the security data DA in the cache layer based on the cache index CI; wherein The receiving layer processes all API requests RQ from the client, and the receiving layer is provided with a receiving function SR, which verifies the API request RQ and adds authentication information VI to the API request RQ that passes the verification, and obtains an authentication request message RI=SR(VI, RQ), including: Define the time decay function f(t), complexity calculation function g(s) and effectiveness evaluation function h(u): t represents the timestamp of the API request RQ, T represents the current time T, is the time threshold; s represents the signature string contained in the API request RQ, |s| is the length of the signature string, are the characters in the signature string; u represents the user ID. If f(t)+g(s)+h(u)>α1, then: SR(VI,RQ)=C(VI,RQ)={RQ,"AtIf",VI} α1 is the first threshold, C() is the constructor, and AtIf represents the authentication result; Calculate the priority P(RQ,W) of request RQ: Where W = g(s), represents the mean value of W within the preset time period; When the value of P(RQ, W) is less than the second threshold α2, the authentication result AtIf is set to empty.

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 so that the at least one processor can execute the multi-social media platform API unified gateway access method described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method and device for achieving data exchange based on data bus technology

    CN103338206A

  • Access request processing method and device, electronic equipment and computer storage medium

    CN111698250A

  • Unified management method and device for background authorization of multiple social media platforms

    CN118214615A

  • Cross platform network authentication and authorization model

    US20040093515A1