CN115437615A - Data reporting method and device, computer equipment and storage medium - Google Patents

Data reporting method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN115437615A
CN115437615A CN202110612962.2A CN202110612962A CN115437615A CN 115437615 A CN115437615 A CN 115437615A CN 202110612962 A CN202110612962 A CN 202110612962A CN 115437615 A CN115437615 A CN 115437615A
Authority
CN
China
Prior art keywords
data
reported
reporting
format
compatible
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110612962.2A
Other languages
Chinese (zh)
Inventor
张晓翼
郭润增
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202110612962.2A priority Critical patent/CN115437615A/en
Publication of CN115437615A publication Critical patent/CN115437615A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Communication Control (AREA)

Abstract

The embodiment of the application discloses a data reporting method, a data reporting device, computer equipment and a storage medium; the method and the device can receive a plurality of data to be reported transmitted by a data receiving layer in a data reporting frame, wherein the data to be reported are data acquired by a plurality of operating systems respectively, and one data to be reported corresponds to a code format; converting the code format of each data to be reported into a compatible code format by using a format conversion layer in a data reporting frame to obtain format compatible data of each data to be reported, wherein the compatible code format supports a plurality of data transmission interfaces in a data to be reported sharing format conversion layer; transmitting each format compatible data to a reporting layer in a data reporting frame by using a data transmission interface; and the report layer reports the compatible data of each format, so that the resource and the cost required by data reporting are reduced.

Description

