CN110659028A - Data processing system, method, device, electronic equipment and storage medium - Google Patents

Data processing system, method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN110659028A
CN110659028A CN201910944227.4A CN201910944227A CN110659028A CN 110659028 A CN110659028 A CN 110659028A CN 201910944227 A CN201910944227 A CN 201910944227A CN 110659028 A CN110659028 A CN 110659028A
Authority
CN
China
Prior art keywords
function
calling
specified
interface
native
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.)
Granted
Application number
CN201910944227.4A
Other languages
Chinese (zh)
Other versions
CN110659028B (en
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.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology 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 Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN201910944227.4A priority Critical patent/CN110659028B/en
Publication of CN110659028A publication Critical patent/CN110659028A/en
Application granted granted Critical
Publication of CN110659028B publication Critical patent/CN110659028B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • G06F8/447Target code generation

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Communication Control (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a data processing system, a method, a device, an electronic device and a storage medium, relating to the technical field of computers, generating a function interface and a function frame which correspond to each other according to a protocol file with a preset format, writing a calling function for calling a native function of a system platform according to a preset native function list and based on the type of a function parameter defined by a specified function frame, avoiding communication abnormity errors caused by protocol incompatibility, decoding the data block to obtain function information by converting the function information for calling the specified native program into a data block with the specified format, sending the data block to a system platform end, determining a corresponding target calling function according to the function name of the function information, converting the function parameter of the function information into a type which can be identified by the target calling function, and calling the specified native program of the system platform, the automatic generation of codes is realized, and the coding workload of developers is reduced.

Description

Data processing system, method, device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a data processing system, a data processing method, an apparatus, an electronic device, and a storage medium.
Background
Flutter is a set of cross-platform developed by google, and a mobile open source UI (User Interface) framework can quickly construct a high-quality native User Interface on an ios (apple) operating system and an Android (Android) operating system, and a developer can efficiently construct multi-platform exquisite application by using Flutter. The Flutter supports mobile, Web (World wide Web), desktop and embedded platforms, and the network development language used by Flutter is mainly realized by Dart language. At present, more and more developers use the Flutter framework to develop Android operating system and ios operating system applications.
The advantages of Flutter are mainly that during UI rendering, Flutter cannot directly call ios operating system or system platform related codes on Android operating system, which causes that it is difficult for an application developed by Flutter to access ios operating system or Android operating system bottom layer capability, for example, the application developed by Flutter cannot directly call a camera and a gyroscope on Android operating system, cannot communicate with other applications on the same system, and the like. To address this issue, Flutter provides a "Platform Channels" mechanism to enable Flutter to directly call system Platform related code on ios or Android operating systems.
In the prior art, Flutter mainly uses Dart language, Android platform usually uses Java or Kotlin language, ios platform usually uses Objective-C or Swift language, and developers are required to manually complete protocol coding work in the communication process between Dart and Java or Kotlin, Objective-C or Swift, which may generate a large amount of trivial repeated codes and easily introduce errors, resulting in large difficulty in code checking work, for reasons including:
firstly, three ends of a Flutter UI frame, an Android operating system and an ios operating system rely on oral or written protocol documents for communication, the protocol documents cannot be directly and automatically translated into codes, strong constraints are lacked in the communication process, the three ends can be inconsistent in understanding in the protocol processing process, for example, character string type data is sent by the Flutter UI end, but the Android operating system end receives the data according to shaping data, so that errors of failed analysis can occur, the errors cannot be automatically exposed in the program compiling stage, and the difficulty in troubleshooting is large;
secondly, when one of the three ends of the Flutter UI frame, the Android operating system and the ios operating system changes the protocol, the other end cannot be automatically informed of the matching and modification, and the new protocol and the old protocol are incompatible, which also causes the difficulty in troubleshooting.
Disclosure of Invention
The present disclosure provides a data processing system, method, apparatus, electronic device, storage medium, and computer program product containing instructions to implement automatic code generation, reduce encoding workload of developers, and avoid communication abnormality errors caused by protocol incompatibility.
The technical scheme of the disclosure is as follows:
according to a first aspect of embodiments of the present disclosure, the present disclosure provides a data processing system, the system comprising:
the system comprises a function interface, a function frame, a calling function, a communication module, a first coding module and a second coding module, wherein the function interface corresponds to the function frame, the function frame is used for defining the type of a function parameter, different calling functions are obtained according to type codes defined by different function frames, the function interface and the first coding module are positioned on the side of an application program, and the function frame and the second coding module are positioned on the side of a system platform;
the function interface is configured to respond to the calling of the user interface of the application program and call corresponding function information, the function information comprises a function name and function parameters, and the function name represents a function frame corresponding to the function information;
the first coding and decoding module is configured to convert the function information called by the function interface into a data block in a specified format which can be recognized by the communication module;
the communication module is configured to transmit data between the application program and the system platform;
the second coding and decoding module is configured to determine a type defined by a corresponding function frame according to the function name in the data block to obtain a target type; converting the data block into function information of a target type, and calling a calling function corresponding to the target type;
the calling function is configured to call a native function of the system platform when the function parameter of the function information is executed.
Optionally, the system further includes:
and the code tool module is configured to generate the function interface and the function framework according to a protocol file in a preset format.
Optionally, the function framework is further configured to define a type of the return value, and the calling function is further configured to: responding to the calling result of the native function of the system platform, and generating a return value of the type corresponding to the calling function;
a second codec module further configured to convert the return value into a return data block of a specified format recognizable by the communication module;
the first coding and decoding module is further configured to decode the return data block into a return value of a corresponding type and send the return value of the corresponding type to a corresponding function interface;
the function interface is further configured to send the received return value to a user interface of the application program.
According to a second aspect of the embodiments of the present disclosure, there is provided a data processing method applied to the data processing system according to any one of the first aspect, the method including:
generating a function interface and a function frame according to a protocol file with a preset format, wherein the function interface corresponds to the function frame, and the function frame is used for defining the type of a function parameter;
writing a calling function for calling the system platform native function according to a preset native function list and based on the type of the function parameter defined by the specified function frame, wherein the native function list comprises the identification of each native function required to be called by the application program.
Optionally, the function framework is further configured to define a type of a return value, and the method further includes:
writing a calling function responsive to a calling result of the system platform native function based on a type of a return value defined by a specified function framework, wherein the calling function generates the return value of the specified type in response to the calling result of the system platform native function.
Optionally, the preset format is Proto Buffers.
According to a third aspect of the embodiments of the present disclosure, there is provided a data processing apparatus applied to the data processing system according to any one of the first aspect, the apparatus including:
the generating module is configured to generate a function interface and a function frame according to a protocol file in a preset format, wherein the function interface corresponds to the function frame, and the function frame is used for defining the type of a function parameter;
the first writing module is configured to write a calling function for calling a system platform native function according to a preset native function list and based on the type of a function parameter defined by a specified function framework, wherein the native function list comprises an identification of each native function required to be called by the application program.
Optionally, the apparatus further comprises:
a second writing module configured to write a calling function responsive to a calling result of the system platform native function based on a type of a return value defined by a specified function framework, wherein the calling function generates the return value of the specified type in response to the calling result of the system platform native function.
Optionally, the preset format is Proto Buffers.
According to a fourth aspect of the embodiments of the present disclosure, there is provided a data processing method, the method including:
when a specified native program of a system platform is called through a user interface of a target application, a calling command of the user interface of the target application for a specified function interface is obtained, wherein the specified function interface is for a function interface of the specified native program;
calling a specified function interface aiming at the specified native program according to the calling command to obtain function information for calling the specified native program, wherein the function information comprises a function name and function parameters;
converting the function information into a data block with a specified format;
sending the data block to enable a system platform end to acquire the data block;
decoding the data block through the system platform to obtain the function information;
determining a target calling function corresponding to the function name according to the function name of the function information, and converting the function parameter of the function information into a type which can be identified by the target calling function;
and executing the function parameters after the type conversion by using the target calling function framework so as to call the specified native program of the system platform.
Optionally, the method further includes:
generating a return value of a calling result of the native program of the system platform through the target calling function;
converting the return value into a return data block in a specified format;
sending the return data block to enable an application program end to obtain the return data block;
decoding the return data block into a type which can be identified by the target calling function to obtain a return value after type conversion;
and sending the return value after the type conversion to a user interface of the application program through the specified function interface.
Optionally, the method further includes:
generating a function interface and a function frame according to a protocol file with a preset format, wherein the function interface corresponds to the function frame, and the function frame is used for defining the type of a function parameter and the type of a return value;
writing a calling function for calling a system platform native function according to a preset native function list and based on the type of a function parameter defined by a specified function frame, wherein the native function list comprises the identification of each native function required to be called by the application program;
writing a calling function responsive to a calling result of the system platform native function based on a type of a return value defined by a specified function framework, wherein the calling function generates the return value of the specified type in response to the calling result of the system platform native function.
Optionally, the preset format is Proto Buffers.
Optionally, the converting the function information into a data block in a specified format includes:
and serializing the function information by using a gRPC to generate a data block in a Proto Buffers format.
According to a fifth aspect of embodiments of the present disclosure, there is provided a data processing apparatus, the apparatus comprising:
the acquisition module is configured to acquire a call command of a user interface of a target application for a specified function interface when a specified native program of a system platform is called through the user interface of the target application, wherein the specified function interface is for a function interface of the specified native program;
the calling module is configured to call a specified function interface aiming at the specified native program according to the calling command to obtain function information for calling the specified native program, wherein the function information comprises a function name and function parameters;
the conversion module is configured to convert the function information into a data block in a specified format;
the sending module is configured to send the data block so that the system platform side can obtain the data block;
a decoding module configured to decode the data block by the system platform to obtain the function information;
the determining module is configured to determine a target calling function corresponding to the function name according to the function name of the function information, and convert the function parameter of the function information into a type which can be identified by the target calling function;
and the execution module is configured to execute the function parameters after the type conversion by using the target calling function framework so as to call the specified native program of the system platform.
Optionally, the apparatus further comprises:
a return module configured to generate a return value of a call result of the system platform native program through the target call function;
a conversion module configured to convert the return value into a return data block of a specified format;
the communication module is configured to send the return data block so that the application program side can obtain the return data block;
the target conversion module is configured to decode the return data block into a type which can be identified by the target calling function, and obtain a return value after type conversion;
and the transfer module is configured to send the type-converted return value to a user interface of the application program through the specified function interface.
Optionally, the apparatus further comprises:
the protocol module is configured to generate a function interface and a function frame according to a protocol file in a preset format, wherein the function interface corresponds to the function frame, and the function frame is used for defining the type of a function parameter and the type of a return value;
the first writing module is configured to write a calling function for calling a system platform native function based on the type of a function parameter defined by a specified function framework according to a preset native function list, wherein the native function list comprises an identifier of each native function required to be called by the application program;
a first writing module configured to write a calling function responsive to a calling result of the system platform native function based on a type of a return value defined by a specified function framework, wherein the calling function generates the return value of the specified type in response to the calling result of the system platform native function.
Optionally, the preset format is Proto Buffers.
Optionally, the converting the function information into a data block in a specified format includes:
and serializing the function information by using a gRPC to generate a data block in a Proto Buffers format.
According to a sixth aspect of embodiments of the present disclosure, there is provided an electronic apparatus including: a processor, a communication interface, a memory, and a communication bus, wherein,
the processor, the communication interface and the memory complete mutual communication through a communication bus;
a memory configured to store a computer program;
a processor configured to implement the data processing method according to any one of the second aspect described above when executing the program stored in the memory.
According to a seventh aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including: a processor, a communication interface, a memory, and a communication bus, wherein,
the processor, the communication interface and the memory complete mutual communication through a communication bus;
a memory configured to store a computer program;
a processor configured to implement the data processing method according to any one of the fourth aspects when executing the program stored in the memory.
According to an eighth aspect of the embodiments of the present disclosure, there is provided a storage medium having stored therein a computer program which, when executed by a processor, implements the data processing method of any one of the above-described second aspects.
According to a ninth aspect of the embodiments of the present disclosure, there is provided a storage medium having stored therein a computer program which, when executed by a processor, implements the data processing method of any one of the above-described fourth aspects.
According to a tenth aspect of embodiments of the present disclosure, there is provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the data processing method of any of the second aspects described above.
According to an eleventh aspect of embodiments of the present disclosure, there is provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the data processing method of any one of the above fourth aspects.
Embodiments of the present disclosure provide a data processing system, a method, an apparatus, an electronic device, a storage medium, and a computer program product including instructions, which at least provide the following advantages:
generating a function interface and a function frame corresponding to each other according to a protocol file with a preset format, writing a calling function for calling a system platform native function according to a preset native function list and based on the type of a function parameter defined by a specified function frame, avoiding an error of communication abnormality caused by protocol incompatibility, transmitting a data block by converting function information into the data block with the specified format so that a system platform end acquires the data block, compared with the prior art, the part sets the function information according to the preset format, realizes automatic code generation, realizes communication between an application program and the system platform, reduces the encoding workload of developers, decodes the data block to obtain the function information through the system platform, and determines a target calling function corresponding to the function name according to the function name of the function information, and converting the function parameters of the function information into types which can be identified by the target calling function, and executing the function parameters after type conversion by using the target calling function framework so as to call the specified native program of the system platform.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
FIG. 1 is a schematic diagram of a data processing system, shown in accordance with an exemplary embodiment;
FIG. 2 is a schematic diagram illustrating a first data processing method in accordance with an exemplary embodiment;
FIG. 3 is a block diagram illustrating a first type of data processing apparatus in accordance with an exemplary embodiment;
FIG. 4 is a schematic diagram illustrating a second data processing method in accordance with an exemplary embodiment;
FIG. 5 is a schematic diagram illustrating a third data processing method in accordance with an exemplary embodiment;
FIG. 6 is a block diagram illustrating a second type of data processing apparatus in accordance with an exemplary embodiment;
FIG. 7 is a block diagram illustrating a first type of electronic device in accordance with an exemplary embodiment;
FIG. 8 is a block diagram illustrating a second type of electronic device, according to an example embodiment.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
The disclosed embodiments disclose a data processing system, a method, an apparatus, an electronic device, a storage medium, and a computer program product containing instructions, which are described below.
FIG. 1 is a schematic diagram illustrating a data processing system, such as that shown in FIG. 1, including:
function interface 010, function framework 050, calling function 060, communication module 030, first compiling and coding module 020, and second compiling and coding module 040.
The function interface 010 and the function framework 050 correspond to each other, the function framework 050 is configured to define types of function parameters, different calling functions are encoded according to different types defined by the function framework, the function interface 010 and the first compiling and coding module 020 are located on an application program side, and the function framework 050 and the second compiling and coding module 040 are located on a system platform side.
The function interface 010 corresponds to the function framework 050, and specifically, a protocol file related to an application program is written according to a preset format, where the preset format may be Proto Buffers. According to the protocol file with the preset format, the function interface 010 and the function frame 050 are automatically generated through a code tool, such as a gRPC (RPC frame implemented on HTTP/2) tool, wherein the function interface 010 and the function frame 050 correspond to each other, the function frame 050 is used for defining types of function parameters, different calling functions are obtained according to type codes defined by different function frames, a system platform can be any one of an android system and an ios system, for example, an application program a for taking pictures is developed, the application program a is installed in the android system, the application program a needs to call a hardware device camera in the android system, then the protocol file between the application program a and the android system is compiled according to the preset format, the code tool gRPC is used for generating a function interface of the application program a, and a function framework of the android system of the system platform about the application program A, for example, a function interface of the application program A is represented as RPC _ API _ A, a function framework of the android system about a camera call is represented as serviceImplBase _ A, and the function framework is used for defining types of functions, including types of function parameters and function return values. The protocol file is compiled by using the preset format, so that the protocol description is more accurate, ambiguity is avoided, and errors of communication abnormity caused by protocol incompatibility are avoided.
The function interface 010 is configured to respond to the call of the user interface of the application program to call corresponding function information, where the function information includes a function name and a function parameter, and the function name represents the function frame 050 corresponding to the function information.
For example, after the application a is developed, a user interface is provided with a photo, and a user operates the photo, for example, after the user presses a photo button of the user interface, the application a generates a photo instruction, and a function interface RPC _ API _ a of the application a calls function information about the photo in response to the photo instruction, where the function information includes a function name and a function parameter, and the function name represents a function framework serviceim base _ a corresponding to the function information. For example, according to a preset native function list, according to the type of the function parameter and the function return value defined by the function framework, a calling function for calling the native function of the system platform is written based on the function framework, wherein the native function list includes the identifier of each native function that needs to be called by the application program, and the type of the function parameter of the function framework called by the camera is ServiceImpl _ a. The function name represents the function frame corresponding to the function information, so that the application program and the system platform realize communication in the subsequent function information calling and responding process, and errors of communication abnormity caused by protocol incompatibility are avoided.
The first compiling and coding module 020 is configured to convert the function information called by the function interface into a data block in a specific format that can be recognized by the communication module 030.
The first compiling and coding module 020 is used to convert the function information called by the function interface into a data block of a predetermined format which can be recognized by the communication module 030, so that the communication module 030 can transfer the function information to the system platform side. For example, when the function interface RPC _ API _ a responds to the photo instruction, the function interface RPC _ API _ a automatically calls the first compiling module 020, and the first compiling module 020 serializes the function information into data blocks in the Proto Buffers format by using the gRPC tool.
The communication module 030 is configured to transmit data between the application and the system platform.
The communication module 030 is configured to send the data block in the specified format to the system platform side. Developers utilize the Flutter to develop the application program, and the Flutter provides a platform channel mechanism to realize that the application program developed by the Flutter can directly call the system platform related codes on the ios operating system or the Android operating system. The communication between the application program and the system platform is realized through the communication module 030.
After the first compiling and coding module 020 converts the function information called by the function interface into the data block in the specified format that can be recognized by the communication module 030, the communication module 030 can transmit the data block in the specified format to the system platform side, so that the system platform side can respond to the called function.
The second coding and decoding module 040 configured to decode the data block to obtain a function name in the data block, and determine a type defined by the corresponding function frame 050 according to the function name in the data block to obtain a target type; and converting the data block into function information of a target type, and calling a calling function 060 corresponding to the target type.
After the system platform side receives the data block transmitted by the application program side, the second coding and decoding module 040 on the system platform side decodes the data block to obtain the function name in the data block. The function frame 050 defines a function type and a return value type, and determines the type defined by the corresponding function frame 050 according to the function name in the data block to obtain a target type, and then converts the data block into function information of the target type, so as to call the call function 060 corresponding to the target type, so that the system platform side can call the function information.
The call function 060 is configured to call a native function of the system platform when executing a function parameter of the function information.
The call function 060 calls a native function of the system platform, for example, a camera call function, when executing the function parameter of the function information. Thereby enabling communication between the application and the system platform.
In a possible implementation, the system further includes:
and the code tool module is configured to generate the function interface and the function framework according to a protocol file in a preset format.
For example, an application program B is developed, the application program B is installed in the android system and the ios system at the same time, the application program B needs to call a camera in the android system to take a picture, a protocol file related to the application program B is written according to a preset format, and the function interface 010 and the function framework 050 are automatically generated by using the code tool module, wherein the function framework includes a function framework of the android system. For example, the protocol file in the preset format is in a Proto Buffers format. The function interface RPC _ API _ B and the function framework ServiceImplBaseAndroid _ B are automatically generated by a code tool gRPC tool, where the function interface and the function framework correspond to each other, that is, when the function interface RPC _ API _ B is called, when response data is transferred to a system platform side, that is, an android system, through the communication module 030, a response can be automatically performed according to the generated corresponding function framework. The protocol file is compiled by using the preset format, so that the protocol description is more accurate, ambiguity is avoided, and errors of communication abnormity caused by protocol incompatibility are avoided.
For example, an application B is developed and installed in the ios system, and the application B needs to call a camera in the ios system to take a picture, then a protocol file related to the application B is written according to a preset format, and the function interface 010 and the function framework 050 are automatically generated by using the code tool module, where the function framework includes a function framework of the ios system. For example, the protocol file in the preset format is in a Proto Buffers format. The function interface RPC _ API _ B and the function framework ServiceImplBaseIOS _ B are automatically generated by a code tool gRPC tool, where the function interface and the function framework correspond to each other, that is, when the function interface RPC _ API _ B is called, when response data is transferred to a system platform side, that is, an ios system side, through the communication module 030, a response can be automatically performed according to the generated corresponding function framework. The protocol file is compiled by using the preset format, so that the protocol description is more accurate, ambiguity is avoided, and errors of communication abnormity caused by protocol incompatibility are avoided.
In one possible embodiment, the function framework is further configured to define a type of the return value, and the calling function is further configured to: responding to the calling result of the native function of the system platform, and generating a return value of the type corresponding to the calling function;
a second encoding and decoding module, further configured to convert the return value into a return data block in a specified format that can be recognized by the communication module;
the first encoding and decoding module is further configured to decode the return data block into a return value of a corresponding type, and send the return value of the corresponding type to a corresponding function interface;
the function interface is further configured to send the received return value to a user interface of the application program.
The ServiceImpl _ a is called, and then the native function of the system platform is called by the ServiceImpl _ a to generate a return value, and the second codec module 040 encodes the return value in a preset format, for example, in a Proto Buffers format, and generates a format that can be recognized by the communication module 030, and transmits the format to the application program side through the communication module 030. And then decoding the coded return value through the first coding and decoding module to obtain a target return value of a type which can be identified by the function interface, and transmitting the target return value to the user interface of the application program through the function interface according to the target return value, so that the application program calls the related function of a system platform and the flat communication between the application program and the system is realized.
Further, the communication module may include: the first communication submodule and the second communication submodule. The first communication submodule is arranged at the application program end, and the second communication submodule is arranged at the system platform side; a first communication sub-module configured to transfer the data block in the specified format that can be recognized by the communication module converted by the first codec module to the system platform; and the second communication submodule is configured to transmit the return value in the target format converted by the second coding module to the application program.
The function interface of the data processing system corresponds to a function frame, the function frame is used for defining the type of function parameters, different calling functions are obtained according to the type codes defined by different function frames, the function interface responds to the calling of the user interface of the application program, corresponding function information is called, the function information called by the function interface is converted into a data block with a specified format which can be identified by the communication module through the first coding and decoding module, the data block with the specified format is transmitted to the system platform side through the communication module, the second coding and decoding module determines the type defined by the corresponding function frame according to the function name in the data block to obtain a target type, converts the data block into the function information of the target type, and calls the calling function corresponding to the target type, and when the calling function executes the function parameter of the function information, calling the native function of the system platform. The information in the function calling process is processed according to the preset format through the function type of the application program side, the function type of the system platform side and the recognizable specified format of the communication module respectively through the first coding and decoding module and the second coding and decoding module, so that the automatic generation of the communication codes of the application program and the system platform is realized, and the coding workload of developers is reduced.
Fig. 2 is a schematic diagram illustrating a first data processing method according to an exemplary embodiment, applied to any of the data processing systems described above, as shown in fig. 2, the method including the steps of:
in step 110, a function interface and a function frame are generated according to a protocol file with a preset format, where the function interface and the function frame correspond to each other, and the function frame is used to define the type of a function parameter.
The data processing method of the embodiment of the application can be implemented by an electronic device, and specifically, the electronic device can be a server.
The protocol file about the application program is written according to a preset format, and the preset format can be Proto Buffers or swift. According to the protocol file with the preset format, a function interface and a function framework are automatically generated through a code tool, such as a gPC tool, wherein the function interface corresponds to the function framework, the function framework is used for defining the type of function parameters, the system platform is one or more of an android system and an ios system, for example, an application A for taking pictures is developed, the application A is installed in the android system, the application A needs to call a hardware device camera in the android system, then, the protocol file between the application A and the android system is written according to the preset format, the function interface of the application A is generated by using the code tool gPC, and the function framework of the android system on the application A is represented by RPC _ API _ A, for example, the function framework called by the camera in the android system is represented by serviceBase _ A, the function framework is used for defining the type of the function, including defining the type of the function parameter and the function return value. The protocol file is compiled by using the preset format, so that the protocol description is more accurate, ambiguity is avoided, and errors of communication abnormity caused by protocol incompatibility are avoided.
In step 120, a calling function for calling a native function of the system platform is written based on the type of a function parameter defined by a specified function framework according to a preset native function list, where the native function list includes an identifier of each native function that needs to be called by the application program.
And writing a calling function for calling the native function of the system platform according to a preset native function list and based on the type of the function parameter defined by the specified function framework. For example, according to a preset native function list, according to the type of the function parameter and the function return value defined by the function framework, a calling function for calling the native function of the system platform is written based on the function framework, and the type of the function parameter of the function framework called by the camera is ServiceImpl _ a. Based on the type of the function parameter defined by the appointed function framework, a calling function for calling the native function of the system platform is compiled, so that the error of communication abnormity caused by protocol incompatibility can be avoided, and the workload of encoding of developers is reduced.
In a possible implementation, the function framework is further configured to define a type of a return value, and the method further includes:
writing a calling function responding to the calling result of the system platform native function based on the type of the return value defined by the specified function framework, wherein the calling function generates the return value of the specified type in response to the calling result of the system platform native function.
Writing a calling function responding to the calling result of the system platform native function based on the type of the return value defined by the specified function framework, wherein the calling function generates the return value of the specified type in response to the calling result of the system platform native function.
In one possible embodiment, the predetermined format is Proto Buffers.
The Proto Buffers format is used for compiling the protocol file, so that the protocol description is more accurate, ambiguity is avoided, and errors of communication abnormity caused by protocol incompatibility are avoided.
According to the protocol file with the preset format, the function interface and the function frame which correspond to each other are generated, according to the preset native function list, the calling function for calling the native function of the system platform is compiled based on the type of the function parameter defined by the specified function frame, and therefore errors of communication abnormity caused by protocol incompatibility are avoided.
Fig. 3 shows a block diagram of a first data processing device according to an exemplary embodiment, see fig. 3, comprising: a generation module 210 and a first writing module 220.
A generating module 210 configured to generate a function interface and a function frame according to a protocol file in a preset format, where the function interface and the function frame correspond to each other, and the function frame is used to define a type of a function parameter;
the first writing module 220 is configured to write a calling function for calling a system platform native function according to a preset native function list based on a type of a function parameter defined by a specified function framework, where the native function list includes an identifier of each native function that the application program needs to call.
In a possible embodiment, the above apparatus further comprises:
and the second writing module is configured to write a calling function responding to the calling result of the system platform native function based on the type of the return value defined by the specified function framework, wherein the calling function generates the return value of the specified type in response to the calling result of the system platform native function.
In one possible embodiment, the predetermined format is Proto Buffers.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Fig. 4 is a schematic diagram illustrating a second data processing method according to an exemplary embodiment, as shown in fig. 4, the method including the steps of:
in step 310, when a specified native program of a system platform is called through a user interface of a target application, a call command of the user interface of the target application to the specified function interface is obtained, wherein the specified function interface is to a function interface of the specified native program.
The data processing method of the embodiment of the application can be implemented by an electronic device, and specifically, the electronic device can be a server.
Writing a protocol file about the target application according to a preset format, wherein the preset format can be a Proto Buffers format. According to the protocol file with the preset format, a function interface and a function frame are automatically generated through a code tool, such as a gRPC tool, wherein the function interface corresponds to the function frame, the function frame is used for defining the type of a function parameter, a system platform is one or more of an android system and an ios system, for example, an application A for taking pictures is developed by using Flutter, the application A is installed in the android system, the application A needs to call a hardware device camera in the android system, then the protocol file related to the application A and the android system is written according to the preset format, the code tool PC is used for generating the function interface of the application A, and the function frame related to the application A of the system platform android system is represented as RPC _ API _ A, for example, the function interface of the application A is represented as RPC _ API _ A, the function framework of the android system about the camera call is denoted as ServiceImplBase _ a, and the function framework is used for defining the type of the function, including defining the type of the function parameter and the function return value. According to the function framework, a target calling function is defined, for example, the calling function called by the application program A and the android system about the camera is ServiceImpl _ A.
For example, the target application is an application program a for taking a picture, the user interface is provided with a picture taking button, and the user operates the button to take a picture, for example, after the user presses the picture taking button of the user interface, the application program a generates a picture taking instruction and calls a function interface RPC _ API _ a of the application program a.
In step 320, according to the call command, a specific function interface for the specific native program is called to obtain function information for calling the specific native program, where the function information includes a function name and a function parameter.
And generating a photographing instruction according to the application program A, and calling a function interface RPC _ API _ A of the application program A to obtain function information about photographing, wherein the function information comprises a function name and function parameters.
In step 330, the function information is converted into a data block in a specified format.
In the communication process of Dart and Java or Kotlin, Objective-C or Swift, since a developer needs to manually complete protocol coding work to implement communication in the communication process of Dart and Java or Kotlin, Objective-C or Swift, specifically, because the type of a function name in a function for transferring function information is String, since the Flutter official component standard message code only supports a basic type, the function information needs to be converted into a data block in a specified format, so that after the function information is called, a function parameter can be transferred to a system platform end, and the system platform end can recognize and directly use the function parameter, thereby avoiding an error of a compatible communication exception caused by protocol incompatibility. For example, the function information is serialized into a data block in the Proto Buffers format by using the gRPC.
In step 340, the data block is sent so that the system platform side acquires the data block.
And sending the data block to a system platform end so that the system platform end acquires the data block.
In step 350, the function information is obtained by decoding the data block through the system platform.
And after receiving the data block, the system platform end decodes the data block to obtain the function information, wherein the function information comprises a function name and a function parameter.
In step 360, according to the function name of the function information, a target call function corresponding to the function name is determined, and the function parameter of the function information is converted into a type that can be identified by the target call function.
For example, according to the function name of the function information, the target calling function corresponding to the function name is determined to be a calling function ServiceImpl _ a called by the application a and the android system with respect to the camera. Because the calling function ServiceImpl _ a specifies the function parameter type and the function return value type, the function parameter of the function information is converted into the type which can be identified by the target calling function according to the calling function ServiceImpl _ a, and the calling of the function is completed. Therefore, the communication code can be automatically generated, and the coding workload of developers is reduced.
In step 370, the type-converted function parameters are executed by using the target call function framework, so as to call the specified native program of the system platform.
And the target calling function framework executes the function parameters after the type conversion, so that the specified native program of the system platform is called, and the calling of the specified native program from the application program end to the system platform end is realized.
According to the calling command, calling a specified function interface aiming at the specified native program to obtain function information for calling the specified native program, converting the function information into a data block with a specified format, sending the data block to enable a system platform end to obtain the data block, decoding the data block through the system platform to obtain the function information, determining a target calling function corresponding to the function name according to the function name of the function information, converting the function parameter of the function information into a type which can be identified by the target calling function, and executing the function parameter after type conversion by using the target calling function framework so as to call the specified native program of the system platform, thereby realizing automatic code generation and reducing the coding workload of developers.
In a possible embodiment, the method further includes:
generating a return value of a calling result of the native program of the system platform through the target calling function;
converting the return value into a return data block with a specified format;
sending the return data block to enable an application program end to obtain the return data block;
decoding the return data block into a type which can be identified by the target call function to obtain a return value after type conversion;
and sending the return value after the type conversion to a user interface of the application program through the specified function interface.
After a specified native program function of the system platform is called, for example, after the function ServiceImpl _ a is called, the ServiceImpl _ a generates a return value, encodes the return value according to a preset format, such as a Proto Buffers format, generates a return data block in the preset format, sends the return data block to an application program end, decodes the return data block into a type that can be identified by the target calling function after the application program end receives the return data block, obtains a return value after type conversion, and sends the return value after type conversion to a user interface of the application program through the specified function interface, so that the application program calls a related function of the system platform, and communication between the application program and the system platform is realized.
In a possible embodiment, the method further includes:
generating a function interface and a function frame according to a protocol file with a preset format, wherein the function interface corresponds to the function frame, and the function frame is used for defining the type of a function parameter and the type of a return value;
writing a calling function for calling a system platform native function according to a preset native function list and based on the type of a function parameter defined by a specified function frame, wherein the native function list comprises the identification of each native function required to be called by the application program;
writing a calling function responding to the calling result of the system platform native function based on the type of the return value defined by the specified function framework, wherein the calling function generates the return value of the specified type in response to the calling result of the system platform native function.
Writing a protocol file about the target application according to a preset format, wherein the preset format can be a Proto Buffers format. According to the protocol file with the preset format, a function interface and a function frame are automatically generated through a code tool, such as a gRPC tool, wherein the function interface corresponds to the function frame, the function frame is used for defining the type of a function parameter, a system platform is one or more of an android system and an ios system, for example, an application A for taking pictures is developed by using Flutter, the application A is installed in the android system, the application A needs to call a hardware device camera in the android system, then the protocol file related to the application A and the android system is written according to the preset format, the code tool PC is used for generating the function interface of the application A, and the function frame related to the application A of the system platform android system is represented as RPC _ API _ A, for example, the function interface of the application A is represented as RPC _ API _ A, the function framework of the android system about the camera call is denoted as ServiceImplBase _ a, and the function framework is used for defining the type of the function, including defining the type of the function parameter and the function return value. According to the function framework, a target calling function is defined, for example, the calling function called by the application program A and the android system about the camera is ServiceImpl _ A.
For example, the target application is an application program a for taking a picture, the user interface is provided with a picture taking button, and the user operates the button to take a picture, for example, after the user presses the picture taking button of the user interface, the application program a generates a picture taking instruction and calls a function interface RPC _ API _ a of the application program a.
In one possible embodiment, the predetermined format is Proto Buffers.
The Proto Buffers format is used for compiling the protocol file, so that the protocol description is more accurate, ambiguity is avoided, and errors of communication abnormity caused by protocol incompatibility are avoided.
In a possible implementation manner, the converting the function information into a data block in a specified format includes:
the above function information was serialized using gRPC to generate data blocks in Proto Buffers format.
The gRPC is used for serializing the function information to generate a data block in a Proto Buffers format, so that when data is sent from an application program end to a system platform end, a platform mechanism of the Flutter can identify the function information.
Fig. 5 is a schematic diagram illustrating a third data processing method according to an exemplary embodiment, as shown in fig. 5, including the steps of:
in step S01, an application side function interface RPC _ API _ a is automatically generated by a code tool according to a predefined protocol file in the Proto Buffers format.
In step S02, a function framework ServiceImplBase _ a is automatically generated by a code tool according to a protocol file in the pre-defined Proto Buffers format, where the function framework ServiceImplBase _ a defines the type of the function, including the types of the function parameter and the function return value.
Wherein step S01 and step S02 do not have a contextual relationship.
In step S03, according to the function framework ServiceImplBase _ a, a target call function is defined, for example, the call function called by the application a and the android system about the camera is ServiceImpl _ a, and the ServiceImpl _ a is manually written by a developer according to the function framework ServiceImplBase _ a.
In step S04, when the specified native program of the system platform is called through the user interface of the target application, a call command of the user interface of the target application to the specified function interface is obtained, and the specified function interface RPC _ API _ a to the specified native program is called according to the call command.
In step S05, the function parameters are serialized into the data block in the Proto Buffers format by using the gRPC through the application program side compiling function RPC _ Client, where the compiling function RPC _ Client is a compiling function that is implemented based on the Flutter platform Channel mechanism Method Channel and conforms to the interface specification of the gRPC, and thus the data block converted by the compiling function RPC _ Client can be identified by the Flutter Method Channel.
In step S06, the data block is transmitted to a Method Channel.
In step S07, the data block is transmitted to the Channel Method Channel of the system platform side through the Channel Method Channel of the application side, and for normal communication, the Channel names of the application side and the system platform side, i.e., the MethodChannel, need to be consistent.
In step S08, a Channel Method Channel on the system platform side performs preliminary decoding to obtain function information, where the function information includes a function name and a function parameter.
In step S09, the compiling function methodcall handler on the system platform side determines the target call function ServiceImpl _ a corresponding to the function name according to the function name of the function information, and converts the function parameters of the function information into a type that can be recognized by the target call function, for example, decodes the function parameters according to the Proto buffers format.
In step S10, the target call function ServiceImpl _ a is used to execute the function parameter after the type conversion, so as to call the specified native program of the system platform, generate a return value, and send the return value to the compiling function MethodCallHandler on the system platform side.
In step S11, the compiling function methodcall handler at the system platform end encodes the received return value according to the Proto Buffers format, and sends the encoded return value as a message to the methodcall at the system platform end.
In step S12, the MethodChannel on the system platform side sends the encoded return value to the message pipe BinaryMessenger on the application program side through the message pipe BinaryMessenger on the system platform side.
In step S13, the encoded return value is decoded by the MethodChannel of the application end to obtain a target return value, and the target return value is sent to the application end compiling function RPC _ Client.
In step S14, the application program terminal compiling function RPC _ Client decodes the target return value according to the Proto Buffers format to obtain a type-converted return value, and returns the type-converted return value to the function interface RPC _ Client _ a.
In step S15, the return value after the type conversion is sent to the user interface of the application program through the function interface RPC _ Client _ a, so as to complete the response of the call instruction.
According to the protocol file with preset format, generating function interface and function frame corresponding to each other, according to the preset native function list, based on the type of function parameter defined by the appointed function frame, writing the calling function for calling the native function of the system platform, avoiding the error of communication abnormity caused by protocol incompatibility, according to the calling command, calling the appointed function interface aiming at the appointed native program, obtaining the function information for calling the appointed native program, converting the function information into the data block with appointed format, sending the data block, making the system platform end obtain the data block, compared with the prior art, the part realizes code automatic generation, reduces the encoding workload of developers, and decodes the data block through the system platform to obtain the function information, according to the function name of the function information, and determining a target calling function corresponding to the function name, converting the function parameter of the function information into a type which can be identified by the target calling function, and executing the function parameter after type conversion by using the target calling function frame so as to call the specified native program of the system platform.
Fig. 6 is a block diagram illustrating a second data processing apparatus according to an example embodiment, the apparatus including, as shown in fig. 6:
the system comprises an acquisition module 410, a calling module 420, a conversion module 430, a sending module 440, a decoding module 450, a determination module 460 and an execution module 470.
The acquisition module 410 is configured to, when a specified native program of a system platform is called through a user interface of a target application, obtain a call command of the user interface of the target application to the specified function interface, where the specified function interface is to a function interface of the specified native program;
a calling module 420 configured to call a specified function interface for the specified native program according to the call command, and obtain function information for calling the specified native program, where the function information includes a function name and a function parameter;
a conversion module 430 configured to convert the function information into a data block in a specified format;
a sending module 440 configured to send the data block, so that the system platform obtains the data block;
a decoding module 450 configured to decode the data block to obtain the function information through the system platform;
a determining module 460, configured to determine, according to the function name of the function information, a target call function corresponding to the function name, and convert the function parameter of the function information into a type that can be identified by the target call function;
and the execution module 470 is configured to execute the function parameters after type conversion by using the target call function framework, so as to call the specified native program of the system platform.
In a possible embodiment, the above apparatus further comprises:
the return module is configured to generate a return value of a calling result of the system platform native program through the target calling function;
a conversion module configured to convert the return value into a return data block of a specified format;
the communication module is configured to send the return data block so that the application program side can obtain the return data block;
the target conversion module is configured to decode the return data block into a type which can be identified by the target call function, and obtain a return value after type conversion;
and the transfer module is configured to send the return value after the type conversion to a user interface of the application program through the specified function interface.
In a possible embodiment, the above apparatus further comprises:
the protocol module is configured to generate a function interface and a function frame according to a protocol file in a preset format, wherein the function interface corresponds to the function frame, and the function frame is used for defining the type of a function parameter and the type of a return value;
the first writing module is configured to write a calling function for calling a system platform native function based on the type of a function parameter defined by a specified function frame according to a preset native function list, wherein the native function list comprises an identifier of each native function to be called by the application program;
and the first writing module is configured to write a calling function responding to the calling result of the system platform native function based on the type of the return value defined by the specified function framework, wherein the calling function generates the return value of the specified type in response to the calling result of the system platform native function.
In one possible embodiment, the predetermined format is Proto Buffers.
In a possible implementation manner, the converting the function information into a data block in a specified format includes:
the above function information was serialized using gRPC to generate data blocks in Proto Buffers format.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
An embodiment of the present application further provides an electronic device, including: a processor, a communication interface, a memory and a communication bus, wherein, the processor, the communication interface and the memory complete the mutual communication through the communication bus,
the memory is used for storing computer programs;
the processor is configured to implement the following steps when executing the computer program stored in the memory:
generating a function interface and a function frame according to a protocol file with a preset format, wherein the function interface corresponds to the function frame, and the function frame is used for defining the type of a function parameter;
writing a calling function for calling the system platform native function according to a preset native function list and based on the type of the function parameter defined by the specified function frame, wherein the native function list comprises the identification of each native function required to be called by the application program.
Optionally, the processor, when being configured to execute the program stored in the memory, may further implement any of the data processing methods applied to any of the data processing systems.
An embodiment of the present application further provides an electronic device, including: a processor, a communication interface, a memory and a communication bus, wherein, the processor, the communication interface and the memory complete the mutual communication through the communication bus,
the memory is used for storing computer programs;
the processor is configured to implement the following steps when executing the computer program stored in the memory:
when a specified native program of a system platform is called through a user interface of a target application, a calling command of the user interface of the target application for a specified function interface is obtained, wherein the specified function interface is for a function interface of the specified native program;
calling a specified function interface aiming at the specified native program according to the calling command to obtain function information for calling the specified native program, wherein the function information comprises a function name and function parameters;
converting the function information into a data block with a specified format;
sending the data block to enable a system platform end to acquire the data block;
decoding the data block through the system platform to obtain the function information;
determining a target calling function corresponding to the function name according to the function name of the function information, and converting the function parameter of the function information into a type which can be identified by the target calling function;
and executing the function parameters after the type conversion by using the target calling function framework so as to call the specified native program of the system platform.
Optionally, the processor, when being configured to execute the program stored in the memory, may further implement any of the data processing methods described above.
Fig. 7 is a schematic diagram of an electronic device according to an embodiment of the disclosure, and referring to fig. 7, the electronic device 800 may be, for example, a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, or the like.
Referring to fig. 7, electronic device 800 may include one or more of the following components: processing component 802, memory 804, power component 806, multimedia component 808, audio component 810, input/output (I/O) interface 812, sensor component 814, and communication component 816.
The processing component 802 generally controls overall operation of the electronic device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing components 802 may include one or more processors 820 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 802 can include one or more modules that facilitate interaction between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
The memory 804 is configured to store various types of data to support operations at the electronic device 800. Examples of such data include instructions for any application or method configured to operate on the electronic device 800, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 804 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The power supply component 806 provides power to the various components of the electronic device 800. The power components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 800.
The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and a user as described above. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of the touch or slide action but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the electronic device 800 is in an operation mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a Microphone (MIC) configured to receive external audio signals when the electronic device 800 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 804 or transmitted via the communication component 816. In some embodiments, audio component 810 further includes a speaker configured to output audio signals.
The I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
Sensor assembly 814 includes one or more sensors configured to provide various aspects of state assessment for electronic device 800. For example, the sensor assembly 814 may detect an open/closed state of the electronic device 800, the relative positioning of components, such as a display and keypad of the electronic device 800, the sensor assembly 814 may also detect a change in position of the electronic device 800 or a component of the electronic device 800, the presence or absence of user contact with the electronic device 800, orientation or acceleration/deceleration of the electronic device 800, and a change in temperature of the electronic device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, configured for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 may access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 4G, or 5G), or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the above-mentioned communication component 816 further comprises a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the electronic device 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components configured to perform a data processing method as described in any of the above embodiments.
In the embodiment of the present disclosure, a storage medium is further provided, where instructions are stored, and when the storage medium runs on a computer, the storage medium causes the computer to execute any one of the data processing methods in the foregoing embodiments. In an exemplary embodiment, a storage medium comprising instructions, such as the memory 804 comprising instructions, executable by the processor 820 of the electronic device 800 to perform the above-described method is also provided. Alternatively, the storage medium may be, for example, a non-transitory computer-readable storage medium, such as a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
FIG. 8 is a schematic diagram illustrating a second type of electronic device, according to an example embodiment. For example, the electronic device 900 may be provided as a server. Referring to fig. 8, electronic device 900 includes a processing component 922, which further includes one or more processors, and memory resources, represented by memory 932, for storing instructions, such as applications, that are executable by processing component 922. The application programs stored in memory 932 may include one or more modules that each correspond to a set of instructions. Further, the processing component 922 is configured to execute instructions to perform a data processing method as described in any of the above embodiments.
The electronic device 900 may also include a power component 926 configured to perform power management of the electronic device 900, a wired or wireless network interface 950 configured to connect the electronic device 900 to a network, and an input/output (I/O) interface 958. The electronic device 900 may operate based on an operating system stored in the memory 932, such as a Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, or similar operating system.
In an embodiment of the present disclosure, there is also provided a computer program product containing instructions, which when run on a computer, cause the computer to execute any of the above-mentioned data processing methods applied to any of the above-mentioned data processing systems in the above-mentioned embodiment.
In the embodiments of the present disclosure, there is also provided a computer program product containing instructions, which when run on a computer, causes the computer to execute any of the above-mentioned data processing methods in the above-mentioned embodiments.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. A data processing system, characterized in that the system comprises:
the system comprises a function interface, a function frame, a calling function, a communication module, a first coding module and a second coding module, wherein the function interface corresponds to the function frame, the function frame is used for defining the type of a function parameter, different calling functions are obtained according to type codes defined by different function frames, the function interface and the first coding module are positioned on the side of an application program, and the function frame and the second coding module are positioned on the side of a system platform;
the function interface is configured to respond to the calling of the user interface of the application program and call corresponding function information, the function information comprises a function name and function parameters, and the function name represents a function frame corresponding to the function information;
the first coding and decoding module is configured to convert the function information called by the function interface into a data block in a specified format which can be recognized by the communication module;
the communication module is configured to transmit data between the application program and the system platform;
the second coding and decoding module is configured to determine a type defined by a corresponding function frame according to the function name in the data block to obtain a target type; converting the data block into function information of a target type, and calling a calling function corresponding to the target type;
the calling function is configured to call a native function of the system platform when the function parameter of the function information is executed.
2. The system of claim 1, wherein the function framework is further configured to define a type of return value, and wherein the calling function is further configured to: responding to the calling result of the native function of the system platform, and generating a return value of the type corresponding to the calling function;
a second codec module further configured to convert the return value into a return data block of a specified format recognizable by the communication module;
the first coding and decoding module is further configured to decode the return data block into a return value of a corresponding type and send the return value of the corresponding type to a corresponding function interface;
the function interface is further configured to send the received return value to a user interface of the application program.
3. A data processing method applied to the data processing system of claim 1 or 2, the method comprising:
generating a function interface and a function frame according to a protocol file with a preset format, wherein the function interface corresponds to the function frame, and the function frame is used for defining the type of a function parameter;
writing a calling function for calling the system platform native function according to a preset native function list and based on the type of the function parameter defined by the specified function frame, wherein the native function list comprises the identification of each native function required to be called by the application program.
4. A data processing apparatus, applied to the data processing system of claim 1 or 2, the apparatus comprising:
the generating module is configured to generate a function interface and a function frame according to a protocol file in a preset format, wherein the function interface corresponds to the function frame, and the function frame is used for defining the type of a function parameter;
the first writing module is configured to write a calling function for calling a system platform native function according to a preset native function list and based on the type of a function parameter defined by a specified function framework, wherein the native function list comprises an identification of each native function required to be called by the application program.
5. A method of data processing, the method comprising:
when a specified native program of a system platform is called through a user interface of a target application, a calling command of the user interface of the target application for a specified function interface is obtained, wherein the specified function interface is for a function interface of the specified native program;
calling a specified function interface aiming at the specified native program according to the calling command to obtain function information for calling the specified native program, wherein the function information comprises a function name and function parameters;
converting the function information into a data block with a specified format;
sending the data block to enable a system platform end to acquire the data block;
decoding the data block through the system platform to obtain the function information;
determining a target calling function corresponding to the function name according to the function name of the function information, and converting the function parameter of the function information into a type which can be identified by the target calling function;
and executing the function parameters after the type conversion by using the target calling function framework so as to call the specified native program of the system platform.
6. A data processing apparatus, characterized in that the apparatus comprises:
the acquisition module is configured to acquire a call command of a user interface of a target application for a specified function interface when a specified native program of a system platform is called through the user interface of the target application, wherein the specified function interface is for a function interface of the specified native program;
the calling module is configured to call a specified function interface aiming at the specified native program according to the calling command to obtain function information for calling the specified native program, wherein the function information comprises a function name and function parameters;
the conversion module is configured to convert the function information into a data block in a specified format;
the sending module is configured to send the data block so that the system platform side can obtain the data block;
a decoding module configured to decode the data block by the system platform to obtain the function information;
the determining module is configured to determine a target calling function corresponding to the function name according to the function name of the function information, and convert the function parameter of the function information into a type which can be identified by the target calling function;
and the execution module is configured to execute the function parameters after the type conversion by using the target calling function framework so as to call the specified native program of the system platform.
7. An electronic device, comprising: a processor, a communication interface, a memory, and a communication bus, wherein,
the processor, the communication interface and the memory complete mutual communication through a communication bus;
a memory configured to store a computer program;
a processor configured to implement the data processing method of claim 3 when executing the program stored in the memory.
8. An electronic device, comprising: a processor, a communication interface, a memory, and a communication bus, wherein,
the processor, the communication interface and the memory complete mutual communication through a communication bus;
a memory configured to store a computer program;
a processor configured to implement the data processing method of claim 5 when executing the program stored in the memory.
9. A storage medium, characterized in that the storage medium has stored therein a computer program which, when executed by a processor, implements the data processing method as claimed in claim 3.
10. A storage medium, characterized in that the storage medium has stored therein a computer program which, when executed by a processor, implements the data processing method as claimed in claim 5.
CN201910944227.4A 2019-09-30 2019-09-30 Data processing system, method, device, electronic equipment and storage medium Active CN110659028B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910944227.4A CN110659028B (en) 2019-09-30 2019-09-30 Data processing system, method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910944227.4A CN110659028B (en) 2019-09-30 2019-09-30 Data processing system, method, device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110659028A true CN110659028A (en) 2020-01-07
CN110659028B CN110659028B (en) 2023-02-28

Family

ID=69039970

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910944227.4A Active CN110659028B (en) 2019-09-30 2019-09-30 Data processing system, method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110659028B (en)

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111290806A (en) * 2020-02-10 2020-06-16 广州虎牙科技有限公司 Calling method and device of application program interface, computer equipment and storage medium
CN111309606A (en) * 2020-02-10 2020-06-19 广州虎牙科技有限公司 Page exception handling method and device, computer equipment and storage medium
CN111427567A (en) * 2020-03-20 2020-07-17 杭州涂鸦信息技术有限公司 Intelligent product rapid generation method, system and equipment thereof
CN111443979A (en) * 2020-04-20 2020-07-24 广州虎牙科技有限公司 Document processing method and device, computer equipment and storage medium
CN112162755A (en) * 2020-09-28 2021-01-01 北京字节跳动网络技术有限公司 Data processing method, device, medium and electronic equipment
CN113094086A (en) * 2021-04-13 2021-07-09 北京房江湖科技有限公司 Component integration method and device, computer-readable storage medium and electronic equipment
CN113110896A (en) * 2021-03-31 2021-07-13 青岛海尔科技有限公司 Data calling method and device, storage medium and electronic device
CN113489600A (en) * 2021-06-08 2021-10-08 北京达佳互联信息技术有限公司 Network parameter configuration method, device and storage medium
CN114385388A (en) * 2022-03-25 2022-04-22 广东美的暖通设备有限公司 Algorithm processing method and device, electronic equipment and storage medium
WO2022100244A1 (en) * 2020-11-12 2022-05-19 Oppo广东移动通信有限公司 Communication processing method and apparatus, storage medium, and electronic device
CN114840597A (en) * 2022-07-04 2022-08-02 杭州安恒信息技术股份有限公司 Component parameter format conversion method, device, equipment and storage medium
CN116166569A (en) * 2023-04-26 2023-05-26 深圳市和讯华谷信息技术有限公司 Mock testing method and related equipment thereof
WO2023092292A1 (en) * 2021-11-23 2023-06-01 京东方科技集团股份有限公司 Communication method for flutter web application and host program, and computer device
WO2023221822A1 (en) * 2022-05-18 2023-11-23 京东方科技集团股份有限公司 Data processing method, electronic device, and readable storage medium
CN117118962A (en) * 2023-07-25 2023-11-24 领悦数字信息技术有限公司 Method and system for deploying user methods across multiple cloud platforms

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020091714A1 (en) * 2000-09-28 2002-07-11 Daniel Blaukopf Method and protocol for mediating communication between software applications
CN103443768A (en) * 2008-07-16 2013-12-11 苹果公司 Specification files for call translation and trace
CN105677311A (en) * 2014-11-21 2016-06-15 卓望数码技术(深圳)有限公司 Identification method and device for function call relationships
CN106415492A (en) * 2014-05-30 2017-02-15 苹果公司 Language, function library, and compiler for graphical and non-graphical computation on a graphical processor unit
CN109117144A (en) * 2018-07-10 2019-01-01 北京小米移动软件有限公司 page processing method, device, terminal and storage medium
CN109857404A (en) * 2019-01-11 2019-06-07 平安科技(深圳)有限公司 The packaging method and device of SDK interface, storage medium, electronic equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020091714A1 (en) * 2000-09-28 2002-07-11 Daniel Blaukopf Method and protocol for mediating communication between software applications
CN103443768A (en) * 2008-07-16 2013-12-11 苹果公司 Specification files for call translation and trace
CN106415492A (en) * 2014-05-30 2017-02-15 苹果公司 Language, function library, and compiler for graphical and non-graphical computation on a graphical processor unit
CN105677311A (en) * 2014-11-21 2016-06-15 卓望数码技术(深圳)有限公司 Identification method and device for function call relationships
CN109117144A (en) * 2018-07-10 2019-01-01 北京小米移动软件有限公司 page processing method, device, terminal and storage medium
CN109857404A (en) * 2019-01-11 2019-06-07 平安科技(深圳)有限公司 The packaging method and device of SDK interface, storage medium, electronic equipment

Cited By (23)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111309606A (en) * 2020-02-10 2020-06-19 广州虎牙科技有限公司 Page exception handling method and device, computer equipment and storage medium
CN111290806A (en) * 2020-02-10 2020-06-16 广州虎牙科技有限公司 Calling method and device of application program interface, computer equipment and storage medium
CN111290806B (en) * 2020-02-10 2024-04-19 广州虎牙科技有限公司 Calling method and device of application program interface, computer equipment and storage medium
CN111309606B (en) * 2020-02-10 2024-01-19 广州虎牙科技有限公司 Page exception handling method and device, computer equipment and storage medium
CN111427567B (en) * 2020-03-20 2023-08-18 杭州涂鸦信息技术有限公司 Intelligent product rapid generation method, system and equipment thereof
CN111427567A (en) * 2020-03-20 2020-07-17 杭州涂鸦信息技术有限公司 Intelligent product rapid generation method, system and equipment thereof
CN111443979A (en) * 2020-04-20 2020-07-24 广州虎牙科技有限公司 Document processing method and device, computer equipment and storage medium
CN111443979B (en) * 2020-04-20 2023-09-05 广州虎牙科技有限公司 Document processing method, device, computer equipment and storage medium
CN112162755A (en) * 2020-09-28 2021-01-01 北京字节跳动网络技术有限公司 Data processing method, device, medium and electronic equipment
WO2022100244A1 (en) * 2020-11-12 2022-05-19 Oppo广东移动通信有限公司 Communication processing method and apparatus, storage medium, and electronic device
CN113110896A (en) * 2021-03-31 2021-07-13 青岛海尔科技有限公司 Data calling method and device, storage medium and electronic device
CN113094086A (en) * 2021-04-13 2021-07-09 北京房江湖科技有限公司 Component integration method and device, computer-readable storage medium and electronic equipment
CN113094086B (en) * 2021-04-13 2024-01-19 贝壳找房(北京)科技有限公司 Component integration method, device, computer readable storage medium and electronic equipment
CN113489600A (en) * 2021-06-08 2021-10-08 北京达佳互联信息技术有限公司 Network parameter configuration method, device and storage medium
CN113489600B (en) * 2021-06-08 2024-05-10 北京达佳互联信息技术有限公司 Network parameter configuration method, device and storage medium
WO2023092292A1 (en) * 2021-11-23 2023-06-01 京东方科技集团股份有限公司 Communication method for flutter web application and host program, and computer device
CN114385388B (en) * 2022-03-25 2022-09-13 广东美的暖通设备有限公司 Algorithm processing method and device, electronic equipment and storage medium
CN114385388A (en) * 2022-03-25 2022-04-22 广东美的暖通设备有限公司 Algorithm processing method and device, electronic equipment and storage medium
WO2023221822A1 (en) * 2022-05-18 2023-11-23 京东方科技集团股份有限公司 Data processing method, electronic device, and readable storage medium
CN114840597A (en) * 2022-07-04 2022-08-02 杭州安恒信息技术股份有限公司 Component parameter format conversion method, device, equipment and storage medium
CN116166569A (en) * 2023-04-26 2023-05-26 深圳市和讯华谷信息技术有限公司 Mock testing method and related equipment thereof
CN117118962A (en) * 2023-07-25 2023-11-24 领悦数字信息技术有限公司 Method and system for deploying user methods across multiple cloud platforms
CN117118962B (en) * 2023-07-25 2024-03-22 领悦数字信息技术有限公司 Method and system for deploying user methods across multiple cloud platforms

Also Published As

Publication number Publication date
CN110659028B (en) 2023-02-28

Similar Documents

Publication Publication Date Title
CN110659028B (en) Data processing system, method, device, electronic equipment and storage medium
CN110610699B (en) Voice signal processing method, device, terminal, server and storage medium
CN111221559B (en) Application updating method, device, storage medium, terminal and server
CN106126025B (en) Interactive method and device for copying and pasting
EP3547136A1 (en) Method and apparatus for communication between webpage and operating system
CN109117144B (en) Page processing method, device, terminal and storage medium
CN112672035B (en) Thumbnail generation method and terminal
CN107463372B (en) Data-driven page updating method and device
WO2023024435A1 (en) Device registration method and apparatus, electronic device, storage medium, and computer program product
CN108270661B (en) Information reply method, device and equipment
CN105183571A (en) Function calling method and device
CN109992754B (en) Document processing method and device
CN109491655B (en) Input event processing method and device
CN111090463B (en) Resource identification method and device and computer storage medium
CN109976872B (en) Data processing method and device, electronic equipment and storage medium
CN112328330A (en) iOS component calling method, device, middleware, electronic equipment and medium
CN111552688A (en) Data export method and device and electronic equipment
US11297626B2 (en) Information indication method and apparatus, base station and user equipment
CN107395724B (en) Network request method and device
CN109445890A (en) A kind of method for showing interface, device, terminal device and storage medium
CN111131000B (en) Information transmission method, device, server and terminal
CN109032583B (en) Data interaction method and device
CN110263211B (en) Resource synchronization method and device
CN114443161B (en) Application docking method, device, equipment and storage medium
CN113535161A (en) User interface generation method and device

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
GR01 Patent grant
GR01 Patent grant