Data processing method and device, electronic equipment, storage medium and program product
By obtaining the instance objects of the applet and running platforms, and calling general or platform matching programs for data acquisition and processing, the problem of multi-platform applet code development and maintenance is solved, efficient data acquisition compatibility and reduce code costs.
Patent Information
- Application Number
- CN202410041008.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-10
- Publication Date
- 2025-07-11
AI Technical Summary
In the prior art, mini programs need to provide collection codes separately when registering on different platforms, resulting in large workloads in code development and difficult to maintain, making it difficult to achieve data acquisition compatibility and efficient data acquisition for multiple platforms.
By obtaining the instance objects of the data source and the corresponding running platform, calling the general program or platform matching program to perform data acquisition and processing, using general programs to achieve multi-platform compatibility, and performing platform-specific processing when necessary, reducing code development and maintenance costs.
Improves the compatibility and efficiency of data acquisition for multiple operating platforms, reduces code development costs, and simplifies the code maintenance process.
Smart Images

Figure CN120295807A_ABST
Abstract
Description
Technical Field
[0001] This application relates to data acquisition technology, and in particular, to a data processing method, apparatus, electronic device, computer-readable storage medium, and computer program product. Background Art
[0002] The same application can have mini-programs on different platforms. For example, a car rental application A can register a mini-program on a social platform, a car rental application A can register a mini-program on a payment platform, and a car rental application A can also register a mini-program on an information flow platform. The mini-programs of the car rental application A on each platform need to report data to the background server of the car rental application A so that the background server can back up the data reported by the mini-programs.
[0003] However, since the mini-programs in the related art are registered on different platforms, it is necessary to provide collection codes for the mini-programs on different platforms respectively, so as to realize data reporting and data collection for the mini-programs on different platforms, resulting in a large amount of code development work and being difficult to maintain. Summary of the Invention
[0004] Embodiments of this application provide a data processing method, apparatus, electronic device, computer-readable storage medium, and computer program product, which can improve the compatibility of data collection for multiple operating platforms and improve the data collection efficiency.
[0005] The technical solution of the embodiments of this application is implemented as follows:
[0006] Embodiments of this application provide a data processing method, including:
[0007] Obtain an instance object of a data source, and based on the instance object, obtain a first operating platform corresponding to the data source, where the first operating platform is from a set of operating platforms;
[0008] Obtain the reporting parameters of the data source;
[0009] When the reporting parameters belong to the general reporting parameters of the set of operating platforms, call a general program to perform data collection processing corresponding to the reporting parameters, where the general program is an execution program compatible with all operating platforms in the set of operating platforms;
[0010] When the reporting parameters do not belong to the general reporting parameters, call a platform program matching the first operating platform to perform data collection processing corresponding to the reporting parameters.
[0011] Embodiments of this application provide a data processing apparatus, including:
[0012] An acquisition module, configured to acquire an instance object of a data source, and acquire a first operating platform corresponding to the data source based on the instance object, where the first operating platform is from a set of operating platforms;
[0013] The acquisition module is further configured to acquire reporting parameters of the data source;
[0014] A general module, configured to, when the reporting parameters belong to general reporting parameters of the set of operating platforms, call a general program to perform data acquisition and processing corresponding to the reporting parameters, where the general program is an execution program compatible with all operating platforms in the set of operating platforms;
[0015] A private module, configured to, when the reporting parameters do not belong to the general reporting parameters, call a platform program matching the first operating platform to perform data acquisition and processing corresponding to the reporting parameters.
[0016] In the above solution, the acquisition module is further configured to: when the operating platform from which the instance object originates cannot be identified, use the default operating platform in the set of operating platforms as the first operating platform; when the operating platform from which the instance object originates is identified, use the identified operating platform as the first operating platform.
[0017] In the above solution, the default operating platform includes at least one of the following: an operating platform preset in the set of operating platforms, an operating platform with the highest data acquisition frequency in the set of operating platforms, and an operating platform with the fewest platform reporting parameters in the set of operating platforms.
[0018] In the above solution, after acquiring the first operating platform, the acquisition module is further configured to: perform an assignment process on global variables of the general program and the platform program, so that the global variables can be called by at least one of the general program and the platform program.
[0019] In the above solution, the private module is further configured to: when the reporting parameter is the page title in the platform reporting parameters, call the platform program to perform the following process: when the page title is not empty, automatically acquire the page title data set for the instance object as the data acquisition result corresponding to the reporting parameter; when the page title is empty, pull a null string as the page title data as the data acquisition result corresponding to the reporting parameter.
[0020] In the above solution, before calling the platform program matching the first operating platform to perform data acquisition and processing corresponding to the reported parameters, the private module is further configured to: when the parameter meaning of the reported parameter is the same as that of the reported parameters of all other operating platforms, modify the parameter name of the configured program to obtain a platform program matching the first operating platform, where the configured program is an execution program corresponding to the reported parameters of the other operating platforms; when the parameter meaning of the reported parameter is different from that of the reported parameters of all other operating platforms, create a platform program for implementing the acquisition function corresponding to the reported parameter.
[0021] In the above solution, the device further includes a storage module, and the storage module is configured to obtain fields from the data acquisition results corresponding to the reported parameters; based on the first operating platform represented by the fields, perform a database storage process corresponding to the first operating platform on the data acquisition results.
[0022] In the above solution, the storage module is further configured to perform any one of the following processes: obtain the data reporting event corresponding to the data acquisition result, and store the data acquisition result in the database at the storage location corresponding to the data reporting event; obtain the parameter type corresponding to the data acquisition result, and store the data acquisition result in the database at the storage location corresponding to the parameter type.
[0023] In the above solution, the storage module is further configured to: based on the platform reported parameters of each operating platform, create a configuration file for the platform program corresponding to each platform reported parameter, and store the configuration file in the cloud server; the private module is further configured to read the configuration file corresponding to the reported parameter from the cloud server to call the platform program matching the first operating platform to perform data acquisition and processing corresponding to the reported parameter.
[0024] In the above solution, after obtaining the first operating platform corresponding to the data source based on the instance object, the obtaining module is further configured to perform any one of the following processes: receive a data reporting request from the first operating platform, where the data reporting request carries the reported parameter; perform a polling process on the first operating platform based on the reported parameter.
[0025] An embodiment of the present application provides an electronic device, including:
[0026] A memory for storing computer-executable instructions;
[0027] A processor for implementing the data processing method provided by the embodiment of the present application when executing the computer-executable instructions stored in the memory.
[0028] An embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions for causing a processor to implement the data processing method provided by the embodiment of the present application when executed.
[0029] An embodiment of the present application provides a computer program product including computer-executable instructions that implement the data processing method provided by the embodiment of the present application when executed by a processor.
[0030] The embodiment of the present application has the following beneficial effects:
[0031] Obtain an instance object of the data source and obtain the first operating platform corresponding to the instance object of the data source, where the first operating platform is from a set of operating platforms; when the reporting parameter belongs to the general reporting parameters of the set of operating platforms, call a general program to perform data collection processing for the corresponding reporting parameter. The general program is an execution program that is compatible with all operating platforms in the set of operating platforms. Since the applets of multiple platforms will have similar functions, the reuse effect achieved by the general program here reduces the code development cost; when the reporting parameter belongs to the platform reporting parameter of the first operating platform, call a platform program matching the first operating platform to perform data collection processing for the corresponding reporting parameter. This is equivalent to only the platform program requiring a separate dimension, thereby reducing the code maintenance cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 is a schematic structural diagram of the data processing system provided by the embodiment of the present application;
[0033] Figure 2 is a schematic structural diagram of the electronic device provided by the embodiment of the present application;
[0034] Figures 3A - 3C is a schematic flowchart of the data processing method provided by the embodiment of the present application;
[0035] Figures 4A - 4D is a schematic interface diagram of the data processing method provided by the embodiment of the present application;
[0036] Figure 5 is an overall architecture diagram of the data processing method provided by the embodiment of the present application;
[0037] Figure 6 is a timing program diagram of the data processing method provided by the embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0038] To make the objectives, technical solutions and advantages of this application clearer, the following will further describe this application in detail with reference to the accompanying drawings. The described embodiments should not be construed as limitations on this application. All other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the scope of protection of this application.
[0039] In the following description, reference is made to "some embodiments", which describe a subset of all possible embodiments. However, it can be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments and can be combined with each other without conflict.
[0040] In the following description, the terms "first / second / third" are merely used to distinguish similar objects and do not represent a specific order for the objects. It can be understood that "first / second / third" can be interchanged with a specific order or sequence when permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0041] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0042] Before further elaborating on the embodiments of this application, the nouns and terms involved in the embodiments of this application are explained. The nouns and terms involved in the embodiments of this application are subject to the following explanations.
[0043] 1) A software development kit (SDK) is generally a collection of development tools for software engineers to build application software for specific software packages, software frameworks, hardware platforms, operating systems, etc.
[0044] 2) Mini programs. A mini program is an application that can be used without being downloaded and installed. It realizes the dream of making applications "within reach". Users can open the application by scanning or searching. It also embodies the concept of "using and leaving". Users don't need to worry about whether they have installed too many applications. Applications will be everywhere and available at any time, but there is no need to install or uninstall them.
[0045] 3) General reporting parameters. Reporting parameters refer to the parameters that need to be reported from each platform to the server. For example, transaction time, account identification, etc. Here, the general reporting parameters refer to the parameters that all platforms need to report. For example, each platform needs to report the start time of the proxy event, etc.
[0046] 4) The platform reports parameters. The reported parameters refer to the parameters that need to be reported from each platform to the server. For example, transaction time, account identifier, etc. The platform-reported parameters here refer to the reported parameters specific to some platforms, and not all platforms have such reported parameters.
[0047] In the related art, for multiple platforms, multiple complete SDK codes are used. For applets on different platforms, multiple sets of SDK codes need to be provided. Therefore, for different platforms, development needs to be carried out again to provide multiple sets of SDK codes to handle the slight differences in reporting and functions for different platforms.
[0048] In the related art, the need to provide multiple sets of SDK codes results in a large development workload, high labor costs, and a large amount of duplicate code. The code maintainability is poor. The code for each platform is scattered everywhere, making it inconvenient to maintain and modify; the code update and iteration are complex. Whenever a new function needs to be added to the SDK, it is necessary to modify the SDK code for each platform synchronously, resulting in an increased workload and being difficult to maintain, and a large amount of duplicate code will be generated.
[0049] The embodiments of the present application provide a data processing method, device, electronic device, computer-readable storage medium, and computer program product, which can improve the compatibility of data collection for multiple operating platforms and improve the data collection efficiency.
[0050] In the present application, when implementing the data collection technical solution, when the above embodiments of the present application are applied to specific products or technologies, the relevant data collection, use, and processing processes (such as the processing of road network data and trajectory data) should comply with the requirements of national laws and regulations, conform to the principles of legality, propriety, and necessity, do not involve obtaining data types prohibited or restricted by laws and regulations, and will not interfere with the normal operation of the target website.
[0051] To facilitate a better understanding of the data processing method provided by the embodiments of the present application, first, an exemplary implementation scenario of the data processing method provided by the embodiments of the present application is described.
[0052] In one implementation scenario, refer to Figure 1 , Figure 1It is a schematic architecture diagram of the data processing system provided by the embodiments of the present application. The server 200 obtains an instance object of the data source from the applet A running in the terminal 400 through the network 300, and obtains the first operating platform corresponding to the instance object of the data source (referring to the social platform on which the applet A runs on the terminal 400), where the first operating platform is from the set of operating platforms; the server 200 receives the reporting request of the terminal 400, and the reporting request carries reporting parameters. When the reporting parameters belong to the general reporting parameters of the set of operating platforms, the server 200 calls a general program to perform data collection processing corresponding to the reporting parameters on the applet A. The general program is an execution program compatible with all operating platforms in the set of operating platforms; when the reporting parameters belong to the platform reporting parameters of the first operating platform, a platform program matching the first operating platform is called to perform data collection processing corresponding to the reporting parameters on the applet A.
[0053] In an implementation scenario, the terminal 400 obtains an instance object of the data source from the running applet A, and obtains the first operating platform corresponding to the instance object of the data source (referring to the social platform on which the applet A runs on the terminal 400). The first operating platform is from the set of operating platforms; the terminal 400 receives the reporting request of the applet A, and the reporting request carries reporting parameters. When the reporting parameters belong to the general reporting parameters of the set of operating platforms, the terminal 400 calls a general program to perform data collection processing corresponding to the reporting parameters on the applet A. The general program is an execution program compatible with all operating platforms in the set of operating platforms; when the reporting parameters belong to the platform reporting parameters of the first operating platform, the terminal 400 calls a platform program matching the first operating platform to perform data collection processing corresponding to the reporting parameters on the applet A.
[0054] In some embodiments, the terminal 400 can implement the data processing method provided by the embodiments of the present application by running a computer program. For example, the computer program can be a native program or software module in the operating system; it can be a local (Native) application (APP, APPlication), that is, a program that needs to be installed in the operating system to run, such as a dressing game APP (i.e., the above-mentioned client 410); it can also be a small program, that is, a program that only needs to be downloaded to the browser environment to run; it can also be a game applet that can be embedded in any APP. In short, the above computer program can be any form of application program, module or plug-in.
[0055] In some embodiments, the embodiments of the present application can also be implemented by means of cloud technology. Cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and networks within a wide area network or a local area network to achieve data calculation, storage, processing, and sharing.
[0056] Cloud technology is the general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model. It can form a resource pool, be used on demand, and is flexible and convenient. Cloud computing technology will become an important support. The background services of the technical network system require a large amount of computing and storage resources.
[0057] The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, as well as big data and artificial intelligence platforms. The terminal 400 can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, a smart voice interaction device, a smart home appliance, a vehicle terminal, an aircraft, etc., but is not limited thereto. The terminal and the server can be directly or indirectly connected through wired or wireless communication methods, and there is no limitation in the embodiments of the present application.
[0058] See Figure 2 , Figure 2 is a schematic structural diagram of an electronic device for data processing provided by the embodiments of the present application. Figure 2 As shown, the terminal 400 includes: at least one processor 410, a memory 450, at least one network interface 420, and a user interface 430. Each component in the terminal 400 is coupled together through a bus system 440. It can be understood that the bus system 440 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 440 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clear illustration, in Figure 2 all kinds of buses are labeled as the bus system 440.
[0059] The processor 410 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP, Digital Signal Processor), or other programmable program devices, discrete gate or transistor program devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0060] The user interface 430 includes one or more output devices 431 that enable the presentation of media content, including one or more speakers and / or one or more visual display screens. The user interface 430 also includes one or more input devices 432, including user interface components that help users input, such as keyboards, mice, microphones, touch screen displays, cameras, and other input buttons and controls.
[0061] The memory 450 can be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memories, hard disk drives, optical disc drives, etc. The memory 450 optionally includes one or more storage devices that are physically remote from the processor 410.
[0062] The memory 450 includes volatile memory or non-volatile memory, and may also include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), and the volatile memory can be random access memory (RAM). The memory 450 described in the embodiments of the present application is intended to include any suitable type of memory.
[0063] In some embodiments, the memory 450 is capable of storing data to support various operations. Examples of such data include programs, modules, and data structures, or subsets or supersets thereof, which are illustrated below.
[0064] The operating system 451 includes system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks;
[0065] The network communication module 452 is used to reach other electronic devices via one or more (wired or wireless) network interfaces 420. Exemplary network interfaces 420 include: Bluetooth, Wi-Fi (Wireless Fidelity), and USB (Universal Serial Bus), etc.;
[0066] The presentation module 453 is used to enable the presentation of information (such as a user interface for operating peripheral devices and displaying content and information) via one or more output devices 431 associated with the user interface 430 (such as a display screen, a speaker, etc.);
[0067] The input processing module 454 is used to detect and translate one or more user inputs or interactions from one of one or more input devices 432.
[0068] In some embodiments, the data processing device provided by the embodiments of the present application can be implemented in software. Figure 2 Shown is a data processing device 455 stored in the memory 450, which can be software in the form of programs and plugins, etc., including the following software modules: an acquisition module 4551, a general module 4552, and a private module 4553. These modules are programmatic, and thus can be arbitrarily combined or further split according to the functions implemented. The functions of each module will be described below.
[0069] The data processing method provided by the embodiments of the present application will be specifically described below in conjunction with the accompanying drawings. The data processing method provided by the embodiments of the present application can be executed independently by the terminal 400 in Figure 1 or can be executed collaboratively by the terminal 400 and the server 200 in Figure 1 .
[0070] Below, taking the terminal 400 in Figure 1 executing the data processing method provided by the embodiments of the present application independently as an example for illustration. Refer to Figure 3A . Figure 3A is a schematic flowchart of the data processing method provided by the embodiments of the present application, and will be described in conjunction with Figure 3A the steps 101-104 shown.
[0071] It should be noted that Figure 3A the method shown can be executed by various forms of computer programs running on the terminal 400, and is not limited to the above-mentioned client 410, and can also be the above-mentioned operating system 451, software module and script. Therefore, the client should not be regarded as a limitation to the embodiments of the present application.
[0072] In step 101, an instance object of the data source is obtained, and a first operating platform corresponding to the data source is obtained based on the instance object, where the first operating platform is from a set of operating platforms.
[0073] As an example, the instance object is an object created by instantiation. In the initialization stage of the applet, an instance object of the data source is obtained from the applet A running on a certain platform, and the first operating platform corresponding to the instance object is judged, that is, the first operating platform on which the applet A is currently running is determined.
[0074] In some embodiments, refer to Figure 3B , obtaining the first operating platform corresponding to the data source based on the instance object in step 101 can be implemented through Figure 3B the steps 1011 to 1012 shown.
[0075] In step 1011, when the operating platform from which the instance object is derived cannot be recognized, the default operating platform in the set of operating platforms is used as the first operating platform.
[0076] In step 1012, when the operating platform from which the instance object is derived is recognized, the recognized operating platform is used as the first operating platform.
[0077] As an example, here the operating platform from which the instance object originates can be identified through the label of the instance object. For example, if the instance object originates from social platform A, then social platform A is taken as the first operating platform. When the operating platform from which the instance object originates cannot be identified due to a program error, the default operating platform B can be taken as the first operating platform. Through the embodiments of the present application, a fallback can be achieved, so that even when a program error occurs, the first operating platform corresponding to the corresponding instance can be obtained, enabling subsequent special processing for the first operating platform to be performed.
[0078] In some embodiments, the default operating platform includes at least one of the following: the operating platform preset in the set of operating platforms, the operating platform with the highest data collection frequency in the set of operating platforms, and the operating platform with the fewest platform reporting parameters in the set of operating platforms.
[0079] As an example, the default operating platform here can be a preset operating platform, that is, any operating platform can be preset as the default operating platform, or an operating platform that meets the conditions can be used as the default operating platform. For example, the operating platform with the highest data collection frequency can be used as the default operating platform, and the operating platform with the fewest platform reporting parameters can be used as the default operating platform, so that the probability of subsequent special processing matching the actual operating platform is greater, improving the usability and stability of the data collection process.
[0080] In some embodiments, after obtaining the first operating platform, assignment processing is performed on the global variables of the general program and the platform program, so that the global variables can be called by at least one of the general program and the platform program.
[0081] As an example, in a computer programming language, a global variable refers to a variable with a global scope, which means it is visible and thus accessible throughout the program. By accessible, it means globally readable and globally writable. In a compiled language, a global variable is usually a static variable, and its life cycle is the entire runtime of the program. Global variables are usually dynamically allocated by the interpreter when declared, because interpreted languages are in a read>interpret>execute mode, unlike compiled languages where variable attributes can be predicted before running, and variable attributes cannot be obtained before an interpreted language reads and interprets. Through global variable assignment processing, the code maintenance cost and code call cost can be reduced.
[0082] In step 102, the reporting parameters of the data source are obtained;
[0083] In some embodiments, the reporting parameters of the data source in step 102 can be implemented through the following technical solutions: perform any one of the following processes: receive the data reporting request of the first operating platform, where the reporting parameters are carried in the data reporting request; perform polling processing on the first operating platform, receive the polling result, and extract the reporting parameters from the polling result.
[0084] As an example, it can be that the applet actively reports data or polling processing is performed on the applet. For example, whenever the applet has data to report, the first operating platform where the applet is located will actively send a data reporting request to the server, and the reporting parameters are carried in the data reporting request; for example, the server sends a data collection request to the first operating platform where the applet is located every time period, which is polling processing. Every time a polling request is received, it is judged whether there is new data or data change within the most recent time period. If there is new data or data change, the reporting parameters corresponding to the new data or the changed data are returned to the server.
[0085] In step 103, when the reporting parameters belong to the general reporting parameters of the operating platform set, call the general program to perform data collection processing corresponding to the reporting parameters, where the general program is an execution program compatible with all operating platforms in the operating platform set.
[0086] As an example, call the general program to perform data collection processing corresponding to the reporting parameters for the instance object. The reporting parameters refer to the parameters that need to be reported from each platform to the server. For example, transaction time, account identifier, etc. Here, the general reporting parameters refer to the parameters that all platforms need to report. For example, each platform needs to report the start time of the proxy event, etc.
[0087] In step 104, when the reporting parameters do not belong to the general reporting parameters, call the platform program matching the first operating platform to perform data collection processing corresponding to the reporting parameters.
[0088] As an example, call the platform program matching the first operating platform to perform data collection processing corresponding to the reporting parameters for the instance object. The reporting parameters refer to the parameters that need to be reported from each platform to the server. For example, transaction time, account identifier, etc. When the reporting parameters do not belong to the general reporting parameters, it means that the reporting parameters can be platform reporting parameters. Here, the platform reporting parameters refer to the parameters unique to some platforms, and not all platforms have such reporting parameters.
[0089] In some embodiments, the data collection and processing of the reported parameters corresponding to the platform program matching the first operating platform in step 104 can be implemented through the following technical solutions: when the reported parameter is the page title among the platform reported parameters, the following processing is performed by calling the platform program: when the page title is not empty, the page title data set for the instance object is automatically obtained as the data collection result corresponding to the reported parameter; when the page title is empty, an empty string is pulled as the page title data, as the data collection result corresponding to the reported parameter.
[0090] As an example, the page title also belongs to the platform parameters, and the acquisition strategies for the page titles of different platforms are different. The mini-programs of social platforms can automatically obtain the page title, but other mini-programs also need to be compatible. Dynamically pull the page title set by the developer. If it is not set, it is default compatible with an empty string. If the page title is set, the mini-program automatic reporting is realized by dynamically pulling the page title. Since data collection usually involves the data collection of the page title, the compatibility processing for the page title can effectively realize the reuse of the data collection program and improve the feasibility of data collection.
[0091] In some embodiments, before calling the platform program matching the first operating platform to perform the data collection processing corresponding to the reported parameter, when the parameter meaning of the reported parameter is the same as the parameter meanings of the reported parameters of all other operating platforms, the parameter name of the configured program is modified to obtain the platform program matching the first operating platform. The configured program is the execution program corresponding to the reported parameter of the other operating platform; when the parameter meaning of the reported parameter is different from the parameter meanings of the reported parameters of all other operating platforms, a platform program for implementing the collection function corresponding to the reported parameter is created.
[0092] As an example, the parameter meaning actually represented by the reported parameter openid of the first operating platform is the account identifier, and the parameter meaning actually represented by the reported parameter userid of the second operating platform is also the account identifier. However, the two operating platforms use different reported parameters to represent the same parameter meaning. For example, the execution program A for the data collection of openid has been configured (the execution program corresponding to the reported parameter of the other operating platform), then the parameter of the execution program A is modified, and the reported parameter openid is modified to the reported parameter userid.
[0093] As an example, when the reported parameter of the first operating platform is different from the parameter meanings of the reported parameters of all other operating platforms, that is, the parameter meaning of the reported parameter of the first operating platform is unique, then a platform program corresponding to the reported parameter of the first operating platform needs to be recreated.
[0094] Through the embodiments of the present application, the creation cost of the platform program can be reduced, and the data collection efficiency can be improved.
[0095] In some embodiments, referring to Figure 3C , after step 104 is executed, steps 105 to 106 can be executed.
[0096] In step 105, fields are obtained from the data collection results corresponding to the reported parameters.
[0097] In step 106, based on the first operating platform characterized by the fields, the data collection results are subjected to database storage processing corresponding to the first operating platform.
[0098] As an example, the data collection results will carry fields corresponding to the reported parameters. For example, if the reported parameter is openid, then the field is field A corresponding to openid. The mapping relationship between the fields and the operating platforms is configured in advance. Field A and the first operating platform A correspond to each other. Therefore, the server can clearly know that the data collection results come from the first operating platform A. Therefore, the data collection results are stored at the storage address corresponding to the first operating platform A. Here, the storage address can be a database or a data table, that is, database storage processing and data table storage processing are performed. Through the embodiments of the present application, classified storage can be performed, thereby improving the subsequent query efficiency.
[0099] In some embodiments, the database storage processing of the data collection results corresponding to the first operating platform in step 106 above can be implemented through the following technical solutions: any one of the following processes is executed: obtaining the data reporting event corresponding to the data collection results, and storing the data collection results in the database at the storage location corresponding to the data reporting event; obtaining the parameter types corresponding to the data collection results, and storing the data collection results in the database at the storage location corresponding to the parameter types.
[0100] As an example, first, the data reporting event corresponding to the data collection results can be obtained. For example, data collection result A is the newly added data generated due to a payment event. The data reporting event corresponding to data collection result A is the payment event. The payment event has a corresponding data table A. Then, data collection result A is stored in data table A (the storage location of the payment event).
[0101] As an example, the parameter types corresponding to the data collection results can also be obtained. For example, the parameter type is the account ID, and the storage location corresponding to the account ID is table A. Then, data collection result A of the account ID is stored in data table A (the storage location of the payment event).
[0102] Through the embodiments of the present application, the data collection results can be stored in a classified manner, so as to improve the query efficiency when querying the data collection results subsequently.
[0103] In some embodiments, based on the platform reporting parameters of each of the running platforms, a configuration file of the platform program corresponding to each of the platform reporting parameters is created, and the configuration file is stored in the cloud server; the data collection processing corresponding to the reporting parameters can be performed by calling the platform program matching the first running platform in step 104 through the following technical solution: reading the configuration file corresponding to the reporting parameters from the cloud server to call the platform program matching the first running platform to perform the data collection processing corresponding to the reporting parameters.
[0104] As an example, a configuration file corresponding to the platform program can be generated, and the platform program can be executed by reading the configuration file. Different settings of different platforms can be abstracted into a configuration information and stored remotely, further decoupling and improving the code maintainability.
[0105] Through the embodiments of the present application, an instance object of the data source is obtained, and the first running platform corresponding to the instance object of the data source is obtained. The first running platform is from the set of running platforms; when the reporting parameter belongs to the general reporting parameter of the set of running platforms, a general program is called to perform the data collection processing corresponding to the reporting parameter. The general program is an execution program compatible with all running platforms in the set of running platforms. Since the applets of multiple platforms have similar functions, the reuse effect achieved by the general program here reduces the code development cost; when the reporting parameter belongs to the platform reporting parameter of the first running platform, a platform program matching the first running platform is called to perform the data collection processing corresponding to the reporting parameter, which is equivalent to only the platform program requiring a separate dimension, thereby reducing the code maintenance cost.
[0106] Next, the exemplary application of the embodiments of the present application in an actual application scenario will be described.
[0107] In some embodiments, the server obtains an instance object of the data source from the applet A running on the terminal, and obtains the first running platform corresponding to the instance object of the data source ((referring to the social platform on which the applet A runs on the terminal)). The first running platform is from the set of running platforms; the server receives a reporting request from the terminal, and the reporting request carries a reporting parameter. When the reporting parameter belongs to the general reporting parameter of the set of running platforms, the server calls a general program to perform the data collection processing corresponding to the reporting parameter on the applet A. The general program is an execution program compatible with all running platforms in the set of running platforms; when the reporting parameter belongs to the platform reporting parameter of the first running platform, a platform program matching the first running platform is called to perform the data collection processing corresponding to the reporting parameter on the applet A.
[0108] In some embodiments, the main application scenario of the data processing method provided by the embodiments of the present application is that a set of SDKs are accessed by mini-programs on each platform to implement data collection. Figures 4A through 4D The mini-programs of several platforms are shown. The same set of code can be introduced by the mini-program codes of different platforms to implement data collection.
[0109] In some embodiments, refer to Figure 5 , in the initialization stage of the SDK, obtain an instance from the mini-program, and judge the running platform from which the instance comes, such as a social platform, a payment platform, etc. It is necessary to ensure that the corresponding instance is obtained in the initialization stage before data reporting. After obtaining the platform instance, assign values to the global variables of the SDK, and it is also necessary to ensure that the instance obtained by each execution of the SDK is the instance of the current platform. At the same time, do a good job in fallback processing to ensure that when the instance acquisition fails, the instance of the social platform is used by default. After global assignment, different special processing is performed for different platforms. For example, the common parameter of the mini-program of the social platform is openid, but the mini-program of the payment platform does not have openid as a common parameter. Therefore, special processing is required here. For example, when processing the mini-program of the payment platform, userid is obtained; the page title also belongs to the common parameter. The mini-program of the social platform can automatically obtain the page title, but other mini-programs cannot, and compatibility processing is also required. Dynamically pull the page title set by the developer. If it is not set, it is default compatible with an empty string. If it is set, the mini-program can be automatically reported. The embodiments of the present application also need to expand the characteristics of each platform. Each platform has its own special capabilities. For example, social mini-programs tend to have social functions, such as adding friends and sharing spaces, and there are corresponding data reports for related events. The code needs to complete these functions and expand the collection capabilities of the SDK for different platform functions; for different platforms, field identification is performed on the reported data to facilitate the server to distinguish and clean, and different platforms are processed differently for operations such as database storage and table storage.
[0110] In some embodiments, refer to Figure 6, mini program initialization, SDK initialization, SDK obtains the platform instance object where the mini program is located, and determines the platform where the instance object is located, and returns the platform where it is located. At this point, the initialization is completed. Mini program proxy event, the mini program initiates a data reporting request, the SDK obtains the reporting information, obtains the reporting data according to different platforms, returns the reporting data, and stores the reporting data to the server, and the server returns the reporting result to the mini program. The roles involved in the above sequence diagram include mini program, SDK, SDK compatible handler and server. In summary, the overall process is as follows: mini program initialization, obtains the platform instance object; different platforms proxy different events and obtain reporting information; according to different platforms, set special capabilities for different platforms; add platform identification, and report data to the server.
[0111] The embodiments of the present application can realize multiple uses of one code, improve development efficiency, reduce labor costs, and improve code reusability; the embodiments of the present application can reduce code complexity, because there are most of the same codes. When adding new functions, they can be modified in one place and take effect on multiple platforms, reducing code complexity while improving maintainability and development efficiency. The embodiments of the present application can also extract different settings of different platforms into a configuration information and store it remotely, further decoupling and improving code maintainability.
[0112] It is understandable that in the embodiments of the present application, related data such as user information is involved. When the embodiments of the present application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0113] The following is a description of an exemplary structure of the data processing device 455 provided in the embodiment of the present application implemented as a software module. In some embodiments, Figure 2 As shown, the software modules stored in the data processing device 455 of the memory 450 may include: an acquisition module 4551, used to acquire the instance object of the data source, and acquire the first operating platform corresponding to the data source based on the instance object, wherein the first operating platform comes from an operating platform set; a general module 4552, used to call a general program to execute data collection and processing corresponding to the reporting parameter when the reporting parameter belongs to the general reporting parameter of the operating platform set, wherein the general program is an execution program compatible with all operating platforms in the operating platform set; a private module 4553, used to call a platform program matching the first operating platform to execute data collection and processing corresponding to the reporting parameter when the reporting parameter does not belong to the general reporting parameter.
[0114] In some embodiments, the obtaining module is further configured to: when the operating platform from which the instance object originates cannot be identified, use the default operating platform in the set of operating platforms as the first operating platform; when the operating platform from which the instance object originates is identified, use the identified operating platform as the first operating platform.
[0115] In some embodiments, the default operating platform includes at least one of the following: an operating platform preset in the set of operating platforms, an operating platform with the highest data collection frequency in the set of operating platforms, and an operating platform with the fewest platform reporting parameters in the set of operating platforms.
[0116] In some embodiments, after obtaining the first operating platform, the obtaining module is further configured to: assign values to the global variables of the general program and the platform program so that the global variables can be called by at least one of the general program and the platform program.
[0117] In some embodiments, the private module is further configured to: when the reporting parameter is the page title among the platform reporting parameters, perform the following processing by calling the platform program: when the page title is not empty, automatically obtain the page title data set for the instance object as the data collection result corresponding to the reporting parameter; when the page title is empty, pull an empty string as the page title data as the data collection result corresponding to the reporting parameter.
[0118] In some embodiments, before calling the platform program matching the first operating platform to perform the data collection process corresponding to the reporting parameter, the private module is further configured to: when the parameter meaning of the reporting parameter is the same as the parameter meanings of the reporting parameters of all other operating platforms, modify the parameter name of the configured program to obtain a platform program matching the first operating platform, where the configured program is the execution program corresponding to the reporting parameters of the other operating platforms; when the parameter meaning of the reporting parameter is different from the parameter meanings of the reporting parameters of all other operating platforms, create a platform program for implementing the collection function corresponding to the reporting parameter.
[0119] In some embodiments, the device further includes a storage module, storage module 4554, configured to obtain fields from the data collection results corresponding to the reporting parameters; and perform a database storage process corresponding to the first operating platform on the data collection results based on the first operating platform represented by the fields.
[0120] In some embodiments, the storage module is further configured to perform any one of the following processes: obtain a data reporting event corresponding to the data collection result, and store the data collection result in a database at a storage location corresponding to the data reporting event; obtain the type of parameter corresponding to the data collection result, and store the data collection result in a database at a storage location corresponding to the type of parameter.
[0121] In some embodiments, the storage module is further configured to: create a configuration file of a platform program corresponding to each platform reporting parameter based on the platform reporting parameters of each operating platform, and store the configuration file in a cloud server; the private module is further configured to read, from the cloud server, the configuration file corresponding to the reporting parameter, so as to call a platform program matching the first operating platform to perform data collection processing corresponding to the reporting parameter.
[0122] In some embodiments, after obtaining, based on the instance object, the first operating platform corresponding to the data source, the obtaining module is further configured to perform any one of the following processes: receive a data reporting request of the first operating platform, where the data reporting request carries the reporting parameter; perform polling processing on the first operating platform based on the reporting parameter.
[0123] An embodiment of the present application provides a computer program product, which includes computer-executable instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer-executable instructions from the computer-readable storage medium, and the processor executes the computer-executable instructions, so that the electronic device executes the data processing method in the embodiment of the present application described above.
[0124] An embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions, where the computer-executable instructions are stored therein, and when the computer-executable instructions are executed by a processor, the processor will be caused to execute the image rendering method provided in the embodiment of the present application, for example, Figures 3A - 3C the data processing method shown.
[0125] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disc, or CD-ROM; or may be various devices including one or any combination of the above memories.
[0126] In some embodiments, the computer-executable instructions may be in the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including being deployed as a stand-alone program or being deployed as a module, component, subroutine, or other unit suitable for use in a computing environment.
[0127] As an example, the computer-executable instructions may or may not correspond to a file in a file system, may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a HyperText Markup Language (HTML) document, stored in a single file dedicated to the program being discussed, or, stored in multiple cooperating files (such as files that store one or more modules, subroutines, or portions of code).
[0128] As an example, the computer-executable instructions may be deployed to execute on one electronic device, or on multiple electronic devices located at one location, or, on multiple electronic devices distributed across multiple locations and interconnected via a communication network.
[0129] In summary, through the embodiments of the present application, an instance object of a data source is obtained, and a first operating platform corresponding to the instance object of the data source is obtained. The first operating platform is from a set of operating platforms; when the reported parameter belongs to the general reported parameters of the set of operating platforms, a general program is called to perform data collection and processing for the corresponding reported parameter. The general program is an execution program that is compatible with all operating platforms in the set of operating platforms. Since the applets on multiple platforms will have similar functions, the reuse effect achieved by the general program here reduces the code development cost; when the reported parameter belongs to the platform reported parameters of the first operating platform, a platform program matching the first operating platform is called to perform data collection and processing for the corresponding reported parameter. This is equivalent to only the platform program requiring a separate dimension, thereby reducing the code maintenance cost.
[0130] The above is only the embodiments of the present application and is not intended to limit the protection scope of the present application. Any modifications, equivalent replacements, and improvements made within the spirit and scope of the present application are all included in the protection scope of the present application.
Claims
1. A data processing method, characterized in that, The method includes: Obtaining an instance object of a data source, and obtaining a first operating platform corresponding to the data source based on the instance object, where the first operating platform is from a set of operating platforms; Obtaining the reporting parameters of the data source; When the reporting parameters belong to the general reporting parameters of the set of operating platforms, calling a general program to perform data collection and processing corresponding to the reporting parameters, where the general program is an execution program compatible with all operating platforms in the set of operating platforms; When the reporting parameters do not belong to the general reporting parameters, calling a platform program matching the first operating platform to perform data collection and processing corresponding to the reporting parameters.
2. The method according to claim 1, wherein The obtaining the first operating platform corresponding to the data source based on the instance object includes: When the operating platform of the instance object source cannot be identified, using the default operating platform in the set of operating platforms as the first operating platform; When the operating platform of the instance object source is identified, using the identified operating platform as the first operating platform.
3. The method according to claim 2, wherein The default operating platform includes at least one of the following: the operating platform preset in the set of operating platforms, the operating platform with the highest data collection frequency in the set of operating platforms, and the operating platform with the fewest platform reporting parameters in the set of operating platforms.
4. The method according to claim 1, characterized in that After obtaining the first operating platform corresponding to the data source based on the instance object, the method further includes: Performing an assignment process on the global variables of the general program and the platform program so that the global variables can be called by at least one of the general program and the platform program.
5. The method according to claim 1, wherein The calling a platform program matching the first operating platform to perform data collection and processing corresponding to the reporting parameters includes: When the reporting parameter is the page title in the platform reporting parameters, calling the platform program to perform the following processing: When the page title is not empty, automatically obtaining the page title data set for the instance object as the data collection result corresponding to the reporting parameter; When the page title is empty, pulling an empty string as the page title data as the data collection result corresponding to the reporting parameter.
6. The method according to claim 1, characterized in that, Before calling a platform program matching the first operating platform to perform data collection and processing corresponding to the reporting parameters, the method further includes: When the parameter meaning of the reporting parameter is the same as the parameter meanings of the reporting parameters of all other operating platforms, modifying the parameter name of the configured program to obtain a platform program matching the first operating platform, where the configured program is an execution program corresponding to the reporting parameters of the other operating platforms; When the parameter meaning of the reporting parameter is different from the parameter meanings of the reporting parameters of all other operating platforms, creating a platform program for implementing the collection function corresponding to the reporting parameter.
7. The method according to claim 1, wherein The method further includes: Obtaining fields from the data collection result corresponding to the reporting parameter; Based on the first operating platform represented by the fields, performing a storage process corresponding to the first operating platform on the data collection result.
8. The method according to claim 7, characterized in that, Performing the database storage process for the data collection result corresponding to the first operating platform includes: Performing any one of the following processes: Obtaining the data reporting event corresponding to the data collection result, and storing the data collection result in the database at the storage location corresponding to the data reporting event; Obtaining the parameter type corresponding to the data collection result, and storing the data collection result in the database at the storage location corresponding to the parameter type.
9. The method according to claim 1, characterized in that, The method further includes: Based on the platform reporting parameters of each operating platform, creating a configuration file for the platform program corresponding to each platform reporting parameter, and storing the configuration file in the cloud server; Invoking the platform program matching the first operating platform to perform the data collection process corresponding to the reporting parameters includes: Reading the configuration file corresponding to the reporting parameters from the cloud server to invoke the platform program matching the first operating platform to perform the data collection process corresponding to the reporting parameters.
10. The method according to claim 1, wherein Obtaining the reporting parameters of the data source includes: Performing any one of the following processes: Receiving the data reporting request of the first operating platform, where the reporting parameters are carried in the data reporting request; Performing polling processing on the first operating platform, receiving the polling result, and extracting the reporting parameters from the polling result.
11. A data processing device, characterized in that, The device includes: An obtaining module, configured to obtain an instance object of the data source, and based on the instance object, obtain the first operating platform corresponding to the data source, where the first operating platform is from a set of operating platforms; The obtaining module is further configured to obtain the reporting parameters of the data source; A general module, configured to, when the reporting parameters belong to the general reporting parameters of the set of operating platforms, invoke a general program to perform the data collection process corresponding to the reporting parameters, where the general program is an execution program compatible with all operating platforms in the set of operating platforms; A private module, configured to, when the reporting parameters do not belong to the general reporting parameters, invoke the platform program matching the first operating platform to perform the data collection process corresponding to the reporting parameters.
12. An electronic device, characterized in that, The electronic device includes: A memory, configured to store computer-executable instructions; A processor, configured to, when executing the computer-executable instructions stored in the memory, implement the data processing method according to any one of claims 1 to 10.
13. A computer-readable storage medium storing computer-executable instructions, characterized in that, The computer-executable instructions, when executed by the processor, implement the data processing method according to any one of claims 1 to 10.
14. A computer program product, comprising computer-executable instructions, characterized in that, The computer-executable instructions, when executed by the processor, implement the data processing method according to any one of claims 1 to 10.