Data reporting method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a data reporting method and apparatus, a computer device, and a storage medium.
Background
With the development of information technology and the rapid development and popularization of internet technology, application programs in computer equipment are prosperous. The application program serves as the expansion of the functions of the computer equipment, not only promotes the prosperous development of the internet field, but also brings convenience to the daily learning life of people, and becomes an indispensable part of the daily learning life of people.
In order to develop an application better, developers may often collect data in the application, and optimize the application by reporting and analyzing the collected data. Because the application program can be generally loaded in different operating systems for use, when reporting the acquired data, corresponding data reporting methods need to be developed according to the different operating systems. However, since data reporting is a general function of each application program, if different data reporting methods are developed according to different operating systems, the different data reporting methods need to be maintained, which will increase resources and costs required for data reporting.
Disclosure of Invention
The embodiment of the application provides a data reporting method, a data reporting device, computer equipment and a storage medium, and reduces resources and cost required by data reporting.
The embodiment of the application provides a data reporting method, which comprises the following steps:
receiving a plurality of data to be reported transmitted by a data receiving layer in a data reporting frame, wherein the data to be reported are data acquired by a plurality of operating systems respectively, and one data to be reported corresponds to a code format;
converting the code format of each data to be reported into a compatible code format by using a format conversion layer in the data reporting frame to obtain format compatible data of each data to be reported, wherein the compatible code format supports the plurality of data to be reported to share a data transmission interface in the format conversion layer;
transmitting each format compatible data to a reporting layer in the data reporting frame by using the data transmission interface;
and reporting the compatible data of each format through the data reporting logic of the reporting layer.
Correspondingly, an embodiment of the present application further provides a data reporting apparatus, including:
the system comprises a receiving unit, a reporting unit and a processing unit, wherein the receiving unit is used for receiving a plurality of data to be reported transmitted by a data receiving layer in a data reporting frame, the data to be reported are respectively acquired by a plurality of operating systems, and one data to be reported corresponds to a code format;
a conversion unit, configured to convert, by using a format conversion layer in the data reporting frame, a code format of each piece of data to be reported into a compatible code format, so as to obtain format-compatible data of each piece of data to be reported, where the compatible code format supports that the plurality of pieces of data to be reported share a data transmission interface in the format conversion layer;
a transmission unit, configured to transmit each format-compatible data to a reporting layer in the data reporting frame by using the data transmission interface;
and the reporting unit is used for reporting the compatible data of each format through the data reporting logic of the reporting layer.
In one embodiment, the conversion unit includes:
a receiving subunit, configured to receive, at the format conversion layer, the data to be reported and a service reporting protocol corresponding to the data to be reported;
the coding processing subunit is configured to perform coding processing on the data to be reported according to the service reporting protocol by using the format conversion layer, so as to obtain the data to be reported after the coding processing;
and the code format conversion subunit is used for converting the code format of the coded data to be reported into a compatible code format to obtain format compatible data of each data to be reported.
In one embodiment, the encoding processing subunit includes:
the analysis module is used for analyzing the service reporting protocol through the format conversion layer to obtain a data type corresponding to the data to be reported;
the acquisition module is used for acquiring the coding protocol of the data to be reported according to the data type through the format conversion layer;
and the coding module is used for coding the data to be reported according to the coding protocol through a data coding interface of the format conversion layer to obtain the coded data to be reported.
In one embodiment, the code format conversion subunit includes:
the identification module is used for carrying out code format identification on the coded data to be reported by utilizing the format conversion layer to obtain the code format of the coded data to be reported;
the calling module is used for calling the format conversion file corresponding to the code format in the format conversion layer;
and the conversion processing module is used for converting the code format of the data to be reported according to the format conversion file to obtain format compatible data of the data to be reported.
In one embodiment, the conversion processing module includes:
the analysis submodule is used for analyzing the format conversion file to obtain data attribute conversion logic;
and the conversion processing submodule is used for performing attribute conversion processing on the data to be reported according to the data attribute conversion logic to obtain format compatible data of the data to be reported.
In one embodiment, the transmission unit includes:
an obtaining subunit, configured to obtain, through the format conversion layer, reporting configuration information of the data to be reported;
the association subunit is configured to associate, according to the reporting configuration information, the format-compatible data with a preset reporting service through the format conversion layer;
and the data transmission subunit is used for transmitting the format compatible data associated with the preset reporting service to the reporting layer of the data reporting frame through the data transmission interface.
In an embodiment, the reporting unit includes:
a receiving subunit, configured to receive, through the reporting layer, format-compatible data associated with the preset reporting service;
a determining subunit, configured to determine a target data reporting sub-logic in the data reporting logic according to the preset reporting service;
and the execution subunit is used for executing the target data reporting sub-logic so as to report the format compatible data.
Embodiments of the present application also provide a computer program product or computer program comprising computer instructions stored in a computer-readable storage medium. The computer instructions are read by a processor of a computer device from a computer-readable storage medium, and the computer instructions are executed by the processor to cause the computer device to perform the method provided in the various alternatives of the above aspect.
Correspondingly, an embodiment of the present application further provides a storage medium, where the storage medium stores instructions, and the instructions, when executed by the processor, implement the data reporting method provided in any embodiment of the present application.
The method and the device can receive a plurality of data to be reported transmitted by a data receiving layer in a data reporting frame, wherein the data to be reported are data acquired by a plurality of operating systems respectively, and one data to be reported corresponds to a code format; converting the code format of each data to be reported into a compatible code format by using a format conversion layer in a data reporting frame to obtain format compatible data of each data to be reported, wherein the compatible code format supports a plurality of data transmission interfaces in a data to be reported sharing format conversion layer; transmitting each format compatible data to a reporting layer in a data reporting frame by using a data transmission interface; and the reporting layer reports the compatible data of each format, so that the resource and the cost required by data reporting are reduced.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the description below are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a scene schematic diagram of a data reporting method provided in an embodiment of the present application;
fig. 2 is a schematic flowchart of a data reporting method according to an embodiment of the present application;
fig. 3 is a schematic view of a scenario of a data receiving layer according to an embodiment of the present application;
fig. 4 is a schematic view of a scenario of a format conversion layer provided in an embodiment of the present application;
FIG. 5 is a schematic view of a scenario of a report layer provided in an embodiment of the present application;
fig. 6 is a schematic flowchart of a data reporting method according to an embodiment of the present application;
fig. 7 is a scene schematic diagram of a data reporting framework according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a data reporting apparatus according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of a terminal according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, however, the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The embodiment of the application provides a data reporting method, which can be executed by a data reporting device, and the data reporting device can be integrated in a computer device. Wherein the computer device may comprise at least one of a terminal and a server, etc. That is, the data reporting method provided in the embodiment of the present application may be executed by the terminal, or may be executed by the server.
The terminal can be a smart phone, a tablet Computer, a notebook Computer, a Personal Computer (PC), a smart home, a wearable electronic device, a VR/AR device, an on-vehicle Computer, a face brushing device, an internet of things device, and the like. The server may be an interworking server or a background server among a plurality of heterogeneous systems, an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, a cloud server providing basic cloud computing services such as cloud service, a cloud database, cloud computing, cloud functions, cloud storage, network service, cloud communication, middleware service, domain name service, security service, big data and artificial intelligence platforms, and the like.
In an embodiment, as shown in fig. 1, the data reporting apparatus may be integrated on a computer device such as a terminal or a server, so as to implement the data reporting method provided in the embodiment of the present application. Specifically, the computer device may receive a plurality of data to be reported transmitted by a data receiving layer in the data reporting frame 10, where the plurality of data to be reported are data collected by a plurality of operating systems, and one data to be reported corresponds to one code format; converting the code format of each data to be reported into a compatible code format by using a format conversion layer in the data reporting frame 10 to obtain format compatible data of each data to be reported, wherein the compatible code format supports data transmission interfaces in a plurality of data to be reported sharing format conversion layers; transmitting each format compatible data to a reporting layer in the data reporting frame 10 by using a data transmission interface; and reporting the compatible data of each format through a reporting layer.
The following are detailed below, and it should be noted that the order of description of the following examples is not intended to limit the preferred order of the examples.
The embodiment of the present application will be described in terms of a data reporting apparatus, where the data reporting apparatus may be integrated in a computer device, and the computer device may be a server or a terminal.
As shown in fig. 2, a data reporting method is provided, and the specific process includes:
110. and receiving a plurality of data to be reported transmitted by a data receiving layer in a data reporting frame, wherein the data to be reported are data acquired by a plurality of operating systems respectively, and one data to be reported corresponds to one code format.
The data reporting framework comprises a framework which can utilize a set of data reporting logic to report various collected data of a plurality of operating systems. For example, the data reporting framework may be a collection of system software that controls the presentation operation and provides a corresponding operation interface for a developer. Through the data reporting framework, the data to be reported acquired by the operating systems can be reported, and a set of data reporting method does not need to be developed for each operating system.
In an embodiment, the data reporting framework may include a plurality of functional layers, each functional layer includes a corresponding function, and each functional module cooperates with each other to jointly implement the function of the data reporting framework. For example, the data reporting framework may include functional layers such as a data receiving layer, a format conversion layer, and a reporting layer.
In an embodiment, the data receiving layer may receive various collected data to be reported of each operating system, and perform data transmission with other functional layers.
The operating system includes a computer program that manages the hardware and software resources of the computer device. For example, the operating systems may include an Android (Android) operating system, an iOS operating system, a windows operating system, and a Linux operating system, among others.
The data to be reported comprises data which are collected by an operating system and then reported. For example, the data to be reported may include data acquired by operating systems such as android, iOS, windows, linux, and the like.
In an embodiment, the data to be reported acquired by different operating systems have different code formats. The code format comprises a code form of the data to be reported acquired by the operating system. For example, the code format may include what programming language the data to be reported is presented in, what the programming language presentation syntax is, and so on.
For example, the data to be reported collected by the Linux operating system may be written in the C programming language and have a format corresponding to the Linux operating system.
For another example, the data to be reported collected by the iOS os may be written in the C + + programming language and have a format corresponding to the iOS os, and so on.
For another example, the data to be reported collected by the android operating system may be written in the Java programming language and have a format corresponding to the android operating system, and so on.
In an embodiment, a developer may set a data acquisition method in an application program, and acquire data in the application program by using an operating system through the data acquisition method, so as to obtain data to be reported.
For example, a developer may set a buried point in an application program and acquire data in the application program through the buried point by using an operating system, so as to obtain data to be reported.
The application program comprises a computer program for completing one or more specific functions, is operated in an interaction mode, can interact with a use object of the application program, and has a visual display interface.
For example, the application programs may include application software on various terminals. For example, the Application programs may include various mobile phone software (APP), tablet Application software, application software on a notebook computer, application software on a Personal Computer (PC), and the like.
For example, the application programs may include browsers, video playback software, game software, and so forth.
As another example, an application may also include an applet. Among them, a Mini Program (Mini Program) is an application that can be used without downloading and installation. In order to provide more diversified business services to users, developers can develop corresponding applets for applications (such as instant messaging applications, shopping applications, mail applications, and the like) of the terminal, the applets can be embedded into the applications of the terminal as sub-applications, and the corresponding business services can be provided for the users by running the sub-applications (i.e., the corresponding applets) in the applications.
In one embodiment, an operating system would have at least one application program in it. Therefore, the data to be reported may also refer to data collected by an application program in an operating system.
For example, 2 pieces of data to be reported acquired by the android operating system are received at the data receiving layer. One of the data to be reported is data acquired by an application program A in the android operating system, and the other is data acquired by an application program B in the android operating system.
For another example, 2 pieces of data to be reported acquired by an android operating system and an iOS operating system are received at a data receiving layer. One piece of data to be reported is data acquired by an application program A in an android operating system, and the other piece of data is data acquired by the application program A in an iOS operating system.
In an embodiment, because different applications have different service attributes, the data to be reported collected by the different applications have different characteristics in terms of data type, data distribution and the like.
For example, when the application is a social-type application, the collected data to be reported may be mostly data of a browsing event and data of an input event, and the like. For another example, when the application is a game type application, the collected data to be reported may be mostly data of a click event and data of a slide event, and the like.
The event may include all feedback of the application program using the object, that is, when the application program is used using the object, the feedback of the application program may be collectively referred to as the event. Wherein events can be divided into various types. For example, the events may include click, voice control, swipe, load, browse, etc. types of events.
In an embodiment, because the data to be reported acquired on different operating systems have different code formats and the data to be reported acquired on different application programs have different characteristics, service identification information can be added to each data to be reported, so that the data to be reported can be known to belong to which application program in which operating system through the service identification information. The service identification information comprises information with an identification function on the data to be reported.
In an embodiment, as shown in fig. 3, the data receiving layer may include two functional modules, which are an information adding module 1101 and a service reporting protocol module 1102 respectively.
The information adding module 1101 may receive data to be reported acquired by each operating system, add various identification information and configuration information to the data to be reported, and the like.
For example, the information adding module 1101 may add service identification information to the data to be reported, so that other functional layers in the reporting framework may know that the collected data to be reported belongs to which application program in which operating system.
For another example, the information adding module 1101 may add reporting configuration information to the data to be reported. The reporting configuration information includes information that the data to be reported needs to comply with in the reporting process. For example, the reporting configuration information may include how to report the data to be reported, in what form, where to report, etc., whether to report periodically or quantitatively, whether to adopt a real-time reporting mode, etc.
For example, the data receiving layer acquires 2 pieces of data to be reported, where one piece of data to be reported is data in the application program a acquired through the android operating system, and the other piece of data to be reported is data in the application program a acquired through the iOS operating system. Then, the information adding module in the data receiving layer respectively adds service identification information to the 2 data to be reported, so that other functional layers in the data reporting frame can know that one of the data to be reported is data in the application program A acquired through the android operating system through the service identification information, and the other data to be reported is data in the application program A acquired through the iOS operating system.
The service reporting protocol module 1102 includes a module capable of generating a service reporting protocol. Wherein, a reporting rule of the data to be reported in the reporting process is defined in the service reporting protocol. For example, in the service reporting protocol, it may be defined by which way the data to be reported is reported, in what form, where to report, and so on. For example, the service reporting protocol may define whether the data to be reported is reported regularly or quantitatively, whether a real-time reporting mode is adopted, and the like, and other information such as the data type and storage type of the data to be reported, and the like.
In an embodiment, after receiving a plurality of data to be reported transmitted by the data receiving layer, the information adding module 1101 in the data receiving layer may add service identification information to each data to be reported, and transmit the data to be reported with the service identification information to other functional layers, so that the other functional layers know to which application program in which operating system the data to be reported belongs.
In addition, the data to be reported, the service identification information and the reporting configuration information may also be transmitted to the service reporting protocol module 1102 in the data receiving layer, so that the service reporting protocol module may generate a service reporting protocol for each data to be reported according to the service identification information, and transmit the service reporting protocol to other functional layers. Therefore, other functional layers can obtain the service identification information and the reporting configuration information of the data to be reported through the service reporting protocol, and the like.
120. Converting the code format of each data to be reported into a compatible code format by using a format conversion layer in a data reporting frame to obtain format compatible data of each data to be reported, wherein the compatible code format supports a plurality of data transmission interfaces in a data to be reported sharing format conversion layer;
in an embodiment, the format conversion layer in the data reporting frame includes a functional layer that can convert the code format of the data to be reported into a compatible code format, obtain format-compatible data of the data to be reported, and communicate with other functional layers.
The compatible code format comprises a format which can enable a plurality of functional interfaces in the to-be-reported data sharing format conversion layer to be in a compatible mode.
For example, the format conversion layer receives 3 pieces of data to be reported, wherein one piece of data to be reported is written by using the C + + programming language, another piece of data to be reported is written by using the Java programming language, and the last piece of data to be reported is written by using the C programming language. The format conversion layer can convert the code formats of the 3 data to be reported into compatible code formats, so that the 3 data to be reported share the functional interface in the format conversion layer.
The format compatible data comprises data obtained by converting the code format of the data to be reported into a compatible code format. By converting each data to be reported into the data with compatible format, the data to be reported with different code formats can share the same data reporting frame, a data reporting method does not need to be developed for each operating system, and resources and cost required by data reporting are saved.
In one embodiment, the format compatible data may be a glue code. Wherein the glue code comprises code that can make incompatible codes compatible. For example, the format conversion layer receives 3 pieces of data to be reported, one piece of data to be reported is written by using the C + + programming language, the other piece of data to be reported is written by using the Java programming language, and the last piece of data to be reported is written by using the C programming language. At this time, the 3 data to be reported can be converted into glue codes respectively, so that the data to be reported with different code formats can be compatible with each other. Glue code can not only combine incompatible programs or software components, but can also be used to link code modules of any size, from small functions to large libraries. Moreover, glue code is very efficient in a cross-framework development environment, allowing several components to be quickly integrated into a single language or framework. Glue codes are therefore commonly used for information transfer between computer languages and for cross-framework implementations.
In one embodiment, the format conversion layer may include a plurality of functional interfaces, each having its corresponding functionality. For example, as shown in fig. 4, the format conversion layer may include a registration initialization interface 1103, a data transmission interface 1104, a reporting network interface 1105, a coding/decoding interface 1106, and the like.
The registration initialization interface 1103 is configured to receive information sent by other functional layers, and perform initialization setting on other interfaces according to the information.
For example, because the data reporting framework proposed by the present application allows the data to be reported of different applications in different operating systems to coexist, each data to be reported has a service identifier and a corresponding service reporting protocol.
For example, the registration initialization interface 1103 may receive the service identification information and register the service identification information in other functional layers, so that the other functional layers can know, through the service identification information, which application program in which operating system the collected data to be reported belongs to.
For example, the registration initialization interface 1103 may register the service identifier information in the reporting layer, so that the reporting layer can know, through the service identifier information, which application program in which operating system the collected data to be reported belongs to.
For another example, the registration initialization interface 1103 may receive a service reporting protocol, analyze the service reporting protocol, and transmit information obtained by the analysis to other functional interfaces.
In addition, the registration initialization interface 1103 may also perform initialization setting on other interfaces in the format conversion layer according to the service identification information, so that the other interfaces in the format conversion layer may process the data to be reported according to the service identification information.
For example, the registration initialization interface 1103 may perform initialization setting on the data transmission interface 1104, the reporting network interface 1105, and the coding/decoding interface 1106 in the format conversion layer according to the service identifier information, so that the data transmission interface 1104, the reporting network interface 1105, and the coding/decoding interface 1106 may process the data to be reported according to the service identifier information.
The data transmission interface 1104 can transmit format-compatible data to other functional layers. For example, the data transfer interface 1104 may transfer format compatible data to a reporting layer, and so on.
The reporting network interface 1105 may obtain reporting configuration information of data to be reported, associate format-compatible data with a preset reporting service according to the reporting configuration information, and transmit the format-compatible data with the preset reporting service to other functional layers.
The coding/decoding interface 1106 may perform coding or decoding processing on data to be reported.
In an embodiment, each data to be reported may have a different data type, since the data to be reported may be data collected in different operating systems, or may be data collected in different applications in different operating systems. For example, some data types of the data to be reported may be boolean, some data types of the data to be reported may be byte, some data types of the data to be reported may be integer, and so on. Therefore, the data to be reported can be coded by using the coding and decoding interface, so that the lower layer of the format conversion layer does not need to understand the data type of the data to be reported.
In an embodiment, when the format conversion layer in the data reporting frame is used to convert the code format of each data to be reported into the compatible code format, the data to be reported may be first encoded to obtain the data to be reported after being encoded, and then the code format of the data to be reported after being encoded is converted into the compatible code format. Specifically, the step of converting the code format of each data to be reported into the compatible code format by using the format conversion layer in the data reporting frame to obtain the format compatible data of each data to be reported may include:
receiving data to be reported and a service reporting protocol corresponding to the data to be reported at a format conversion layer;
coding the data to be reported by using a format conversion layer according to a service reporting protocol to obtain the data to be reported after coding;
and converting the code format of the coded data to be reported into a compatible code format to obtain format compatible data of each data to be reported.
In an embodiment, before performing code format conversion processing on data to be reported by using a format conversion layer of a reporting frame, the data to be reported and a service reporting protocol corresponding to the data to be reported may be received by using the format conversion layer.
For example, the data to be reported transmitted by the data receiving layer and the service reporting protocol corresponding to the data to be reported may be received at the format conversion layer. For another example, a service reporting protocol transmitted by the data receiving layer may be received by using a registration initialization interface in the format conversion layer.
In an embodiment, after the format conversion layer receives the service reporting protocol, the data to be reported may be encoded according to the service reporting protocol, so as to obtain the data to be reported after the encoding. When the data to be reported is coded, the service reporting protocol can be analyzed through the format conversion layer, and the service attribute corresponding to the data to be reported is obtained. And then acquiring a coding protocol of the data to be reported according to the service attribute. And then, the data to be reported can be coded according to the coding protocol to obtain the coded data to be reported. Specifically, the step of encoding, by using the format conversion layer, the data to be reported according to the service reporting protocol to obtain the data to be reported after the encoding processing may include:
analyzing the service reporting protocol through the format conversion layer to obtain a data type corresponding to the data to be reported;
acquiring a coding protocol of the data to be reported according to the data type through the format conversion layer;
and coding the data to be reported according to the coding protocol through a data coding interface of the format conversion layer to obtain the coded data to be reported.
The coding protocol comprises coding rules which need to be observed when the data to be reported are coded. For example, when the data to be reported is boolean, the rules to be observed when encoding the data to be reported into data of the target data type are required. For another example, when the data to be reported is byte type, the rules to be observed when encoding the data to be reported into data of target data type are needed.
The target data type may be any predefined data type, for example, the target data type may be a character string type, and so on.
In an embodiment, each type of data to be reported may have a different data type, so in the embodiment of the present application, a service reporting protocol of the data to be reported may be first analyzed through a format conversion layer, so as to obtain a data type corresponding to the data to be reported.
For example, the service reporting protocol may be analyzed through the registration initialization interface of the format conversion layer, so as to obtain the data type of the data to be reported.
In an embodiment, after the data type of the data to be reported is obtained, the encoding protocol of the data to be reported can be obtained according to the data type.
For example, a storage module may be preset in the format conversion layer, and the storage module stores a coding protocol corresponding to each data type, and then may obtain the corresponding coding protocol according to the data type of the data to be reported.
For example, it is specified in advance that the target data type is a character string type. The format conversion layer may store the encoding protocol corresponding to the data type such as boolean, byte, short integer, character, etc. in advance. Such as boolean corresponding encoding protocol 1, byte corresponding encoding protocol 2, short integer corresponding encoding protocol 3, character corresponding encoding protocol 4, etc. Therefore, after the data type of the data to be reported is obtained, the corresponding coding protocol can be obtained from the storage module in the format conversion layer according to the storage type.
In an embodiment, after the coding protocol of the data to be reported is acquired, the data to be reported may be coded according to the coding protocol through a data coding interface of a format conversion layer, so as to obtain the coded data to be reported.
For example, when the data to be reported is character type and the target data type is character string type, after the coding protocol is acquired, the character type data to be reported can be coded into character string type according to the coding protocol through the data coding interface, so as to obtain the coded data to be reported.
For another example, when the data to be reported is boolean type and the target data type is character string type, after the coding protocol is acquired, the boolean data to be reported may be coded into a character string type according to the coding protocol through the data coding interface, so as to obtain the coded data to be reported.
In an embodiment, after the data to be reported after being encoded is obtained, the code format of the data to be reported after being encoded may be converted into a compatible code format, so as to obtain format-compatible data of each data to be reported. When the code format of the coded data to be reported is converted into the compatible code format, the format conversion layer can be used for identifying the coded data to be reported to obtain the code format of the coded data to be reported, and then the code format is converted. Specifically, the step of converting the code format of the coded data to be reported into a compatible code format to obtain format compatible data of each data to be reported includes:
carrying out code format identification on the coded data to be reported by using a format conversion layer to obtain a code format of the coded data to be reported;
calling a format conversion file corresponding to the code format in the format conversion layer;
and converting the code format of the data to be reported according to the format conversion file to obtain format compatible data of the data to be reported. The format conversion file comprises logic which needs to be observed when the code format of the data to be reported can be converted into a compatible code format. The format conversion file may be a piece of code, a function, or the like.
In an embodiment, since the data to be reported may be one of multiple programming languages, when the code format of the encoded data to be reported is converted into a compatible code format, the format conversion layer may be used to perform code format identification on the encoded data to be reported, so as to obtain the code format of the encoded data to be reported.
For example, the code format of the data to be reported may be identified by using a registration initialization interface in the format conversion layer, so as to obtain the code format of the encoded data to be reported.
In an embodiment, after the code format of the coded data to be reported is obtained, a format conversion file corresponding to the code format may be called in the format conversion layer, so that format-compatible data of the data to be reported is obtained by using the format conversion file.
In the embodiment of the present application, a format conversion file corresponding to each code format may be generated in advance by using Djinni. The Djinni is a tool for generating cross-language type declarations and interface bindings, and can realize the intercommunication among a plurality of programming languages. Djinni is a code base with an open source, and can generate corresponding interfaces and glue codes according to code formats, so that data to be reported in different code formats can share the same interface.
For example, a format conversion file of code formats C + +, java, and so on, which are waiting for reporting data, may be generated in advance by using Djinni, and stored in the format conversion layer. When the format conversion is carried out on the data to be reported after the coding, the corresponding format conversion file can be called. And then, according to the format conversion file, converting the code format of the data to be reported to obtain format compatible data of the data to be reported.
In an embodiment, when the code format of the data to be reported is converted according to the format conversion file, the format conversion file may be parsed to obtain a data attribute conversion logic, and then the data to be reported is converted according to the data attribute conversion logic. Specifically, the step of performing conversion processing on the code format of the data to be reported according to the format conversion file to obtain format-compatible data of the data to be reported may include:
analyzing the format conversion file to obtain data attribute conversion logic;
and performing attribute conversion processing on the data to be reported according to the data attribute conversion logic to obtain format compatible data of the data to be reported.
Wherein the data attribute conversion logic comprises: and (3) converting the code formats of various data components in the data to be reported into compatible code formats according to the rules to be observed. For example, the data attribute translation logic may be an interface function or a block of code.
In one embodiment, the data to be reported may be composed of a plurality of components. For example, the data to be reported may be composed of a data operation component, a data control component, a data transmission component, and the like.
The data operation component may include operations included in the data to be reported. For example, the operand included in the data to be reported. For example, when the code format of the data to be reported is Java programming language, the data operation component may be an operation statement in the code, and so on.
The data control component may include controls included in the data to be reported. For example, the data to be reported includes a sequence control structure, a loop control structure, and a branch control structure, etc. For example, when the code format of the data to be reported is Java programming language, the data control component may be a loop statement in the code, and so on.
The data transmission component may include a component for expressing input and output of data in the data to be reported. For example, when the code format of the data to be reported is Java programming language, the data transmission components may be various function statements in the code, and so on.
Thus, the data attribute conversion logic may include data transmission component conversion logic, data control component conversion logic, and data operation component conversion logic. When the data to be reported is subjected to the attribute conversion processing according to the data attribute conversion logic, the data to be reported can be subjected to the attribute conversion processing according to the data transmission component conversion logic, the data control component conversion logic and the data operation component conversion logic to obtain the format compatible data. Specifically, the step of performing attribute conversion processing on the data to be reported according to the data attribute conversion logic to obtain format compatible data of the data to be reported may include:
according to the data transmission component conversion logic, performing transmission attribute conversion processing on data to be reported to obtain first data to be reported;
according to the data control component conversion logic, performing control attribute conversion processing on the first data to be reported to obtain second data to be reported;
and performing operation attribute conversion processing on the second data to be reported according to the data operation component conversion logic to obtain the format compatible data.
In one embodiment, the relationship of the data operation component, the data control component, and the data transmission component in the data to be reported may be that the data operation component is inside the data control component and then the data control component is inside the data transmission component. Therefore, the data to be reported can be subjected to attribute conversion processing from outside to inside.
The data transmission component conversion logic comprises logic which needs to be followed when the code format of the transmission component in the data to be reported is converted into a compatible code format. The data control component conversion logic comprises logic which needs to be followed when the code format of the control component in the data to be reported is converted into a compatible code format. The data operation component conversion logic comprises logic which needs to be followed when the code format of the operation component in the data to be reported is converted into a compatible code format.
Therefore, when the attribute conversion processing is performed on the data to be reported, the data transmission component of the data to be reported can be converted into the glue code according to the data transmission component conversion logic, so as to obtain the first data to be reported. And then, converting the data control components in the first data to be reported into glue codes according to the data control component conversion logic to obtain second data to be reported. And finally, converting the data operation components in the second data to be reported into glue codes according to the data operation component conversion logic to obtain format compatible data.
For example, when the data operation component in the data to be reported is written in the C + + programming language, the data operation component in the data to be reported may be first converted into a glue code according to the data transmission component conversion logic. And then, converting the data control components in the data to be reported into glue codes. And finally, converting the data transmission components in the data to be reported into glue codes, thereby obtaining format compatible data.
In an embodiment, the data to be reported may also be subjected to attribute conversion processing at an inside-out level. For example, the data operation component of the data to be reported is converted first, then the data control component in the data to be reported is converted, and finally the data transmission component in the data to be reported is converted, so as to obtain the format compatible data.
Through the hierarchical conversion, the code format of the data to be reported can be stably and hierarchically converted, and the stability and the reliability of the conversion of the code format of the data to be reported are improved.
For another example, when the data control component in the data to be reported is written in the C + + programming language, the data control component written in the C + + programming language may be converted into glue code according to the data control component conversion logic.
Through the data transmission component conversion logic, the data control component conversion logic and the data operation component conversion logic, the code formats of the data operation component, the data control component and the data transmission component in the data to be reported can be converted into the compatible code format, so that the data to be reported with different code formats can be compatible and reported in the same data reporting frame, and resources and cost required by data reporting are reduced.
130. And transmitting each format compatible data to a reporting layer in the data reporting frame by using a data transmission interface.
In an embodiment, after the format compatible data of each piece of data to be reported is obtained, each piece of format compatible data may be transmitted to the report layer by using a data transmission interface in the format conversion layer, so that the format compatible data is reported by the report layer.
In an embodiment, when the format-compatible data is transmitted to the reporting layer, the reporting configuration information of the data to be reported may be acquired by the format conversion layer, the format-compatible data is associated with the preset reporting service according to the reporting configuration information, and the format-compatible data associated with the preset reporting service is transmitted to the reporting layer. Specifically, the step of transmitting each format-compatible data to a reporting layer in the data reporting framework by using the data transmission interface may include:
acquiring reporting configuration information of the data to be reported through the format conversion layer;
according to the reporting configuration information, the format compatible data is associated with a preset reporting service through the format conversion layer;
and transmitting format compatible data associated with a preset reporting service to a reporting layer of the data reporting frame through the data transmission interface.
For example, the reporting configuration information of the data to be reported transmitted by other functional layers may be received by the format conversion layer, so as to obtain the reporting configuration information of the data to be reported. For example, the reporting configuration information of the data to be reported transmitted by the data receiving layer may be received by the format conversion layer, so as to obtain the reporting configuration information of the data to be reported.
In an example, the reporting configuration information may include how to report the data to be reported, what form to report the data, where to report the data, etc., whether to report the data regularly or quantitatively, whether to adopt a real-time reporting mode, etc. The different configuration information can associate the format compatible data with the preset reporting service, so that the reporting layer can report the format compatible data according to the preset reporting service when reporting the format compatible data.
The preset reporting service comprises a service which is preset and can enable format compatible data to be reported according to reporting configuration information. For example, the predetermined reporting service may include a predetermined timed reporting service, a predetermined volume reporting service, and a predetermined real-time reporting service, etc.
Therefore, the reporting configuration information can be associated with the format compatible data and the preset reporting service through the format conversion layer.
For example, when the reporting configuration information includes real-time reporting and quantitative reporting, the format-compatible data may be associated with a predetermined quantitative reporting service and a predetermined real-time reporting service.
For another example, when the reporting configuration information includes that the reporting mode of the data is the timed reporting, the format compatible data may be associated with a preset timed reporting service.
140. And reporting the compatible data of each format through the data reporting logic of the reporting layer.
The reporting layer comprises a functional layer capable of reporting each format compatible data.
In an embodiment, the reporting layer can solve the problem of non-uniform reporting architecture between different operating systems. For example, the reporting architecture of the android operating system and the reporting architecture of the iOS operating system are different and unified, and the reporting layer can enable the reporting architecture of the android operating system and the reporting architecture of the iOS operating system to be integrated together in the reporting layer, so that the data to be reported of different operating systems can be reported by means of the reporting layer.
In one embodiment, as shown in fig. 5, the reporting layer may include a reporting profile module 1401, a reporting timer 1402, a reporting service manager 1403, a reporting queue 1404, and a reporting module 1405.
The reporting configuration file module 1401 may be configured to configure whether the data to be reported is to be reported quantitatively or at regular time, and may further transmit reporting configuration information downwards through the format conversion layer by the data receiving layer, and store the reporting configuration information.
The reporting queue 1404 may be configured to receive a storage type of data to be reported.
The reporting service manager 1403 may be configured to implement data scheduling and reporting, which is equivalent to a control center of a reporting service, and the reporting service manager 1403 automatically completes the capability of storing and reporting data.
The reporting timer 1402 may be a tool file for associating reporting time. For example, when the reporting configuration information of the data to be reported is a timing report, the data to be reported and the reporting time can be associated, so that the data to be reported can be reported at a timing.
In an embodiment, when the operating system collects the data to be reported in a point-embedded manner, the data to be reported is encapsulated into an object, and then the object is stored in the memory tool. However, when the application is started, there is a possibility that an object existing in the memory tool is lost due to various abnormalities.
Therefore, in the embodiment of the present application, a reporting module is arranged in the reporting layer, and the reporting module can store the data acquired by the application program into a file, rather than a memory tool.
Wherein, the file can be realized by adopting an Mmap mode. The Mmap is a method for mapping files in a memory, that is, a file or other objects are mapped to an address space of a process, so as to realize a one-to-one mapping relation between a file disk address and a section of virtual address in the virtual address space of the process. After the mapping relation is realized, the process can read and write the memory by adopting a pointer mode, and the system can automatically write back the dirty page to the corresponding file disk, namely, the operation on the file is completed without calling system calling functions such as read, write and the like.
In an embodiment, after the reporting layer receives the format-compatible data, the storage type of the format-compatible data may be identified by the reporting layer, and then the target storage file of the format-compatible data is determined according to the storage type, and the format-compatible data is stored in the target storage file. Specifically, the data reporting method provided in the embodiment of the present application may further include:
identifying the storage type of the format compatible data through a reporting layer;
determining a target storage space of the format compatible data according to the storage type;
and storing the format compatible data into the target storage space.
For example, the reporting management server may identify the reporting configuration information of the format-compatible data, so as to obtain the storage type of the format-compatible data.
The storage type of the format-compatible data may include whether the format-compatible data is stored in a memory tool or a storage file. For example, when the format-compatible data is important data, such as data related to personal information of the object, the format-compatible data can be stored in a storage file to avoid loss. As another example, when storing data that is similarly unimportant, format-compatible data may be stored to a memory tool.
In an embodiment, after determining the storage type of the format-compatible data, the target storage space of the format-compatible data may be determined according to the storage type. For example, mapping pointers for storage types and target storage spaces may be established in advance. Then, after the storage type of the format-compatible data is determined, a mapping pointer may be added to the format-compatible data, and the target storage space of that format-compatible data is deleted 27448according to the mapping pointer, thereby storing the format-compatible data into the target storage space.
In an embodiment, the reporting layer may further include data reporting logic. The data reporting logic includes rules to be followed when reporting data to be reported collected by each operating system. The data reporting logic may be developed from various programming languages. For example, the data reporting logic may be developed by C + + programming language, so that each operating system may share the set of data reporting logic developed by C + + programming language.
The data reporting logic may include a plurality of data reporting sub-logics. Each data reporting sub-logic may be one of the code blocks or a function in the data reporting logic, and each data reporting sub-logic has a corresponding reporting function.
For example, the data reporting logic may include 3 data reporting logics, where the data reporting logic 1 may implement a timing reporting, the data reporting logic 2 may implement a quantitative reporting, and the data reporting logic 3 may implement a real-time reporting.
Therefore, in an embodiment, the reporting layer may receive format-compatible data associated with a preset reporting service and transmitted by the format conversion layer, call a corresponding target data reporting sub-logic in the data reporting logic according to the preset reporting service, and execute the target reporting sub-logic, thereby implementing reporting of the format-compatible data. Specifically, the step of reporting each format compatible data through a data reporting logic of a reporting layer may include:
receiving format compatible data associated with a preset reporting service through a reporting layer;
determining a target data reporting sub-logic in a data reporting logic according to a preset reporting service;
and executing the target data reporting sub-logic to report the format compatible data.
When the target data reporting sub-logic is determined in the data reporting logic according to the preset reporting service, the target data reporting sub-logic may be determined according to the identification information of the preset reporting service, and the like. For example, the target data reporting sub-logic may be determined according to name information of a preset reporting service, and the like.
For example, the data reporting logic includes 3 data reporting sub-logics, where the data reporting logic 1 can implement a timed reporting, corresponding to a timed reporting service; the data reporting logic 2 can realize quantitative reporting and corresponds to quantitative reporting service; the data reporting logic 3 can realize real-time reporting, corresponding to real-time reporting service. Then, the target data reporting sub-logic may be determined according to the name of the preset reporting service.
After the target data reporting sub-logic is determined, the target data reporting sub-logic may be executed to report the data in reduced format compatibility.
In an embodiment, the data reporting framework provided in the embodiment of the present application may further include a check layer. The check layer can check each data to be reported before the format conversion layer converts the code format of each data to be reported into a compatible code format to obtain format compatible data of each data to be reported. Specifically, the data reporting method provided in the embodiment of the present application may further include:
utilizing a check layer in the data reporting frame to check each data to be reported;
when the data to be reported passes the verification, transmitting the data to be reported to the format conversion layer for format conversion;
and when the data to be reported does not pass the verification, generating an error protocol according to the data to be reported, and reporting the error protocol.
The check layer comprises a functional layer which can check each type of data to be reported.
In an embodiment, the check layer may include a reporting specification interface, where the reporting specification interface has various preset check specifications, and the data to be reported may be checked through the preset check specifications.
For example, the reporting specification interface may have a preset field specification protocol, where the preset field specification protocol includes a field specification to which the data to be reported should conform. The data to be reported may be acquired from different applications, so that a corresponding field specification protocol may be set for the data to be reported of each application.
For example, the default field specification protocol corresponding to the application a is: the length of the field of the data to be reported is not more than 20 bits, and negative numbers can not appear. For another example, the preset field specification protocol corresponding to the application B is: the field length may not exceed 32 bits, etc.
Therefore, when the check layer is used for checking each data to be reported, the data field of the data to be reported and the preset field standard protocol can be matched, and the data to be reported can be checked according to the matching result. Specifically, the step of performing the verification processing on each data to be reported by using the verification layer in the data reporting frame may include:
carrying out field identification on the data to be reported by utilizing the check layer to obtain a data field of the data to be reported;
matching the data field with a preset field standard protocol in the check layer to obtain a matching result;
and checking the data to be reported according to the matching result.
In an embodiment, when the check layer is used to check each piece of data to be reported, the check layer may be used to perform field identification on the data to be reported, so as to obtain a data field of the data to be reported. For example, the data to be reported may be traversed, so as to obtain the data field of the data to be reported.
Then, the data field and the preset field specification protocol may be matched, so as to obtain a matching result. For example, if the default field specification protocol is: the length of the field of the data to be reported is not more than 20 bits, and negative numbers can not appear. Then, according to the preset field specification protocol, it can be judged whether the field length of the data to be reported exceeds 20 bits, and whether a negative number appears, so as to obtain the matching result of the data field and the preset field specification protocol.
And then, the data to be reported can be checked according to the matching result. For example, when the data field of the data to be reported matches the preset field specification protocol, it indicates that the data to be reported passes the verification. And when the data field of the data to be reported does not want to match the preset field specification, the data to be reported does not pass the verification.
In an embodiment, the check layer further includes a basic reporting protocol, and when the data to be reported passes the check, the basic reporting protocol may be acquired, where the basic reporting protocol includes a basic reporting attribute. Then, a basic reporting attribute can be added to the data to be reported according to the basic reporting protocol bits, and the data to be reported with the basic reporting data is transmitted to a format conversion layer for format conversion. Specifically, the step of transmitting the data to be reported to the format conversion layer for format conversion when the data to be reported passes the verification may include:
when the data to be reported passes the verification, acquiring a basic reporting protocol, wherein the basic reporting protocol comprises basic reporting attributes;
adding a basic reporting attribute to the data to be reported according to the basic reporting protocol;
and transmitting the data to be reported with the basic reporting data to the format conversion layer for format conversion.
In an embodiment, when the data to be reported passes the verification, a basic reporting protocol is obtained in the verification layer, wherein the basic reporting protocol includes a basic reporting attribute. The basic reporting attribute comprises an attribute when the data to be reported is reported. For example, whether the data to be reported is reported in real time, quantitatively or regularly, etc.
Then, the basic reporting attributes can be added to the reported data according to the basic reporting protocol. And finally, transmitting the data to be reported with the basic reported data to a format conversion layer for format conversion.
In the embodiment, when the data to be reported does not pass the verification, an error protocol can be generated according to the data to be reported, and the error protocol is reported. For example, when the data to be reported does not pass the verification, the data to be reported can be encapsulated into an error file, error identification information is added to the error file, and then the error file with the error identification information is reported.
The embodiment of the application provides a data reporting method, which comprises the following steps: receiving a plurality of data to be reported transmitted by a data receiving layer in a data reporting frame, wherein the data to be reported are data acquired by a plurality of operating systems respectively, and one data to be reported corresponds to a code format; converting the code format of each data to be reported into a compatible code format by using a format conversion layer in a data reporting frame to obtain format compatible data of each data to be reported, wherein the compatible code format supports data transmission interfaces in a plurality of data to be reported sharing format conversion layers; transmitting each format compatible data to a reporting layer in a data reporting frame by using a data transmission interface; and reporting the compatible data of each format through a reporting layer. The embodiment of the application provides a data reporting frame, so that the data to be reported, which is acquired by each operating system, can be reported by the data reporting frame, and a data reporting frame does not need to be developed for each operating system, so that a large amount of manpower and material resources do not need to be consumed to develop and maintain a plurality of data reporting frames, and resources and cost required for reporting the data acquired by the operating systems are reduced.
In addition, the data reporting framework provided in the embodiment of the present application may include a plurality of functional layers, such as a data receiving layer, a format conversion layer, a reporting layer, and a verification layer. The data receiving layer can receive the data to be reported collected by each operating system and add service identification information and a service reporting protocol to the data to be reported, so that other functional layers can directly obtain the data collected in which operating system and application program the data to be reported belongs and reporting configuration information of the data to be reported through the service identification information and the service reporting protocol, and the data reporting efficiency is improved. The check layer can check the data to be reported, so that the reliability and stability of data reporting are improved. The format conversion layer can convert various codes of the data to be reported of each operating system into compatible code formats, so that a plurality of data to be reported can share a data constant interface in the format conversion layer and are transmitted to the reporting layer through a data transmission interface for reporting, and resources and cost required for reporting the data collected by the operating systems are reduced.
The method described in the above examples is further illustrated in detail below by way of example.
The method of the embodiment of the present application will be described by taking an example in which a data reporting method is integrated on a computer device.
In an embodiment, as shown in fig. 6, a data reporting method includes the following specific processes:
210. the computer equipment receives a plurality of data to be reported transmitted by a data receiving layer in a data reporting frame, wherein the data to be reported are data acquired by a plurality of operating systems respectively, and one data to be reported corresponds to a code format.
The data reporting framework may be as shown in 20 in fig. 7. The data reporting frame 20 may include a data receiving layer 30, a checking layer 40, a format conversion layer 50, and a reporting layer 60.
In an embodiment, the data receiving layer 30 may include a reporting object, an information adding module, and a service reporting protocol module.
The reporting object is used for receiving data to be reported acquired by each operating system. For example, the reporting object may receive data to be reported, which is collected by an android operating system, an iOS operating system, a windows operating system, and a Linux operating system.
In an embodiment, the collected data to be reported may also be data collected by the operating system on different application programs.
For example, the data to be reported collected by the android operating system may be data collected on a plurality of different applications. For example, 2 data to be reported are collected on the android operating system, one of the data to be reported is collected in the application a, and the other data to be reported is collected in the application B.
For another example, the multiple data to be reported acquired by the iOS operating system may also be acquired on different application programs.
In an embodiment, the information adding module in the data receiving layer 30 may be used to add service identification information to each piece of data to be reported, so that other functional layers know to which application program in which operating system the data to be reported belongs.
In an embodiment, the information adding module in the data receiving layer 30 may be further used to add reporting configuration for each data to be reported.
In an embodiment, the data to be reported, the service identification information, and the reporting configuration information may also be transmitted to the service reporting protocol module in the data receiving layer 30, so that the service reporting protocol module may generate a service reporting protocol for each data to be reported according to the service identification information, and transmit the service reporting protocol to other functional layers. Therefore, other functional layers can obtain the service identification information and the reporting configuration information of the data to be reported through the service reporting protocol, and the like.
220. And the computer equipment carries out verification processing on each data to be reported by utilizing a verification layer of the data reporting frame to obtain the target data to be reported.
Two modules may be included in the check layer 40. The first module is an abstract reporting tool class, which integrates the reported tool class, so that the data receiving layer 30 can be used even without any customization after accessing the check layer.
The abstract reporting tool class comprises a reporting specification interface, a configuration parameter table and an EventCenter module. The reporting standard interface can perform standard verification on data to be reported. The configuration parameter table integrates some generalized reporting configuration items, such as timing reporting or quantitative reporting, whether real-time reporting is performed, and the like. Meanwhile, in order to solve the problem that the data reporting framework can report the data to be reported of different application programs, an EventCenter module is integrated in the check layer 40 and is used for event cross-process forwarding.
230. And the computer equipment converts the code format of each target data to be reported into a compatible code format by using a format conversion layer in the data reporting frame to obtain format compatible data of each target data to be reported.
The format conversion layer 50 in the data reporting frame 20 may include a registration initialization interface, a data transmission interface, a reporting network interface, and an encoding/decoding interface.
The register initialization interface is used for receiving information sent by other functional layers and performing initialization setting on other interfaces according to the information.
For example, because the data reporting framework proposed by the present application allows the data to be reported of different applications in different operating systems to coexist, each data to be reported has a service identifier and a corresponding service reporting protocol.
For example, the registration initialization interface may receive the service identification information and register the service identification information in the other functional layer, so that the other functional layer can know, through the service identification information, which application program in which operating system the collected data to be reported belongs to.
For example, the registration initialization interface may register the service identifier information in the reporting layer, so that the reporting layer can know, through the service identifier information, which application program in which operating system the collected data to be reported belongs to.
For another example, the registration initialization interface may receive a service reporting protocol, analyze the service reporting protocol, and transmit information obtained by the analysis to other functional interfaces.
In addition, the registration initialization interface can also perform initialization setting on other interfaces in the format conversion layer according to the service identification information, so that the other interfaces in the format conversion layer can process the data to be reported according to the service identification information.
For example, the registration initialization interface may perform initialization setting on the data transmission interface, the reporting network interface, and the codec interface in the format conversion layer according to the service identification information, so that the data transmission interface, the reporting network interface, and the codec interface may process the data to be reported according to the service identification information.
The data transmission interface can transmit the format-compatible data to other functional layers. For example, the data transfer interface may transfer format-compatible data to a reporting layer, and so on.
The reporting network interface can acquire reporting configuration information of data to be reported, associate format-compatible data with a preset reporting service according to the reporting configuration information, and transmit the format-compatible data with the preset reporting service to other functional layers.
The coding/decoding interface can code or decode the data to be reported.
240. And the computer equipment transmits each format compatible data to a reporting layer in the data reporting frame by using the data transmission interface.
250. And the computer equipment reports the compatible data of each format through the data reporting logic of the reporting layer.
The reporting layer 60 in the data reporting frame 20 may include a reporting configuration file module, a reporting timer, a reporting service manager, a reporting queue, and a reporting module.
The reporting configuration file module can be used for configuring whether the data to be reported is reported quantitatively or at regular time, and the data receiving layer can also transmit the reporting configuration information downwards through the format conversion layer and store the reporting configuration information.
The reporting queue may be configured to receive a storage type of data to be reported.
The reporting service manager can be used for realizing data scheduling and reporting, which is equivalent to a control center of a reporting service, and the reporting configuration file module is used for automatically completing the capacity of storing and reporting data.
The reporting timer may be a tool file used to associate the reporting time. For example, when the reporting configuration information of the data to be reported is a timed report, the data to be reported and the reporting time can be associated, so that the data to be reported can be reported at a timed time.
In an embodiment, when the operating system collects the data to be reported in a point-embedded manner, the data to be reported is encapsulated into an object, and then the object is stored in the memory tool. However, when the application is started, there is a possibility that an object existing in the memory tool is lost due to various abnormalities.
Therefore, the reporting module is arranged in the reporting layer in the embodiment of the application, and the reporting module can store the data acquired by the application program into a file instead of a memory tool.
Wherein, the file can be realized by adopting an Mmap mode. The Mmap is a method for mapping files in a memory, i.e. a file or other objects are mapped to an address space of a process, and the one-to-one mapping relation between a file disk address and a section of virtual address in the virtual address space of the process is realized. After the mapping relation is realized, the process can read and write the memory by adopting a pointer mode, and the system can automatically write back the dirty page to the corresponding file disk, namely, the operation on the file is completed without calling system calling functions such as read, write and the like.
In the embodiment of the application, the computer device may receive a plurality of data to be reported transmitted by a data receiving layer in a data reporting frame, where the plurality of data to be reported are data collected by a plurality of operating systems, and one data to be reported corresponds to one code format; the computer equipment converts the code format of each data to be reported into a compatible code format by using a format conversion layer in a data reporting frame to obtain format compatible data of each data to be reported, wherein the compatible code format supports a plurality of data transmission interfaces in a data sharing format conversion layer to be reported; the computer equipment transmits each format compatible data to a reporting layer in a data reporting frame by using a data transmission interface; and the computer equipment reports the compatible data of each format through the reporting layer, so that the resource and the cost required by data reporting are reduced.
In order to better implement the data reporting method provided in the embodiment of the present application, in an embodiment, a data reporting apparatus is further provided, and the data reporting apparatus may be integrated in a computer device. The meaning of the noun is the same as that in the above data reporting method, and the specific implementation details may refer to the description in the method embodiment.
In an embodiment, a data reporting apparatus is provided, where the data reporting apparatus may be specifically integrated in a computer device, as shown in fig. 8, the data reporting apparatus includes: the receiving unit 310, the converting unit 320, the transmitting unit 330, and the reporting unit 340 are as follows:
a receiving unit 310, configured to receive multiple pieces of data to be reported, which are transmitted by a data receiving layer in a data reporting frame, where the multiple pieces of data to be reported are data acquired by multiple operating systems, and one piece of data to be reported corresponds to one code format;
a converting unit 320, configured to convert, by using a format conversion layer in the data reporting frame, a code format of each data to be reported into a compatible code format, so as to obtain format compatible data of each data to be reported, where the compatible code format supports that the multiple data to be reported share a data transmission interface in the format conversion layer;
a transmission unit 330, configured to transmit each format-compatible data to a reporting layer in the data reporting frame by using the data transmission interface;
a reporting unit 340, configured to report the format-compatible data through the data reporting logic of the reporting layer.
In one embodiment, the conversion unit includes:
a receiving subunit, configured to receive, at the format conversion layer, the data to be reported and a service reporting protocol corresponding to the data to be reported;
the coding processing subunit is configured to perform coding processing on the data to be reported according to the service reporting protocol by using the format conversion layer, so as to obtain the data to be reported after the coding processing;
and the code format conversion subunit is used for converting the code format of the coded data to be reported into a compatible code format to obtain format compatible data of each data to be reported.
In one embodiment, the encoding processing subunit includes:
the analysis module is used for analyzing the service reporting protocol through the format conversion layer to obtain a data type corresponding to the data to be reported;
the acquisition module is used for acquiring the coding protocol of the data to be reported according to the data type through the format conversion layer;
and the coding module is used for coding the data to be reported according to the coding protocol through a data coding interface of the format conversion layer to obtain the coded data to be reported.
In one embodiment, the code format conversion subunit includes:
the identification module is used for carrying out code format identification on the coded data to be reported by utilizing the format conversion layer to obtain the code format of the coded data to be reported;
the calling module is used for calling the format conversion file corresponding to the code format in the format conversion layer;
and the conversion processing module is used for converting the code format of the data to be reported according to the format conversion file to obtain format compatible data of the data to be reported. In one embodiment, the conversion processing module includes:
the analysis submodule is used for analyzing the format conversion file to obtain data attribute conversion logic;
and the conversion processing submodule is used for performing attribute conversion processing on the data to be reported according to the data attribute conversion logic to obtain format compatible data of the data to be reported.
In one embodiment, the transmission unit includes:
the acquisition subunit is used for acquiring reporting configuration information of the data to be reported through the format conversion layer;
the association subunit is configured to associate, according to the reporting configuration information, the format-compatible data with a preset reporting service through the format conversion layer;
and the data transmission subunit is used for transmitting the format compatible data associated with the preset reporting service to a reporting layer of the data reporting frame through the data transmission interface.
In an embodiment, the reporting unit includes:
a receiving subunit, configured to receive, through the reporting layer, format-compatible data associated with the preset reporting service;
a determining subunit, configured to determine a target data reporting sub-logic in the data reporting logic according to the preset reporting service;
and the execution subunit is used for executing the target data reporting sub-logic so as to report the format compatible data.
In a specific implementation, the above units may be implemented as independent entities, or may be combined arbitrarily to be implemented as the same or several entities, and the specific implementation of the above units may refer to the foregoing method embodiments, which are not described herein again.
The data reporting device can reduce the resources and cost required by data reporting.
The embodiment of the present application further provides a computer device, where the computer device may include a terminal or a server, for example, the computer device may be used as a data reporting terminal, and the terminal may be a mobile phone, a tablet computer, or the like; for another example, the computer device may be a server, such as a data reporting server. As shown in fig. 9, it shows a schematic structural diagram of a terminal according to an embodiment of the present application, specifically:
the computer device may include components such as a processor 401 of one or more processing cores, memory 402 of one or more computer-readable storage media, a power supply 403, and an input unit 404. Those skilled in the art will appreciate that the computer device configuration illustrated in FIG. 9 does not constitute a limitation of the computer device, and may include more or fewer components than illustrated, or some components may be combined, or a different arrangement of components. Wherein:
the processor 401 is a control center of the computer device, connects various parts of the entire computer device using various interfaces and lines, and performs various functions of the computer device and processes data by running or executing software programs and/or modules stored in the memory 402 and calling data stored in the memory 402, thereby monitoring the computer device as a whole. Alternatively, processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly handles operating systems, user pages, application programs, and the like, and the modem processor mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 401.
The memory 402 may be used to store software programs and modules, and the processor 401 executes various functional applications and data processing by operating the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data created according to use of the computer device, and the like. Further, the memory 402 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 access to the memory 402.
The computer device further comprises a power supply 403 for supplying power to the various components, and preferably, the power supply 403 is logically connected to the processor 401 through a power management system, so that the functions of managing charging, discharging, and power consumption are realized through the power management system. The power supply 403 may also include any component of one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
The computer device may also include an input unit 404, and the input unit 404 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
Although not shown, the computer device may further include a display unit and the like, which are not described in detail herein. Specifically, in this embodiment, the processor 401 in the computer device loads the executable file corresponding to the process of one or more application programs into the memory 402 according to the following instructions, and the processor 401 runs the application programs stored in the memory 402, thereby implementing various functions as follows:
receiving a plurality of data to be reported transmitted by a data receiving layer in a data reporting frame, wherein the data to be reported are data acquired by a plurality of operating systems respectively, and one data to be reported corresponds to a code format;
converting the code format of each data to be reported into a compatible code format by using a format conversion layer in the data reporting frame to obtain format compatible data of each data to be reported, wherein the compatible code format supports the plurality of data to be reported to share a data transmission interface in the format conversion layer;
transmitting each format compatible data to a reporting layer in the data reporting frame by using the data transmission interface;
and reporting the compatible data of each format through the data reporting logic of the reporting layer.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
According to an aspect of the application, a computer program product or computer program is provided, comprising computer instructions, the computer instructions being stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the method provided in the various alternative implementations of the above embodiments.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be implemented by a computer program, which may be stored in a computer-readable storage medium and loaded and executed by a processor, or by a computer program controlling associated hardware.
To this end, an embodiment of the present application further provides a storage medium, where a computer program is stored, and the computer program can be loaded by a processor to execute the steps in any one of the data reporting methods provided in the embodiments of the present application. For example, the computer program may perform the steps of:
receiving a plurality of data to be reported transmitted by a data receiving layer in a data reporting frame, wherein the data to be reported are data acquired by a plurality of operating systems respectively, and one data to be reported corresponds to a code format;
converting the code format of each data to be reported into a compatible code format by using a format conversion layer in the data reporting frame to obtain format compatible data of each data to be reported, wherein the compatible code format supports the plurality of data to be reported to share a data transmission interface in the format conversion layer;
transmitting each format compatible data to a reporting layer in the data reporting frame by using the data transmission interface;
and reporting the compatible data of each format through the data reporting logic of the reporting layer.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Since the computer program stored in the storage medium can execute the steps in any data reporting method provided in the embodiments of the present application, beneficial effects that can be achieved by any data reporting method provided in the embodiments of the present application can be achieved, which are detailed in the foregoing embodiments and will not be described herein again.
A data reporting method, an apparatus, a computer device and a storage medium provided in the embodiments of the present application are introduced in detail, and a specific example is applied in the present application to explain the principle and the implementation of the present application, and the description of the embodiments is only used to help understand the method and the core idea of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (15)

1. A data reporting method is characterized by comprising the following steps:
receiving a plurality of data to be reported transmitted by a data receiving layer in a data reporting frame, wherein the data to be reported are data acquired by a plurality of operating systems respectively, and one data to be reported corresponds to a code format;
converting the code format of each data to be reported into a compatible code format by using a format conversion layer in the data reporting frame to obtain format compatible data of each data to be reported, wherein the compatible code format supports the plurality of data to be reported to share a data transmission interface in the format conversion layer;
transmitting each format compatible data to a reporting layer in the data reporting frame by using the data transmission interface;
and reporting the compatible data of each format through the data reporting logic of the reporting layer.
2. The data reporting method of claim 1, wherein the converting a code format of each data to be reported into a compatible code format by using a format conversion layer in the data reporting framework to obtain format-compatible data of each data to be reported comprises:
receiving the data to be reported and a service reporting protocol corresponding to the data to be reported at the format conversion layer;
coding the data to be reported by using the format conversion layer according to the service reporting protocol to obtain coded data to be reported;
and converting the code format of the coded data to be reported into a compatible code format to obtain format compatible data of each data to be reported.
3. The data reporting method of claim 2, wherein the encoding, by using the format conversion layer, the data to be reported according to the service reporting protocol to obtain encoded data to be reported comprises:
analyzing the service reporting protocol through the format conversion layer to obtain a data type corresponding to the data to be reported;
acquiring a coding protocol of the data to be reported according to the data type through the format conversion layer;
and coding the data to be reported according to the coding protocol through a data coding interface of the format conversion layer to obtain the coded data to be reported.
4. The data reporting method of claim 2, wherein the converting the code format of the coded data to be reported into a compatible code format to obtain format-compatible data of each data to be reported comprises:
carrying out code format identification on the coded data to be reported by utilizing the format conversion layer to obtain a code format of the coded data to be reported;
calling a format conversion file corresponding to the code format in the format conversion layer;
and converting the code format of the data to be reported according to the format conversion file to obtain format compatible data of the data to be reported.
5. The method for reporting data of claim 4, wherein the converting the code format of the data to be reported according to the format conversion file to obtain format-compatible data of the data to be reported comprises:
analyzing the format conversion file to obtain data attribute conversion logic;
and performing attribute conversion processing on the data to be reported according to the data attribute conversion logic to obtain format compatible data of the data to be reported.
6. The data reporting method of claim 5, wherein the data attribute conversion logic comprises data transmission component conversion logic, data control component conversion logic, and data operation component conversion logic;
the performing attribute conversion processing on the data to be reported according to the data attribute conversion logic to obtain format compatible data of the data to be reported includes:
according to the data transmission component conversion logic, performing transmission attribute conversion processing on the data to be reported to obtain first data to be reported;
according to the data control component conversion logic, performing control attribute conversion processing on the first data to be reported to obtain second data to be reported;
and performing operation attribute conversion processing on the second data to be reported according to the data operation component conversion logic to obtain the format compatible data.
7. The data reporting method of claim 2, wherein the transmitting each format-compatible data to the reporting layer in the data reporting frame using the data transmission interface comprises:
acquiring reporting configuration information of the data to be reported through the format conversion layer;
according to the reporting configuration information, the format compatible data is associated with a preset reporting service through the format conversion layer;
and transmitting format compatible data associated with a preset reporting service to a reporting layer of the data reporting frame through the data transmission interface.
8. The data reporting method of claim 7, wherein reporting the each format-compatible data through the data reporting logic of the reporting layer comprises:
receiving format compatible data associated with the preset reporting service through the reporting layer;
determining a target data reporting sub-logic in the data reporting logic according to the preset reporting service;
and executing the target data reporting sub-logic to report the format compatible data.
9. The data reporting method of claim 8, wherein the method further comprises:
identifying the storage type of the format compatible data through the reporting layer;
determining a target storage space of the format compatible data according to the storage type;
and storing the format compatible data to the target storage space.
10. The data reporting method of claim 1, wherein before the converting the format of each data to be reported into a compatible code format by using the format conversion layer in the data reporting framework to obtain the format-compatible data of each data to be reported, the method comprises:
utilizing a check layer in the data reporting frame to check each data to be reported;
when the data to be reported pass the verification, transmitting the data to be reported to the format conversion layer for format conversion;
and when the data to be reported does not pass the verification, generating an error protocol according to the data to be reported, and reporting the error protocol.
11. The method for reporting data of claim 10, wherein the performing the check processing on each data to be reported by using a check layer in the data reporting frame includes:
carrying out field identification on the data to be reported by utilizing the check layer to obtain a data field of the data to be reported;
matching the data field with a preset field standard protocol in the check layer to obtain a matching result;
and checking the data to be reported according to the matching result.
12. The method as claimed in claim 11, wherein the transmitting the data to be reported to the format conversion layer for format conversion when the data to be reported passes the verification comprises:
when the data to be reported pass the verification, acquiring a basic reporting protocol, wherein the basic reporting protocol comprises basic reporting attributes;
adding a basic reporting attribute to the data to be reported according to the basic reporting protocol;
and transmitting the data to be reported with the basic reporting data to the format conversion layer for format conversion.
13. A data reporting apparatus, comprising:
the system comprises a receiving unit, a reporting unit and a processing unit, wherein the receiving unit is used for receiving a plurality of data to be reported transmitted by a data receiving layer in a data reporting frame, the data to be reported are respectively acquired by a plurality of operating systems, and one data to be reported corresponds to a code format;
a conversion unit, configured to convert, by using a format conversion layer in the data reporting frame, a code format of each piece of data to be reported into a compatible code format, so as to obtain format-compatible data of each piece of data to be reported, where the compatible code format supports that the plurality of pieces of data to be reported share a data transmission interface in the format conversion layer;
a transmission unit, configured to transmit each format-compatible data to a reporting layer in the data reporting frame by using the data transmission interface;
and the reporting unit is used for reporting the compatible data of each format through the data reporting logic of the reporting layer.
14. A computer device comprising a memory and a processor; the memory stores an application program, and the processor is configured to execute the application program in the memory to perform the operations of the data reporting method in any one of claims 1 to 12.
15. A storage medium storing instructions adapted to be loaded by a processor to perform the steps of the data reporting method according to any one of claims 1 to 12.
CN202110612962.2A 2021-06-02 2021-06-02 Data reporting method and device, computer equipment and storage medium Pending CN115437615A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110612962.2A CN115437615A (en) 2021-06-02 2021-06-02 Data reporting method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110612962.2A CN115437615A (en) 2021-06-02 2021-06-02 Data reporting method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115437615A true CN115437615A (en) 2022-12-06

Family

ID=84271615

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110612962.2A Pending CN115437615A (en) 2021-06-02 2021-06-02 Data reporting method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115437615A (en)

Similar Documents

Publication Publication Date Title
CN110908879B (en) Reporting method, reporting device, reporting terminal and recording medium of buried point data
CN112087454B (en) Communication method, device, equipment and storage medium of Internet of things gateway equipment
CN110505162B (en) Message transmission method and device and electronic equipment
CN102214099B (en) Automatic run-time environment (RTE) code generating method for automobile system architecture (AUTOSAR)
CN101246424A (en) Menu automatic generation system and method for based on file
CN111552838A (en) Data processing method and device, computer equipment and storage medium
CN111158779B (en) Data processing method and related equipment
CN110457132B (en) Method and device for creating functional object and terminal equipment
KR100670605B1 (en) System and method for servicing multimedia contents and recording medium thereof
CN113434315B (en) Interface management method and device, storage medium and electronic equipment
CN114172978A (en) Multi-protocol equipment access method and related device
CN114048415A (en) Form generation method and device, electronic equipment and computer readable storage medium
US20170131980A1 (en) Model driven architecture for network management and configuration
CN113778897A (en) Automatic test method, device, equipment and storage medium of interface
CN109445384A (en) A kind of more apparatus control systems
CN111488144B (en) Data processing method and device
CN113296987B (en) Interface calling method and device for calling module, computer equipment and storage medium
CN115437615A (en) Data reporting method and device, computer equipment and storage medium
CN116227625A (en) Intelligent model development method, medium and equipment
CN116032614A (en) Container network micro-isolation method, device, equipment and medium
CN115328679A (en) Automatic integration method of heterogeneous function library, computing equipment and system thereof
CN114020414A (en) Symbiotic method and device of Android system and bottom layer Linux, electronic equipment and storage medium
CN114244912A (en) Data transmission method and device, computer equipment and storage medium
CN113778658A (en) Task allocation method and device, electronic equipment and storage medium
KR20210128096A (en) Apparatus and method for interworking among internet of things platforms

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination