WO2023065937A1 - Data processing method and apparatus, and readable medium and electronic device - Google Patents

Data processing method and apparatus, and readable medium and electronic device Download PDF

Info

Publication number
WO2023065937A1
WO2023065937A1 PCT/CN2022/120087 CN2022120087W WO2023065937A1 WO 2023065937 A1 WO2023065937 A1 WO 2023065937A1 CN 2022120087 W CN2022120087 W CN 2022120087W WO 2023065937 A1 WO2023065937 A1 WO 2023065937A1
Authority
WO
WIPO (PCT)
Prior art keywords
target
application program
data
function
target data
Prior art date
Application number
PCT/CN2022/120087
Other languages
French (fr)
Chinese (zh)
Inventor
龙跃
高官涛
郭俊
Original Assignee
北京火山引擎科技有限公司
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 北京火山引擎科技有限公司 filed Critical 北京火山引擎科技有限公司
Publication of WO2023065937A1 publication Critical patent/WO2023065937A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/258Data format conversion from or to a database

Definitions

  • the present disclosure relates to the field of computer technology, and in particular, to a data processing method, device, readable medium, and electronic equipment.
  • query engine Hive query engine Presto
  • query engine Spark query engine Impala
  • UDF User Defined function, user-defined function
  • the present disclosure provides a data processing method applied to a first application program, the method comprising:
  • the target processing policy is executed on the second target data by the second application.
  • the present disclosure provides a data processing device applied to a first application program, the device comprising:
  • a data acquisition module configured to acquire first target data to be processed in response to receiving a data processing instruction, where the data processing instruction is used to instruct execution of a target processing policy on the first target data;
  • an execution determining module configured to determine whether the first application program can execute the target processing policy on the first target data
  • An application program determining module configured to determine a second application program capable of executing the target processing policy when it is determined that the first application program cannot execute the target processing policy on the first target data, the first application program The encoding method of the second application program is different from that of the first application program;
  • a first format conversion module configured to convert the first target data into second target data according to a first data format that can be processed by the second application program
  • a policy execution module configured to execute the target processing policy on the second target data through the second application program.
  • the present disclosure provides a computer-readable medium on which a computer program is stored, and when the program is executed by a processing device, the steps of the method described in the first aspect of the present disclosure are implemented.
  • an electronic device including:
  • a processing device configured to execute the computer program in the storage device to implement the steps of the method described in the first aspect of the present disclosure.
  • the first target data to be processed is obtained, and the data processing instruction is used to instruct to execute a target processing policy on the first target data; determine whether the first application program capable of executing the target processing policy on the first target data; in a case where it is determined that the first application cannot execute the target processing policy on the first target data, determine that the target processing policy can be executed
  • a second application program the encoding method of the second application program is different from that of the first application program; according to the first data format that the second application program can process, the first target data is converted into a second target data; executing the target processing policy on the second target data by the second application program.
  • the first application program cannot execute the target processing policy on the first target data
  • the format conversion is performed on the first target data to obtain the second target data
  • the target processing strategy is executed on the second target data through the second application program, so that the mutual commonality between the first application program and the second application program can be realized without redefining the framework, and the implementation difficulty is reduced.
  • Fig. 1 is a flowchart of a data processing method shown according to an exemplary embodiment
  • Fig. 2 is a flow chart showing another data processing method according to an exemplary embodiment
  • Fig. 3 is a block diagram of a data processing device according to an exemplary embodiment
  • Fig. 4 is a block diagram of a second data processing device according to an exemplary embodiment
  • Fig. 5 is a block diagram of a third data processing device according to an exemplary embodiment
  • Fig. 6 is a block diagram of a fourth data processing device according to an exemplary embodiment
  • Fig. 7 is a block diagram of an electronic device according to an exemplary embodiment.
  • the term “comprise” and its variations are open-ended, ie “including but not limited to”.
  • the term “based on” is “based at least in part on”.
  • the term “one embodiment” means “at least one embodiment”; the term “another embodiment” means “at least one further embodiment”; the term “some embodiments” means “at least some embodiments.” Relevant definitions of other terms will be given in the description below.
  • the UDF function allows users to define their own functions in the query, instead of just using the system preset functions, which greatly improves the user query experience and expands the query function of the query engine.
  • different query engines support UDFs differently, and it is difficult to use them universally. This non-universality makes it difficult for users to reuse their queries between multiple query engines, and even needs to maintain multiple versions of UDF.
  • some query engines support the ability to run other query engine UDFs (for example, Spark supports running Hive UDF), this is due to their similar syntax.
  • Presto's UDF is an annotation type definition, which is quite different from Hive UDF.
  • Hive UDFs Due to historical reasons, Hive was born earlier and widely used. Most companies in the industry have used Hive extensively, and a large number of Hive UDFs play an important role in the production environment. Therefore, how to support Hive UDF in Presto is a technical problem, which also greatly affects the scalability and versatility of the Presto query engine.
  • the present disclosure provides a data processing method, device, readable medium, and electronic device.
  • the second application program can process of the first data format, convert the first target data to obtain the second target data, and execute the target processing strategy on the second target data through the second application program.
  • the first application program and the The second application programs are common to each other, which reduces the difficulty of implementation.
  • Fig. 1 is a flow chart of a data processing method shown according to an exemplary embodiment, the method is applied to a first application program, and the first application program may be a data query tool, such as a Presto query engine, or may be a data processing tool, which is not limited in the present disclosure.
  • the first application program is used as an example for illustration; the method may include:
  • the data processing instruction may be used to instruct to execute the target processing policy on the first target data, for example, the data processing instruction may be a SQL (Structured Query Language, Structured Query Language) statement.
  • SQL Structured Query Language
  • the first target data to be processed may be acquired according to the data processing instruction.
  • the data processing instruction is an SQL statement
  • the first target data can be obtained from a preset database according to the SQL statement, for example, in the case where the SQL statement is "select avg(col) from table" , the first target data may be each row of data in the table.
  • the target processing strategy to be executed on the first target data can be determined according to the data processing instruction. For example, continue to use the data processing instruction as "select avg(col) from table” for description, then the target processing strategy is averaging. Further, after the target processing policy is determined, it may be determined whether the first application program can execute the target processing policy on the first target data.
  • the first objective function may be a function of obtaining the average value
  • the first application program includes the function of obtaining the average value
  • it may be determined that the first application program can execute the target processing strategy and in a case where it is determined that the first application program does not include a function for obtaining an average value, it may be determined that the first application program cannot execute the target processing strategy.
  • the encoding method of the second application program may be different from that of the first application program.
  • the first application program is a Presto query engine
  • the second application program may be a Hive query engine.
  • a second application program capable of executing the target processing strategy may be determined from a plurality of preset application programs, wherein, the plurality of preset applications may be applications with the same functions as the first application but with different coding methods. For example, if the first application is the Presto query engine, the preset applications may be existing Other query engines are available. It should be noted that, in a case where the preset application program includes one application program, the preset application program may be used as the second application program.
  • the coding method of the second application program is different from that of the first application program, and the second application program cannot directly execute the target processing strategy on the first target data.
  • the first data format that the second application program can process can be obtained. For example, continue to use the data processing instruction as "select avg(col) from table" for illustration, the second application program can The type corresponding to the parameter of the function used to obtain the average value is used as the first data format, and then the first target data can be converted into the second target data according to the first data format.
  • the corresponding function in the second application program can be called to execute the target processing strategy on the second target data.
  • the first processing result may be converted into a second processing result according to the second data format that the first application program can process, And outputting the second processing result, the first processing result is the result of executing the target processing strategy on the second target data through the second application program.
  • the format conversion of the first target data is performed to obtain the second target data
  • the target processing strategy is executed on the second target data through the second application program, so that the mutual commonality between the first application program and the second application program can be realized without redefining the framework, and the implementation difficulty is reduced.
  • Fig. 2 is a flowchart of another data processing method shown according to an exemplary embodiment, the method may include:
  • the data processing instruction may be used to instruct to execute the target processing policy on the first target data, for example, the data processing instruction may be a SQL (Structured Query Language, Structured Query Language) statement.
  • SQL Structured Query Language
  • step S202 Determine whether the first application program includes the first objective function. If it is determined that the first application program includes the first objective function, perform step S203. After determining that the first application program does not include the first objective function In the case of , execute steps S204 to S208.
  • the first objective function may be used to implement the objective processing strategy.
  • the target processing strategy for the first target data can be determined according to the data processing instruction.
  • the data processing If the instruction is an SQL statement, the SQL statement can be parsed to determine the first objective function corresponding to the SQL statement.
  • the first objective function can include multiple. Afterwards, the first objective function can be searched in the built-in functions of the Presto query engine. an objective function. For example, if the SQL statement is "select avg(col) from table", it can be determined that the first objective function is the function for obtaining the average value, and then the function for obtaining the average value can be found in the built-in functions of the Presto query engine .
  • the first target function is found in the built-in functions of the Presto query engine, it means that the Presto query engine can execute the target processing strategy for the first target data; if it is not found in the built-in functions of the Presto query engine
  • the first objective function means that the Presto query engine cannot execute the objective processing strategy on the first objective data.
  • the plurality of preset applications may be applications with the same functions as the first application but with different coding methods.
  • the first application is the Presto query engine
  • the preset applications may be existing Other query engines of the art; the second objective function is used to implement the objective processing strategy.
  • the first application program may be searched from a plurality of preset application programs that can execute the target processing strategy for the first target data. of the second application.
  • the second objective function may be searched in sequence among multiple preset application programs, and the first preset application program including the second objective function is used as the second application program.
  • the first data format may be a parameter type of the second objective function.
  • the parameter type of the second objective function of the second application program may be determined, and the first objective function is converted into the second objective function according to the parameter type.
  • the first Whether the application program caches the target resource package corresponding to the second target function of the second application program if it is determined that the first application program caches the target resource package corresponding to the second target function of the second application program, according to the first
  • the second target function of the application program can process the first data format, and convert the first target data into the second target data.
  • the resource information corresponding to the second objective function it may be determined whether the second objective function is cached in the local server corresponding to the first application program, and the local server corresponding to the first application program is cached in the local server corresponding to the first application program.
  • the first target data may be directly converted into the second target data according to the first data format that can be processed by the second target function of the second application program.
  • the resource information may include resource address, class name, parameter type, return type, creation time, modification time and so on.
  • the target resource package may be obtained from a server corresponding to the second application program, and the target resource package may be loaded, And after the target resource package is loaded, convert the first target data into the second target data according to the first data format that can be processed by the second target function of the second application program.
  • the target resource package can be obtained from the server corresponding to the second application program, and the target resource package can be downloaded to the local server corresponding to the first application program, Afterwards, the target resource pack can be loaded through the process of the first application program, and after the target resource pack is loaded, the first target data can be converted into the second target according to the parameter type corresponding to the second target function data.
  • the resource information and version information of the target resource package can be stored.
  • the first application program caches the second target function, it can be further processed according to The resource information and version information of the target resource package corresponding to the second target function determine whether a new target resource package needs to be acquired and loaded.
  • the second target function in the second application program can be executed The corresponding initialization method obtains all data types supported by the second target function, and then determines whether the first application program can perform format conversion on the first target data according to the first data format. If the first application program can perform format conversion on the first target data according to the first data format, convert the first target data according to the first data format that can be processed by the second target function of the second application program is the second target data; if the first application program cannot perform format conversion on the first target data according to the first data format, then output abnormal prompt information.
  • the second target data may include multiple data.
  • the first target data may be each row of data in the table
  • the second target data The data includes data obtained by converting the format of each row of data in the table according to the first data format.
  • the second objective function may include a first function, a second function, and a third function.
  • the second objective function may be a UDAF (User Defined Aggregate Function, user-defined aggregate function).
  • the first function can be called through the first preset function of the first application program, so as to process multiple
  • the second target data is to obtain a plurality of first data
  • the second function is called through the second preset function of the first application program, so that the plurality of first data is aggregated through the second function to obtain a plurality of first data second data
  • calling the third function through a third preset function of the first application program, so as to process a plurality of second data through the third function.
  • the first function may be an iterate function
  • the second function may be a merge function
  • the third function may be a terminate function
  • a call to the first function may be added to the first preset function in advance
  • the A call to the second function is added to the second preset function
  • a call to the third function is added to the third preset function.
  • the iterate function may include multiple ones, different iterate functions may run on different servers, and the obtained multiple first data are also located on different servers.
  • the second target data is used as an input parameter of the iterate function, and the second target data is respectively processed by a plurality of iterate functions to obtain a plurality of first data.
  • the merge function may be called through a second preset function, the first data may be used as an input parameter of the merge function, and the plurality of first data may be aggregated through the merge function, That is, sending the first data to the same server to obtain multiple second data.
  • the merge function may include multiple, and different merge functions may run on different servers.
  • the terminate function is called through the third preset function, the plurality of second data are used as input parameters of the terminate function, and the final processing flow is executed on the plurality of second data through the terminate function.
  • first function, second function, and third function are just examples, and the first function, the second function, and the third function may also be functions that execute other strategies, which are not limited in this disclosure .
  • first preset function, the second preset function, and the third preset function may be existing functions in the first application program, or newly added functions in the first application program, This disclosure does not limit it.
  • the first processing result may be a result of executing the target processing policy on the second target data through the second target function of the second application program.
  • the type of the return value of the first preset function can be used as the second data format, the first processing result can be converted into the second processing result, and output The second processing result. It should be noted that, after converting the first processing result into the second processing result, subsequent processing procedures may also be executed according to the second processing result, which is not limited in the present disclosure.
  • the format conversion of the first target data is performed to obtain the second target data,
  • the second application program to implement the target processing strategy for the second target data, in this way, without redefining the framework, the mutual commonality between the first application program and the second application program can be realized, which reduces the difficulty of implementation; further, in the first application program
  • the second target data can be aggregated through multiple functions, so that the mutual use of the UDAF functions in the first application program and the second application program can be realized, expanding the scope of the first application program.
  • the usage scenarios of the first application program and the second application program improve the user experience.
  • Fig. 3 is a block diagram of a data processing device according to an exemplary embodiment, the device is applied to a first application program, as shown in Fig. 3 , including:
  • a data acquisition module 301 configured to acquire first target data to be processed in response to receiving a data processing instruction, where the data processing instruction is used to instruct execution of a target processing policy on the first target data;
  • an execution determining module 302 configured to determine whether the first application program can execute the target processing policy on the first target data
  • An application program determining module 303 configured to determine a second application program capable of executing the target processing policy when it is determined that the first application program cannot execute the target processing policy for the first target data, and the second application program is related to the the first application is coded differently;
  • the first format conversion module 304 is configured to convert the first target data into second target data according to the first data format that the second application program can process;
  • a policy execution module 305 configured to execute the target processing policy on the second target data through the second application program.
  • execution determining module 302 is also used to:
  • the first application program includes the first target function, determining that the first application program is capable of executing the target processing policy on the first target data;
  • the application program determination module 303 is also used to:
  • a preset application program including a second objective function among the plurality of preset application programs is used as the second application program, and the second objective function is used to execute the target processing strategy.
  • the first format conversion module 304 is also used for:
  • Executing the target processing policy on the second target data through the second application program includes:
  • the target processing strategy is executed on the second target data by the second target function.
  • FIG. 4 is a block diagram of a second data processing device according to an exemplary embodiment. As shown in FIG. 4 , the device further includes:
  • a cache determination module 306 configured to determine whether the first application program caches the target resource bundle corresponding to the second target function of the second application program
  • the first format conversion module 304 is also used for:
  • the first application program caches the target resource bundle corresponding to the second target function of the second application program, according to the first data format that the second target function of the second application program can handle, the first The target data is converted into the second target data.
  • FIG. 5 is a block diagram of a third data processing device according to an exemplary embodiment. As shown in FIG. 5 , the device further includes:
  • a resource package acquiring module 307 configured to acquire the target resource package from the server corresponding to the second application program when it is determined that the first application program has not cached the target resource package corresponding to the second target function of the second application program ;
  • the first format converting module 304 is further configured to convert the first target data into the second target data.
  • the second target data includes multiple, the second target function includes a first function, a second function, and a third function; the policy execution module 305 is also used for:
  • FIG. 6 is a block diagram of a fourth data processing device according to an exemplary embodiment. As shown in FIG. 6, the device further includes:
  • the second format conversion module 309 is configured to convert the first processing result into a second processing result according to the second data format that the first application program can process, and output the second processing result, and the first processing result is passed A result of the second application executing the target processing policy on the second target data.
  • the first target data is format-converted according to the first data format that the second application program can process to obtain the second target data
  • the target processing strategy is executed on the second target data through the second application program, so that the mutual commonality between the first application program and the second application program can be realized without redefining the framework, and the implementation difficulty is reduced.
  • FIG. 7 it shows a schematic structural diagram of an electronic device 700 suitable for implementing the embodiments of the present disclosure.
  • the terminal equipment in the embodiment of the present disclosure may include but not limited to such as mobile phone, notebook computer, digital broadcast receiver, PDA (personal digital assistant), PAD (tablet computer), PMP (portable multimedia player), vehicle terminal (such as mobile terminals such as car navigation terminals) and fixed terminals such as digital TVs, desktop computers and the like.
  • the electronic device shown in FIG. 7 is only an example, and should not limit the functions and application scope of the embodiments of the present disclosure.
  • an electronic device 700 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) Various appropriate actions and processes are executed by programs in the memory (RAM) 703 . In the RAM 703, various programs and data necessary for the operation of the electronic device 700 are also stored.
  • the processing device 701, ROM 702, and RAM 703 are connected to each other through a bus 704.
  • An input/output (I/O) interface 705 is also connected to the bus 704 .
  • the following devices can be connected to the I/O interface 705: input devices 706 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; including, for example, a liquid crystal display (LCD), speaker, vibration an output device 707 such as a computer; a storage device 708 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 709.
  • the communication means 709 may allow the electronic device 700 to communicate with other devices wirelessly or by wire to exchange data. While FIG. 7 shows electronic device 700 having various means, it should be understood that implementing or having all of the means shown is not a requirement. More or fewer means may alternatively be implemented or provided.
  • embodiments of the present disclosure include a computer program product, which includes a computer program carried on a non-transitory computer readable medium, where the computer program includes program code for executing the method shown in the flowchart.
  • the computer program may be downloaded and installed from a network via communication means 709, or from storage means 708, or from ROM 702.
  • the processing device 701 the above-mentioned functions defined in the methods of the embodiments of the present disclosure are executed.
  • the above-mentioned computer-readable medium in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two.
  • a computer readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer diskettes, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave carrying computer-readable program code therein. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • a computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can transmit, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device .
  • Program code embodied on a computer readable medium may be transmitted by any appropriate medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
  • the client and the server can communicate using any currently known or future network protocols such as HTTP (HyperText Transfer Protocol, Hypertext Transfer Protocol), and can communicate with digital data in any form or medium
  • HTTP HyperText Transfer Protocol
  • the communication eg, communication network
  • Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), internetworks (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network of.
  • the above-mentioned computer-readable medium may be included in the above-mentioned electronic device, or may exist independently without being incorporated into the electronic device.
  • the above-mentioned computer-readable medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device: responds to receiving a data processing instruction, acquires the first target data to be processed, so The data processing instruction is used to instruct to execute the target processing policy on the first target data; determine whether the first application program can execute the target processing policy on the first target data; If the target processing policy cannot be executed on the first target data, determine a second application program capable of executing the target processing policy, where the second application program is coded differently from the first application program; Converting the first target data into second target data according to the first data format that the second application program can process; executing the target processing policy on the second target data through the second application program.
  • Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, or combinations thereof, including but not limited to object-oriented programming languages—such as Java, Smalltalk, C++, and Includes conventional procedural programming languages - such as "C" or similar programming languages.
  • the program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server.
  • the remote computer may be connected to the user computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (for example, using an Internet service provider to connected via the Internet).
  • LAN local area network
  • WAN wide area network
  • Internet service provider for example, using an Internet service provider to connected via the Internet.
  • each block in a flowchart or block diagram may represent a module, program segment, or portion of code that contains one or more logical functions for implementing specified executable instructions.
  • the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved.
  • each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations can be implemented by a dedicated hardware-based system that performs the specified functions or operations , or may be implemented by a combination of dedicated hardware and computer instructions.
  • the modules involved in the embodiments described in the present disclosure may be implemented by software or by hardware. Wherein, the name of the module does not constitute a limitation of the module itself under certain circumstances, for example, the data acquisition module may also be described as "a module for acquiring the first target data to be processed".
  • FPGAs Field Programmable Gate Arrays
  • ASICs Application Specific Integrated Circuits
  • ASSPs Application Specific Standard Products
  • SOCs System on Chips
  • CPLD Complex Programmable Logical device
  • a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device.
  • a machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium.
  • a machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing.
  • machine-readable storage media would include one or more wire-based electrical connections, portable computer discs, hard drives, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, compact disk read only memory (CD-ROM), optical storage, magnetic storage, or any suitable combination of the foregoing.
  • RAM random access memory
  • ROM read only memory
  • EPROM or flash memory erasable programmable read only memory
  • CD-ROM compact disk read only memory
  • magnetic storage or any suitable combination of the foregoing.
  • Example 1 provides a data processing method applied to a first application program, the method comprising: acquiring first target data to be processed in response to receiving a data processing instruction, The data processing instruction is used to instruct to execute the target processing policy on the first target data; determine whether the first application program can execute the target processing policy on the first target data; When the program cannot execute the target processing policy on the first target data, determine a second application program capable of executing the target processing policy, where the second application program is coded differently from the first application program ; convert the first target data into second target data according to the first data format that the second application program can process; execute the target processing policy on the second target data through the second application program .
  • Example 2 provides the method of Example 1, the determining whether the first application program can execute the target processing policy on the first target data includes: determining the first target data Whether an application program includes a first objective function, and the first objective function is used to execute the target processing strategy; when it is determined that the first application program includes the first objective function, determining that the first application program a program capable of executing the target processing policy on the first target data; in a case where it is determined that the first application program does not include the first target function, it is determined that the first application program cannot process the first target data Data enforces the target processing policy.
  • Example 3 provides the method of Example 1, the determining the second application that can execute the target processing strategy includes: including the second target function in a plurality of preset application programs The preset application program is the second application program, and the second objective function is used to execute the target processing policy.
  • Example 4 provides the method of Example 3, converting the first target data into second target data according to the first data format that the second application program can handle including: converting the first target data into the second target data according to the first data format that can be processed by the second target function of the second application program; Executing the target processing policy on the second target data includes: executing the target processing policy on the second target data through the second target function.
  • Example 5 provides the method of Example 4.
  • the method further includes: determining whether the first application program caches the target resource package corresponding to the second target function of the second application program;
  • a first data format that can be processed by the second object function of the program, converting the first object data into the second object data includes: determining that the first application program caches the second object of the second application program In the case of the target resource package corresponding to the function, the first target data is converted into the second target data according to the first data format that can be processed by the second target function of the second application program.
  • Example 6 provides the method of Example 5, the method further comprising: after determining that the first application program does not cache the target corresponding to the second target function of the second application program In the case of a resource pack, the target resource pack is obtained from the server corresponding to the second application; the target resource pack is loaded; after the target resource pack is loaded, according to the second A first data format that can be processed by the objective function, converting the first objective data into the second objective data.
  • Example 7 provides the method of Example 4, the second target data includes a plurality, and the second target function includes a first function, a second function, and a third function; Executing the target processing strategy on the second target data through the second target function includes: calling the first function through a first preset function of the first application program, so as to use the first function Process a plurality of the second target data respectively to obtain a plurality of first data; call the second function through the second preset function of the first application program, so as to use the second function for the plurality of the Aggregating the first data to obtain a plurality of second data; calling the third function through a third preset function of the first application program, so as to process the plurality of second data through the third function.
  • Example 8 provides the method of any one of Examples 1 to 7, the method further comprising: according to the second data format that the first application program can handle, converting the first A processing result is converted into a second processing result, and the second processing result is output, and the first processing result is a result of executing the target processing policy on the second target data through the second application program.
  • Example 9 provides a data processing device, which is applied to a first application program, and the device includes: a data acquisition module, configured to acquire a data processing instruction to be processed in response to receiving a data processing instruction the first target data, the data processing instruction is used to instruct to execute the target processing policy on the first target data; the execution determining module is used to determine whether the first application program can execute the target processing policy on the first target data The target processing strategy; an application program determination module, configured to determine a second application capable of executing the target processing strategy when it is determined that the first application program cannot execute the target processing strategy for the first target data program, the encoding method of the second application program is different from that of the first application program; the first format conversion module is configured to convert the first target data into the first data format that can be processed by the second application program converted into second target data; a policy execution module, configured to execute the target processing policy on the second target data through the second application program.
  • a data acquisition module configured to acquire a data processing instruction to be processed in response to receiving a data processing instruction the first
  • Example 10 provides a computer-readable medium on which a computer program is stored, and when the program is executed by a processing device, the steps of the method described in any one of Examples 1-8 are implemented. .
  • Example 11 provides an electronic device, including: a storage device on which a computer program is stored; a processing device configured to execute the computer program in the storage device to Implement the steps of the method described in any one of Examples 1-8.

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The present disclosure relates to a data processing method and apparatus, and a readable medium and an electronic device, wherein the method is applied to a first application program. The method comprises: in response to receiving a data processing instruction, acquiring first target data to be processed; determining whether the first application program can execute a target processing policy on the first target data; when it is determined that the first application program cannot execute the target processing policy on the first target data, determining a second application program, which can execute the target processing policy, wherein the encoding mode of the second application program is different from that of the first application program; converting the first target data into second target data according to a first data format in which the second application program can perform processing; and executing the target processing policy on the second target data by means of the second application program. In this way, a first application program and a second application program can be used interchangeably without re-defining a framework, such that the difficulty in implementation is reduced.

Description

数据处理方法、装置、可读介质及电子设备Data processing method, device, readable medium and electronic device
相关申请的交叉引用Cross References to Related Applications
本申请基于申请号为202111234197.1、申请日为2021年10月22日,名称为“数据处理方法、装置、可读介质及电子设备”的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。This application is based on the Chinese patent application with the application number 202111234197.1, the filing date is October 22, 2021, and the title is "data processing method, device, readable medium and electronic equipment", and claims the priority of the Chinese patent application, The entire content of this Chinese patent application is hereby incorporated by reference into this application.
技术领域technical field
本公开涉及计算机技术领域,具体地,涉及一种数据处理方法、装置、可读介质及电子设备。The present disclosure relates to the field of computer technology, and in particular, to a data processing method, device, readable medium, and electronic equipment.
背景技术Background technique
随着大数据技术的发展,出现了多种基于大数据的查询引擎。例如,查询引擎Hive、查询引擎Presto、查询引擎Spark、查询引擎Impala。这些查询引擎具备强大的查询功能,提供了丰富的UDF(User Defined function,用户自定义函数)。但是,不同查询引擎对UDF的支持各不相同,相互之间难以通用。With the development of big data technology, a variety of query engines based on big data have emerged. For example, query engine Hive, query engine Presto, query engine Spark, query engine Impala. These query engines have powerful query functions and provide rich UDF (User Defined function, user-defined function). However, different query engines support UDFs differently, and it is difficult to use them universally.
相关技术中,通过定义一个新的UDF框架,用户在新的框架中重写一套UDF,以满足不同查询引擎的语法需求。但是,这种方式的工作量较大,导致实现难度较大。In related technologies, by defining a new UDF framework, a user rewrites a set of UDFs in the new framework to meet the grammatical requirements of different query engines. However, this method requires a large amount of work, which makes it difficult to implement.
发明内容Contents of the invention
提供该发明内容部分以便以简要的形式介绍构思,这些构思将在后面的具体实施方式部分被详细描述。该发明内容部分并不旨在标识要求保护的技术方案的关键特征或必要特征,也不旨在用于限制所要求的保护的技术方案的范围。This Summary is provided to introduce a simplified form of concepts that are described in detail later in the Detailed Description. This summary of the invention is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to be used to limit the scope of the claimed technical solution.
第一方面,本公开提供一种数据处理方法,应用于第一应用程序,所述方法包括:In a first aspect, the present disclosure provides a data processing method applied to a first application program, the method comprising:
响应于接收到数据处理指令,获取待处理的第一目标数据,所述数据处理指令用于指示对所述第一目标数据执行目标处理策略;acquiring first target data to be processed in response to receiving a data processing instruction, the data processing instruction being used to instruct execution of a target processing policy on the first target data;
确定所述第一应用程序是否能够对所述第一目标数据执行所述目标处理策略;determining whether the first application is capable of executing the target processing policy on the first target data;
在确定所述第一应用程序不能对所述第一目标数据执行所述目标处理策略的情况下,确定能够执行所述目标处理策略的第二应用程序,所述第二应用程序与所述第一应用程序的编码方式不同;In a case where it is determined that the first application program cannot execute the target processing policy on the first target data, determining a second application program capable of executing the target processing policy, the second application program being identical to the first application program An application is coded differently;
按照所述第二应用程序能够处理的第一数据格式,将所述第一目标数据转换为第二目标数据;converting the first target data into second target data according to a first data format capable of being processed by the second application;
通过所述第二应用程序对所述第二目标数据执行所述目标处理策略。The target processing policy is executed on the second target data by the second application.
第二方面,本公开提供一种数据处理装置,应用于第一应用程序,所述装置包括:In a second aspect, the present disclosure provides a data processing device applied to a first application program, the device comprising:
数据获取模块,用于响应于接收到数据处理指令,获取待处理的第一目标数据,所述数据处理指令用于指示对所述第一目标数据执行目标处理策略;A data acquisition module, configured to acquire first target data to be processed in response to receiving a data processing instruction, where the data processing instruction is used to instruct execution of a target processing policy on the first target data;
执行确定模块,用于确定所述第一应用程序是否能够对所述第一目标数据执行所述目标处理策略;an execution determining module, configured to determine whether the first application program can execute the target processing policy on the first target data;
应用程序确定模块,用于在确定所述第一应用程序不能对所述第一目标数据执行所述目标处理策略的情况下,确定能够执行所述目标处理策略的第二应用程序,所述第二应用程序与所述第一应用程序的编码方式不同;An application program determining module, configured to determine a second application program capable of executing the target processing policy when it is determined that the first application program cannot execute the target processing policy on the first target data, the first application program The encoding method of the second application program is different from that of the first application program;
第一格式转换模块,用于按照所述第二应用程序能够处理的第一数据格式,将所述第一目标数据转换为第二目标数据;a first format conversion module, configured to convert the first target data into second target data according to a first data format that can be processed by the second application program;
策略执行模块,用于通过所述第二应用程序对所述第二目标数据执行所述目标处理策略。A policy execution module, configured to execute the target processing policy on the second target data through the second application program.
第三方面,本公开提供一种计算机可读介质,其上存储有计算机程序,该程序被处理装置执行时实现本公开第一方面所述方法的步骤。In a third aspect, the present disclosure provides a computer-readable medium on which a computer program is stored, and when the program is executed by a processing device, the steps of the method described in the first aspect of the present disclosure are implemented.
第四方面,本公开提供一种电子设备,包括:In a fourth aspect, the present disclosure provides an electronic device, including:
存储装置,其上存储有计算机程序;a storage device on which a computer program is stored;
处理装置,用于执行所述存储装置中的所述计算机程序,以实现本公开第一方面所述方法的步骤。A processing device configured to execute the computer program in the storage device to implement the steps of the method described in the first aspect of the present disclosure.
通过上述技术方案,响应于接收到数据处理指令,获取待处理的第一目标数据,所述数据处理指令用于指示对所述第一目标数据执行目标处理策略;确定所述第一应用程序是否能够对所述第一目标数据执行所述目标处理策略;在确定所述第一应用程序不能对所述第一目标数据执行所述目标处理策略的情况下,确定能够执行所述目标处理策略的第二应用程序,所述第二应用程序与所述第一应用程序的编码方式不同;按照所述第二应用程序能够处理的第一数据格式,将所述第一目标数据转换为第二目标数据;通过所述第二应用程序对所述第二目标数据执行所述目标处理策略。也就是说,在第一应用程序不能对第一目标数据执行目标处理策略的情况下,按照第二应用程序能够处理的第一数据格式,对第一目标数据进行格式转换得到第二目标数据,通过第二应用程序对该第二目标数据执行目标处理策略,这样,无需重新定义框架,可以实现第一应用程序和第二应用程序之间相互通用,降低了实现难度。Through the above technical solution, in response to receiving a data processing instruction, the first target data to be processed is obtained, and the data processing instruction is used to instruct to execute a target processing policy on the first target data; determine whether the first application program capable of executing the target processing policy on the first target data; in a case where it is determined that the first application cannot execute the target processing policy on the first target data, determine that the target processing policy can be executed A second application program, the encoding method of the second application program is different from that of the first application program; according to the first data format that the second application program can process, the first target data is converted into a second target data; executing the target processing policy on the second target data by the second application program. That is to say, in the case that the first application program cannot execute the target processing policy on the first target data, according to the first data format that the second application program can process, the format conversion is performed on the first target data to obtain the second target data, The target processing strategy is executed on the second target data through the second application program, so that the mutual commonality between the first application program and the second application program can be realized without redefining the framework, and the implementation difficulty is reduced.
本公开的其他特征和优点将在随后的具体实施方式部分予以详细说明。Other features and advantages of the present disclosure will be described in detail in the detailed description that follows.
附图说明Description of drawings
结合附图并参考以下具体实施方式,本公开各实施例的上述和其他特征、优点及方面将变得更加明显。贯穿附图中,相同或相似的附图标记表示相同或相似的元素。应当理解附图是示意性的,原件和元素不一定按照比例绘制。在附图中:The above and other features, advantages and aspects of the various embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic and that elements and elements are not necessarily drawn to scale. In the attached picture:
图1是根据一示例性实施例示出的一种数据处理方法的流程图;Fig. 1 is a flowchart of a data processing method shown according to an exemplary embodiment;
图2是根据一示例性实施例示出的另一种数据处理方法的流程图;Fig. 2 is a flow chart showing another data processing method according to an exemplary embodiment;
图3是根据一示例性实施例示出的一种数据处理装置的框图;Fig. 3 is a block diagram of a data processing device according to an exemplary embodiment;
图4是根据一示例性实施例示出的第二种数据处理装置的框图;Fig. 4 is a block diagram of a second data processing device according to an exemplary embodiment;
图5是根据一示例性实施例示出的第三种数据处理装置的框图;Fig. 5 is a block diagram of a third data processing device according to an exemplary embodiment;
图6是根据一示例性实施例示出的第四种数据处理装置的框图;Fig. 6 is a block diagram of a fourth data processing device according to an exemplary embodiment;
图7是根据一示例性实施例示出的一种电子设备的框图。Fig. 7 is a block diagram of an electronic device according to an exemplary embodiment.
具体实施方式Detailed ways
下面将参照附图更详细地描述本公开的实施例。虽然附图中显示了本公开的某些实施例,然而应当理解的是,本公开可以通过各种形式来实现,而且不应该被解释为限于这里阐述的实施例,相反提供这些实施例是为了更加透彻和完整地理解本公开。应当理解的是,本公开的附图及实施例仅用于示例性作用,并非用于限制本公开的保护范围。Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the drawings, it should be understood that the disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein; A more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for exemplary purposes only, and are not intended to limit the protection scope of the present disclosure.
应当理解,本公开的方法实施方式中记载的各个步骤可以按照不同的顺序执行,和/或并行执行。此外,方法实施方式可以包括附加的步骤和/或省略执行示出的步骤。本公开的范围在此方面不受限制。It should be understood that the various steps described in the method implementations of the present disclosure may be executed in different orders, and/or executed in parallel. Additionally, method embodiments may include additional steps and/or omit performing illustrated steps. The scope of the present disclosure is not limited in this respect.
本文使用的术语“包括”及其变形是开放性包括,即“包括但不限于”。术语“基于”是“至少部分地基于”。术语“一个实施例”表示“至少一个实施例”;术语“另一实施例”表示“至少一个另外的实施例”;术语“一些实施例”表示“至少一些实施例”。其他术语的相关定义将在下文描述中给出。As used herein, the term "comprise" and its variations are open-ended, ie "including but not limited to". The term "based on" is "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one further embodiment"; the term "some embodiments" means "at least some embodiments." Relevant definitions of other terms will be given in the description below.
需要注意,本公开中提及的“第一”、“第二”等概念仅用于对不同的装置、模块或单元进行区分,并非用于限定这些装置、模块或单元所执行的功能的顺序或者相互依存关系。It should be noted that concepts such as "first" and "second" mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the sequence of functions performed by these devices, modules or units or interdependence.
需要注意,本公开中提及的“一个”、“多个”的修饰是示意性而非限制性的,本领域技术人员应当理解,除非在上下文另有明确指出,否则应该理解为“一个或多个”。It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative and not restrictive, and those skilled in the art should understand that unless the context clearly indicates otherwise, it should be understood as "one or more" multiple".
本公开实施方式中的多个装置之间所交互的消息或者信息的名称仅用于说明性的目的,而并不是用于对这些消息或信息的范围进行限制。The names of messages or information exchanged between multiple devices in the embodiments of the present disclosure are used for illustrative purposes only, and are not used to limit the scope of these messages or information.
首先,对本公开的应用场景进行说明。UDF功能可以让用户在查询中定义自己的函 数,而不是仅仅使用系统预设的函数,极大地提升了用户查询体验,扩展了查询引擎的查询功能。但是不同的查询引擎对UDF的支持各不相同,互相之间难以通用。这种不通用造成了用户难以在多个查询引擎之间复用他们的查询,甚至需要维护多个版本的UDF。虽然有一些查询引擎支持了运行其他查询引擎UDF的能力(例如Spark支持运行Hive UDF),但这是得益于它们语法相近,Presto的UDF是注解类型定义,和Hive UDF大不同相同。First, the application scenarios of the present disclosure are described. The UDF function allows users to define their own functions in the query, instead of just using the system preset functions, which greatly improves the user query experience and expands the query function of the query engine. However, different query engines support UDFs differently, and it is difficult to use them universally. This non-universality makes it difficult for users to reuse their queries between multiple query engines, and even needs to maintain multiple versions of UDF. Although some query engines support the ability to run other query engine UDFs (for example, Spark supports running Hive UDF), this is due to their similar syntax. Presto's UDF is an annotation type definition, which is quite different from Hive UDF.
由于历史原因,Hive诞生较早且应用广泛,绝大多数业界公司都大量使用了Hive,有大批Hive UDF在生产环境发挥重要作用。因此如何在Presto支持Hive UDF是一个技术难题,也极大影响了Presto查询引擎的扩展性和通用性。Due to historical reasons, Hive was born earlier and widely used. Most companies in the industry have used Hive extensively, and a large number of Hive UDFs play an important role in the production environment. Therefore, how to support Hive UDF in Presto is a technical problem, which also greatly affects the scalability and versatility of the Presto query engine.
相关技术中,通过定义一个新的UDF框架,用户在新的框架中重写一套UDF,以满足不同查询引擎的语法需求。但是,这种方式的工作量较大,用户需要熟悉新的框架语法,并将已有的UDF重新改写成新框架下的UDF,导致实现难度较大,可行性较差。In related technologies, by defining a new UDF framework, a user rewrites a set of UDFs in the new framework to meet the grammatical requirements of different query engines. However, this method requires a large amount of work, and users need to be familiar with the new framework syntax and rewrite existing UDFs into UDFs under the new framework, which makes implementation more difficult and less feasible.
为了解决上述技术问题,本公开提供一种数据处理方法、装置、可读介质及电子设备,在第一应用程序不能对第一目标数据执行目标处理策略的情况下,按照第二应用程序能够处理的第一数据格式,对第一目标数据进行格式转换得到第二目标数据,通过第二应用程序对该第二目标数据执行目标处理策略,这样,无需重新定义框架,可以实现第一应用程序和第二应用程序之间相互通用,降低了实现难度。In order to solve the above-mentioned technical problems, the present disclosure provides a data processing method, device, readable medium, and electronic device. When the first application program cannot execute the target processing policy on the first target data, the second application program can process of the first data format, convert the first target data to obtain the second target data, and execute the target processing strategy on the second target data through the second application program. In this way, the first application program and the The second application programs are common to each other, which reduces the difficulty of implementation.
下面结合具体实施例对本公开进行说明。The present disclosure will be described below in combination with specific embodiments.
图1是根据一示例性实施例示出的一种数据处理方法的流程图,该方法应用于第一应用程序,该第一应用程序可以是数据查询工具,例如Presto查询引擎,也可以是数据处理工具,本公开对此不作限定。本公开实施例中以该第一应用程序为数据查询工具为例进行说明;该方法可以包括:Fig. 1 is a flow chart of a data processing method shown according to an exemplary embodiment, the method is applied to a first application program, and the first application program may be a data query tool, such as a Presto query engine, or may be a data processing tool, which is not limited in the present disclosure. In the embodiment of the present disclosure, the first application program is used as an example for illustration; the method may include:
S101、响应于接收到数据处理指令,获取待处理的第一目标数据。S101. Acquire first target data to be processed in response to receiving a data processing instruction.
其中,该数据处理指令可以用于指示对该第一目标数据执行目标处理策略,示例地,该数据处理指令可以是SQL(Structured Query Language,结构化查询语言)语句。Wherein, the data processing instruction may be used to instruct to execute the target processing policy on the first target data, for example, the data processing instruction may be a SQL (Structured Query Language, Structured Query Language) statement.
在本步骤中,在接收到用户触发的数据处理指令后,可以根据该数据处理指令,获取待处理的第一目标数据。示例地,若该数据处理指令为SQL语句,则可以根据该SQL语句,从预设数据库中获取该第一目标数据,例如,在该SQL语句为“select avg(col)from table”的情况下,该第一目标数据可以是table中的每一行数据。In this step, after receiving the data processing instruction triggered by the user, the first target data to be processed may be acquired according to the data processing instruction. Exemplarily, if the data processing instruction is an SQL statement, the first target data can be obtained from a preset database according to the SQL statement, for example, in the case where the SQL statement is "select avg(col) from table" , the first target data may be each row of data in the table.
S102、确定该第一应用程序是否能够对该第一目标数据执行该目标处理策略。S102. Determine whether the first application program can execute the target processing policy on the first target data.
在本步骤中,在获取该第一目标数据后,可以根据该数据处理指令确定对该第一目 标数据执行的目标处理策略,示例地,继续以该数据处理指令为“select avg(col)from table”进行说明,则该目标处理策略为求平均值。进一步地,在确定该目标处理策略后,可以确定该第一应用程序是否能够对该第一目标数据执行该目标处理策略。In this step, after the first target data is acquired, the target processing strategy to be executed on the first target data can be determined according to the data processing instruction. For example, continue to use the data processing instruction as "select avg(col) from table” for description, then the target processing strategy is averaging. Further, after the target processing policy is determined, it may be determined whether the first application program can execute the target processing policy on the first target data.
在一种可能的实现方式中,可以确定该第一应用程序是否包括第一目标函数,该第一目标函数用于执行该目标处理策略,在确定该第一应用程序包括该第一目标函数的情况下,确定该第一应用程序能够执行该目标处理策略;在确定该第一应用程序不包括该第一目标函数的情况下,确定该第一应用程序不能执行该目标处理策略。示例地,继续以该数据处理指令为“select avg(col)from table”进行说明,该第一目标函数可以是获取平均值的函数,在确定该第一应用程序中包括获取平均值的函数的情况下,可以确定该第一应用程序能够执行该目标处理策略,在确定该第一应用程序中不包括获取平均值的函数的情况下,可以确定该第一应用程序不能执行该目标处理策略。In a possible implementation manner, it may be determined whether the first application program includes a first objective function, and the first objective function is used to execute the target processing strategy. After determining that the first application program includes the first objective function, In this case, it is determined that the first application program can execute the target processing policy; when it is determined that the first application program does not include the first target function, it is determined that the first application program cannot execute the target processing policy. As an example, continue to use the data processing instruction as "select avg (col) from table" for description, the first objective function may be a function of obtaining the average value, and the first application program includes the function of obtaining the average value In some cases, it may be determined that the first application program can execute the target processing strategy, and in a case where it is determined that the first application program does not include a function for obtaining an average value, it may be determined that the first application program cannot execute the target processing strategy.
S103、在确定该第一应用程序不能对该第一目标数据执行该目标处理策略的情况下,确定能够执行该目标处理策略的第二应用程序。S103. In a case where it is determined that the first application program cannot execute the target processing policy on the first target data, determine a second application program capable of executing the target processing policy.
其中,该第二应用程序可以与该第一应用程序的编码方式不同,示例地,若该第一应用程序为Presto查询引擎,则该第二应用程序可以是Hive查询引擎。Wherein, the encoding method of the second application program may be different from that of the first application program. For example, if the first application program is a Presto query engine, then the second application program may be a Hive query engine.
在本步骤中,在确定该第一应用程序不能对该第一目标数据执行该目标处理策略的情况下,可以从多个预设应用程序中确定能够执行该目标处理策略的第二应用程序,其中,该多个预设应用程序可以是与该第一应用程序功能相同但编码方式不同的应用程序,示例地,若该第一应用程序为Presto查询引擎,则该预设应用程序可以是现有技术的其它查询引擎。需要说明的是,在该预设应用程序包括一个应用程序的情况下,可以将该预设应用程序作为该第二应用程序。In this step, when it is determined that the first application program cannot execute the target processing strategy for the first target data, a second application program capable of executing the target processing strategy may be determined from a plurality of preset application programs, Wherein, the plurality of preset applications may be applications with the same functions as the first application but with different coding methods. For example, if the first application is the Presto query engine, the preset applications may be existing Other query engines are available. It should be noted that, in a case where the preset application program includes one application program, the preset application program may be used as the second application program.
S104、按照该第二应用程序能够处理的第一数据格式,将该第一目标数据转换为第二目标数据。S104. Convert the first target data into second target data according to the first data format that can be processed by the second application program.
在本步骤中,该第二应用程序与该第一应用程序的编码方式不同,通过该第二应用程序无法直接对该第一目标数据执行该目标处理策略,在确定能够执行该目标处理策略的第二应用程序后,可以获取该第二应用程序能够处理的第一数据格式,示例地,继续以该数据处理指令为“select avg(col)from table”进行说明,可以将该第二应用程序中用于获取平均值的函数的参数对应的类型作为该第一数据格式,之后,可以按照该第一数据格式,将该第一目标数据转换为第二目标数据。In this step, the coding method of the second application program is different from that of the first application program, and the second application program cannot directly execute the target processing strategy on the first target data. After determining that the target processing strategy can be executed After the second application program, the first data format that the second application program can process can be obtained. For example, continue to use the data processing instruction as "select avg(col) from table" for illustration, the second application program can The type corresponding to the parameter of the function used to obtain the average value is used as the first data format, and then the first target data can be converted into the second target data according to the first data format.
S105、通过该第二应用程序对该第二目标数据执行该目标处理策略。S105. Execute the target processing policy on the second target data through the second application program.
在本步骤中,在将该第一目标数据转换为该第二目标数据后,可以调用该第二应用 程序中对应的函数,对该第二目标数据执行该目标处理策略。In this step, after converting the first target data into the second target data, the corresponding function in the second application program can be called to execute the target processing strategy on the second target data.
进一步地,在通过该第二应用程序对该第二目标数据执行该目标处理策略后,可以按照该第一应用程序能够处理的第二数据格式,将第一处理结果转换为第二处理结果,并输出该第二处理结果,该第一处理结果为通过该第二应用程序对该第二目标数据执行该目标处理策略的结果。Further, after executing the target processing policy on the second target data through the second application program, the first processing result may be converted into a second processing result according to the second data format that the first application program can process, And outputting the second processing result, the first processing result is the result of executing the target processing strategy on the second target data through the second application program.
采用上述方法,在第一应用程序不能对第一目标数据执行目标处理策略的情况下,按照第二应用程序能够处理的第一数据格式,对第一目标数据进行格式转换得到第二目标数据,通过第二应用程序对该第二目标数据执行目标处理策略,这样,无需重新定义框架,可以实现第一应用程序和第二应用程序之间相互通用,降低了实现难度。Using the above method, in the case that the first application program cannot execute the target processing policy on the first target data, according to the first data format that the second application program can process, the format conversion of the first target data is performed to obtain the second target data, The target processing strategy is executed on the second target data through the second application program, so that the mutual commonality between the first application program and the second application program can be realized without redefining the framework, and the implementation difficulty is reduced.
图2是根据一示例性实施例示出的另一种数据处理方法的流程图,该方法可以包括:Fig. 2 is a flowchart of another data processing method shown according to an exemplary embodiment, the method may include:
S201、响应于接收到数据处理指令,获取待处理的第一目标数据。S201. Acquire first target data to be processed in response to receiving a data processing instruction.
其中,该数据处理指令可以用于指示对该第一目标数据执行目标处理策略,示例地,该数据处理指令可以是SQL(Structured Query Language,结构化查询语言)语句。Wherein, the data processing instruction may be used to instruct to execute the target processing policy on the first target data, for example, the data processing instruction may be a SQL (Structured Query Language, Structured Query Language) statement.
S202、确定该第一应用程序是否包括第一目标函数,在确定该第一应用程序包括该第一目标函数的情况下,执行步骤S203,在确定该第一应用程序不包括该第一目标函数的情况下,执行步骤S204~步骤S208。S202. Determine whether the first application program includes the first objective function. If it is determined that the first application program includes the first objective function, perform step S203. After determining that the first application program does not include the first objective function In the case of , execute steps S204 to S208.
其中,该第一目标函数可以用于执行该目标处理策略。Wherein, the first objective function may be used to implement the objective processing strategy.
在本步骤中,在获取该第一目标数据后,可以根据该数据处理指令确定对该第一目标数据执行的目标处理策略,示例地,若该第一应用程序为Presto查询引擎,该数据处理指令为SQL语句,则可以对该SQL语句进行解析,确定该SQL语句对应的第一目标函数,该第一目标函数可以包括多个,之后,可以在该Presto查询引擎的内置函数中查找该第一目标函数。例如,若该SQL语句为“select avg(col)from table”,则可以确定该第一目标函数为获取平均值的函数,之后,可以在该Presto查询引擎的内置函数中查找获取平均值的函数。In this step, after the first target data is acquired, the target processing strategy for the first target data can be determined according to the data processing instruction. For example, if the first application program is a Presto query engine, the data processing If the instruction is an SQL statement, the SQL statement can be parsed to determine the first objective function corresponding to the SQL statement. The first objective function can include multiple. Afterwards, the first objective function can be searched in the built-in functions of the Presto query engine. an objective function. For example, if the SQL statement is "select avg(col) from table", it can be determined that the first objective function is the function for obtaining the average value, and then the function for obtaining the average value can be found in the built-in functions of the Presto query engine .
若在该Presto查询引擎的内置函数中查找到该第一目标函数,则表示该Presto查询引擎能够对该第一目标数据执行该目标处理策略,若在该Presto查询引擎的内置函数中未查找到该第一目标函数,则表示该Presto查询引擎不能对该第一目标数据执行该目标处理策略。If the first target function is found in the built-in functions of the Presto query engine, it means that the Presto query engine can execute the target processing strategy for the first target data; if it is not found in the built-in functions of the Presto query engine The first objective function means that the Presto query engine cannot execute the objective processing strategy on the first objective data.
S203、确定该第一应用程序能够对该第一目标数据执行该目标处理策略,并通过该第一应用程序对该第一目标数据执行该目标处理策略。S203. Determine that the first application program can execute the target processing policy on the first target data, and execute the target processing policy on the first target data through the first application program.
S204、确定该第一应用程序不能对该第一目标数据执行该目标处理策略。S204. Determine that the first application program cannot execute the target processing policy on the first target data.
S205、将多个预设应用程序中包括第二目标函数的预设应用程序,作为该第二应用程序。S205. Using a preset application program including the second objective function among the plurality of preset application programs as the second application program.
其中,该多个预设应用程序可以是与该第一应用程序功能相同但编码方式不同的应用程序,示例地,若该第一应用程序为Presto查询引擎,则该预设应用程序可以是现有技术的其它查询引擎;该第二目标函数用于执行该目标处理策略。Wherein, the plurality of preset applications may be applications with the same functions as the first application but with different coding methods. For example, if the first application is the Presto query engine, the preset applications may be existing Other query engines of the art; the second objective function is used to implement the objective processing strategy.
在本步骤中,在确定该第一应用程序不能对该第一目标数据执行该目标处理策略的情况下,可以从多个预设应用程序中查找能够对该第一目标数据执行该目标处理策略的第二应用程序。在一种可能的实现方式中,可以依次在多个预设应用程序中查找第二目标函数,将第一个包括该第二目标函数的预设应用程序作为该第二应用程序。In this step, if it is determined that the first application program cannot execute the target processing strategy for the first target data, it may be searched from a plurality of preset application programs that can execute the target processing strategy for the first target data. of the second application. In a possible implementation manner, the second objective function may be searched in sequence among multiple preset application programs, and the first preset application program including the second objective function is used as the second application program.
需要说明的是,由于不同预设应用程序的编码方式不同,因此,不同预设应用程序对应的第二目标函数也可以不同。It should be noted that, since different preset application programs have different encoding methods, the second objective functions corresponding to different preset application programs may also be different.
S206、按照该第二应用程序的第二目标函数能够处理的第一数据格式,将该第一目标数据转换为该第二目标数据。S206. Convert the first target data into the second target data according to the first data format that can be processed by the second target function of the second application program.
其中,该第一数据格式可以是该第二目标函数的参数类型。Wherein, the first data format may be a parameter type of the second objective function.
在本步骤中,在确定该第二应用程序后,可以确定该第二应用程序的第二目标函数的参数类型,根据该参数类型,将该第一目标函数转换为第二目标函数。In this step, after the second application program is determined, the parameter type of the second objective function of the second application program may be determined, and the first objective function is converted into the second objective function according to the parameter type.
在一种可能的实现方式中,在按照该第二应用程序的第二目标函数能够处理的第一数据格式,将该第一目标数据转换为该第二目标数据前,可以先确定该第一应用程序是否缓存该第二应用程序的第二目标函数对应的目标资源包,在确定该第一应用程序缓存该第二应用程序的第二目标函数对应的目标资源包的情况下,按照该第二应用程序的第二目标函数能够处理的第一数据格式,将该第一目标数据转换为该第二目标数据。In a possible implementation manner, before converting the first target data into the second target data according to the first data format that can be processed by the second target function of the second application program, the first Whether the application program caches the target resource package corresponding to the second target function of the second application program, if it is determined that the first application program caches the target resource package corresponding to the second target function of the second application program, according to the first The second target function of the application program can process the first data format, and convert the first target data into the second target data.
示例地,可以根据预先设置的该第二目标函数对应的资源信息,确定该第一应用程序对应的本地服务器中是否缓存该第二目标函数,在该第一应用程序对应的本地服务器中缓存该第二目标函数的情况下,可以直接按照该第二应用程序的第二目标函数能够处理的第一数据格式,将该第一目标数据转换为该第二目标数据。其中,该资源信息可以包括资源地址、类名、参数类型、返回类型、创建时间、修改时间等。For example, according to the preset resource information corresponding to the second objective function, it may be determined whether the second objective function is cached in the local server corresponding to the first application program, and the local server corresponding to the first application program is cached in the local server corresponding to the first application program. In the case of the second target function, the first target data may be directly converted into the second target data according to the first data format that can be processed by the second target function of the second application program. Wherein, the resource information may include resource address, class name, parameter type, return type, creation time, modification time and so on.
需要说明的是,也可以确定该第一应用程序的进程是否已经加载该第二目标函数对应的目标资源包,在该第一应用程序的进程已经加载该第二目标函数对应的目标资源包的情况下,表示该第一应用程序缓存该第二目标函数对应的目标资源包。It should be noted that, it may also be determined whether the process of the first application program has loaded the target resource package corresponding to the second target function, when the process of the first application program has loaded the target resource package corresponding to the second target function In this case, it means that the first application caches the target resource bundle corresponding to the second target function.
在确定该第一应用程序未缓存该第二应用程序的第二目标函数对应的目标资源包的情况下,可以从该第二应用程序对应的服务器获取该目标资源包,加载该目标资源包, 并在该目标资源包加载完成后,按照该第二应用程序的第二目标函数能够处理的第一数据格式,将该第一目标数据转换为该第二目标数据。When it is determined that the first application program does not cache the target resource package corresponding to the second target function of the second application program, the target resource package may be obtained from a server corresponding to the second application program, and the target resource package may be loaded, And after the target resource package is loaded, convert the first target data into the second target data according to the first data format that can be processed by the second target function of the second application program.
示例地,可以根据预先设置的该第二目标函数对应的资源地址,从该第二应用程序对应的服务器获取该目标资源包,将该目标资源包下载至该第一应用程序对应的本地服务器,之后,可以通过该第一应用程序的进程加载该目标资源包,在该目标资源包加载完成后,可以按照该第二目标函数对应的参数类型,将该第一目标数据转换为该第二目标数据。For example, according to the preset resource address corresponding to the second target function, the target resource package can be obtained from the server corresponding to the second application program, and the target resource package can be downloaded to the local server corresponding to the first application program, Afterwards, the target resource pack can be loaded through the process of the first application program, and after the target resource pack is loaded, the first target data can be converted into the second target according to the parameter type corresponding to the second target function data.
需要说明的是,在该目标资源包加载完成后,可以存储该目标资源包的资源信息和版本信息,这样,在后续确定该第一应用程序缓存该第二目标函数的情况下,可以进一步根据该第二目标函数对应的目标资源包的资源信息和版本信息,确定是否需要获取并加载新的目标资源包。It should be noted that after the target resource package is loaded, the resource information and version information of the target resource package can be stored. In this way, when it is subsequently determined that the first application program caches the second target function, it can be further processed according to The resource information and version information of the target resource package corresponding to the second target function determine whether a new target resource package needs to be acquired and loaded.
另外,在按照该第二应用程序的第二目标函数能够处理的第一数据格式,将该第一目标数据转换为该第二目标数据前,可以执行该第二应用程序中的第二目标函数对应的初始化方法,获取该第二目标函数能够支持的全部数据类型,之后,可以确定该第一应用程序是否能够按照该第一数据格式对该第一目标数据进行格式转换。若该第一应用程序能够按照该第一数据格式对该第一目标数据进行格式转换,则按照该第二应用程序的第二目标函数能够处理的第一数据格式,将该第一目标数据转换为该第二目标数据;若该第一应用程序不能按照该第一数据格式对该第一目标数据进行格式转换,则输出异常提示信息。In addition, before converting the first target data into the second target data according to the first data format that can be processed by the second target function of the second application program, the second target function in the second application program can be executed The corresponding initialization method obtains all data types supported by the second target function, and then determines whether the first application program can perform format conversion on the first target data according to the first data format. If the first application program can perform format conversion on the first target data according to the first data format, convert the first target data according to the first data format that can be processed by the second target function of the second application program is the second target data; if the first application program cannot perform format conversion on the first target data according to the first data format, then output abnormal prompt information.
S207、通过该第二目标函数对该第二目标数据执行该目标处理策略。S207. Execute the target processing policy on the second target data by using the second target function.
其中,该第二目标数据可以包括多个,示例地,若该数据处理指令为“select avg(col)from table”,则该第一目标数据可以是table中的每一行数据,该第二目标数据包括按照该第一数据格式对table中每一行数据进行格式转换后的数据。该第二目标函数可以包括第一函数、第二函数以及第三函数,示例地,该第二目标函数可以是UDAF(User Defined Aggregate Function,用户自定义聚合函数)。Wherein, the second target data may include multiple data. For example, if the data processing instruction is "select avg(col) from table", the first target data may be each row of data in the table, and the second target data The data includes data obtained by converting the format of each row of data in the table according to the first data format. The second objective function may include a first function, a second function, and a third function. For example, the second objective function may be a UDAF (User Defined Aggregate Function, user-defined aggregate function).
在本步骤中,在将该第一目标数据转换为该第二目标数据后,可以通过该第一应用程序的第一预设函数调用该第一函数,以通过该第一函数分别处理多个第二目标数据,得到多个第一数据;通过该第一应用程序的第二预设函数调用该第二函数,以通过该第二函数对多个第一数据进行聚合处理,得到多个第二数据;通过该第一应用程序的第三预设函数调用该第三函数,以通过该第三函数处理多个第二数据。In this step, after converting the first target data into the second target data, the first function can be called through the first preset function of the first application program, so as to process multiple The second target data is to obtain a plurality of first data; the second function is called through the second preset function of the first application program, so that the plurality of first data is aggregated through the second function to obtain a plurality of first data second data; calling the third function through a third preset function of the first application program, so as to process a plurality of second data through the third function.
示例地,该第一函数可以是iterate函数,该第二函数可以是merge函数,该第三函 数可以是terminate函数,可以预先在该第一预设函数中增加对该第一函数的调用,在该第二预设函数中增加对该第二函数的调用,在该第三预设函数中增加对该第三函数的调用。其中,该iterate函数可以包括多个,不同的iterate函数可以运行在不同服务器,得到的多个第一数据也位于不同的服务器。该第一应用程序在调用该iterate函数时,将该第二目标数据作为该iterate函数的输入参数,通过多个iterate函数分别对该第二目标数据进行处理,得到多个第一数据。For example, the first function may be an iterate function, the second function may be a merge function, and the third function may be a terminate function, and a call to the first function may be added to the first preset function in advance, and the A call to the second function is added to the second preset function, and a call to the third function is added to the third preset function. Wherein, the iterate function may include multiple ones, different iterate functions may run on different servers, and the obtained multiple first data are also located on different servers. When the first application program calls the iterate function, the second target data is used as an input parameter of the iterate function, and the second target data is respectively processed by a plurality of iterate functions to obtain a plurality of first data.
进一步地,在得到多个第一数据后,可以通过第二预设函数调用该merge函数,将该第一数据作为该merge函数的输入参数,通过该merge函数对多个第一数据进行聚合,即将该第一数据发送至同一服务器,得到多个第二数据。其中,该merge函数可以包括多个,不同的merge函数可以运行在不同服务器。Further, after obtaining a plurality of first data, the merge function may be called through a second preset function, the first data may be used as an input parameter of the merge function, and the plurality of first data may be aggregated through the merge function, That is, sending the first data to the same server to obtain multiple second data. Wherein, the merge function may include multiple, and different merge functions may run on different servers.
最后,通过该第三预设函数调用该terminate函数,将多个第二数据作为该terminate函数的输入参数,通过该terminate函数对多个第二数据执行最后的处理流程。Finally, the terminate function is called through the third preset function, the plurality of second data are used as input parameters of the terminate function, and the final processing flow is executed on the plurality of second data through the terminate function.
需要说明的是,上述第一函数、第二函数以及第三函数只是举例说明,该第一函数、该第二函数以及该第三函数也可以是执行其它策略的函数,本公开对此不作限定。并且,该第一预设函数、该第二预设函数以及该第三预设函数可以是该第一应用程序中现有的函数,也可以是在该第一应用程序中新增的函数,本公开对此不作限定。It should be noted that the above-mentioned first function, second function, and third function are just examples, and the first function, the second function, and the third function may also be functions that execute other strategies, which are not limited in this disclosure . Moreover, the first preset function, the second preset function, and the third preset function may be existing functions in the first application program, or newly added functions in the first application program, This disclosure does not limit it.
S208、按照该第一应用程序能够处理的第二数据格式,将第一处理结果转换为第二处理结果,并输出该第二处理结果。S208. Convert the first processing result into a second processing result according to the second data format that can be processed by the first application program, and output the second processing result.
其中,该第一处理结果可以时通过该第二应用程序的第二目标函数对该第二目标数据执行该目标处理策略的结果。Wherein, the first processing result may be a result of executing the target processing policy on the second target data through the second target function of the second application program.
在本步骤中,在得到该第一处理结果后,可以将该第一预设函数的返回值的类型作为该第二数据格式,将该第一处理结果转换为该第二处理结果,并输出该第二处理结果。需要说明的是,在将该第一处理结果转换为该第二处理结果后,也可以根据该第二处理结果执行后续处理流程,本公开对此不作限定。In this step, after obtaining the first processing result, the type of the return value of the first preset function can be used as the second data format, the first processing result can be converted into the second processing result, and output The second processing result. It should be noted that, after converting the first processing result into the second processing result, subsequent processing procedures may also be executed according to the second processing result, which is not limited in the present disclosure.
采用上述方法,在第一应用程序不能对第一目标数据执行目标处理策略的情况下,按照第二应用程序能够处理的第一数据格式,对第一目标数据进行格式转换得到第二目标数据,通过第二应用程序对该第二目标数据执行目标处理策略,这样,无需重新定义框架,可以实现第一应用程序和第二应用程序之间相互通用,降低了实现难度;进一步地,在该第二目标数据包括多个的情况下,可以通过多个函数对该第二目标数据进行聚合处理,这样,能够实现该第一应用程序和该第二应用程序中UDAF函数的相互通用,扩大了第一应用程序和第二应用程序的使用场景,提高了用户体验。Using the above method, in the case that the first application program cannot execute the target processing policy on the first target data, according to the first data format that the second application program can process, the format conversion of the first target data is performed to obtain the second target data, Through the second application program to implement the target processing strategy for the second target data, in this way, without redefining the framework, the mutual commonality between the first application program and the second application program can be realized, which reduces the difficulty of implementation; further, in the first application program In the case that the second target data includes multiple cases, the second target data can be aggregated through multiple functions, so that the mutual use of the UDAF functions in the first application program and the second application program can be realized, expanding the scope of the first application program. The usage scenarios of the first application program and the second application program improve the user experience.
图3是根据一示例性实施例示出的一种数据处理装置的框图,该装置应用于第一应用程序,如图3所示,包括:Fig. 3 is a block diagram of a data processing device according to an exemplary embodiment, the device is applied to a first application program, as shown in Fig. 3 , including:
数据获取模块301,用于响应于接收到数据处理指令,获取待处理的第一目标数据,该数据处理指令用于指示对该第一目标数据执行目标处理策略;A data acquisition module 301, configured to acquire first target data to be processed in response to receiving a data processing instruction, where the data processing instruction is used to instruct execution of a target processing policy on the first target data;
执行确定模块302,用于确定该第一应用程序是否能够对该第一目标数据执行该目标处理策略;an execution determining module 302, configured to determine whether the first application program can execute the target processing policy on the first target data;
应用程序确定模块303,用于在确定该第一应用程序不能对该第一目标数据执行该目标处理策略的情况下,确定能够执行该目标处理策略的第二应用程序,该第二应用程序与该第一应用程序的编码方式不同;An application program determining module 303, configured to determine a second application program capable of executing the target processing policy when it is determined that the first application program cannot execute the target processing policy for the first target data, and the second application program is related to the the first application is coded differently;
第一格式转换模块304,用于按照该第二应用程序能够处理的第一数据格式,将该第一目标数据转换为第二目标数据;The first format conversion module 304 is configured to convert the first target data into second target data according to the first data format that the second application program can process;
策略执行模块305,用于通过该第二应用程序对该第二目标数据执行该目标处理策略。A policy execution module 305, configured to execute the target processing policy on the second target data through the second application program.
可选地,该执行确定模块302,还用于:Optionally, the execution determining module 302 is also used to:
确定该第一应用程序是否包括第一目标函数,该第一目标函数用于执行该目标处理策略;determining whether the first application program includes a first objective function for implementing the objective processing policy;
在确定该第一应用程序包括该第一目标函数的情况下,确定该第一应用程序能够对该第一目标数据执行该目标处理策略;In a case where it is determined that the first application program includes the first target function, determining that the first application program is capable of executing the target processing policy on the first target data;
在确定该第一应用程序不包括该第一目标函数的情况下,确定该第一应用程序不能对该第一目标数据执行该目标处理策略。In a case where it is determined that the first application program does not include the first target function, it is determined that the first application program cannot execute the target processing policy on the first target data.
可选地,该应用程序确定模块303,还用于:Optionally, the application program determination module 303 is also used to:
将多个预设应用程序中包括第二目标函数的预设应用程序,作为该第二应用程序,该第二目标函数用于执行该目标处理策略。A preset application program including a second objective function among the plurality of preset application programs is used as the second application program, and the second objective function is used to execute the target processing strategy.
可选地,该第一格式转换模块304,还用于:Optionally, the first format conversion module 304 is also used for:
按照该第二应用程序的第二目标函数能够处理的第一数据格式,将该第一目标数据转换为该第二目标数据;converting the first target data into the second target data according to the first data format that can be processed by the second target function of the second application program;
该通过该第二应用程序对该第二目标数据执行该目标处理策略包括:Executing the target processing policy on the second target data through the second application program includes:
通过该第二目标函数对该第二目标数据执行该目标处理策略。The target processing strategy is executed on the second target data by the second target function.
可选地,图4是根据一示例性实施例示出的第二种数据处理装置的框图,如图4所示,该装置还包括:Optionally, FIG. 4 is a block diagram of a second data processing device according to an exemplary embodiment. As shown in FIG. 4 , the device further includes:
缓存确定模块306,用于确定该第一应用程序是否缓存该第二应用程序的第二目标 函数对应的目标资源包;A cache determination module 306, configured to determine whether the first application program caches the target resource bundle corresponding to the second target function of the second application program;
该第一格式转换模块304,还用于:The first format conversion module 304 is also used for:
在确定该第一应用程序缓存该第二应用程序的第二目标函数对应的目标资源包的情况下,按照该第二应用程序的第二目标函数能够处理的第一数据格式,将该第一目标数据转换为该第二目标数据。When it is determined that the first application program caches the target resource bundle corresponding to the second target function of the second application program, according to the first data format that the second target function of the second application program can handle, the first The target data is converted into the second target data.
可选地,图5是根据一示例性实施例示出的第三种数据处理装置的框图,如图5所示,该装置还包括:Optionally, FIG. 5 is a block diagram of a third data processing device according to an exemplary embodiment. As shown in FIG. 5 , the device further includes:
资源包获取模块307,用于在确定该第一应用程序未缓存该第二应用程序的第二目标函数对应的目标资源包的情况下,从该第二应用程序对应的服务器获取该目标资源包;A resource package acquiring module 307, configured to acquire the target resource package from the server corresponding to the second application program when it is determined that the first application program has not cached the target resource package corresponding to the second target function of the second application program ;
资源包加载模块308,用于加载该目标资源包;A resource pack loading module 308, configured to load the target resource pack;
该第一格式转换模块304,还用于在该目标资源包加载完成后,按照该第二应用程序的第二目标函数能够处理的第一数据格式,将该第一目标数据转换为该第二目标数据。The first format converting module 304 is further configured to convert the first target data into the second target data.
可选地,该第二目标数据包括多个,该第二目标函数包括第一函数、第二函数以及第三函数;策略执行模块305,还用于:Optionally, the second target data includes multiple, the second target function includes a first function, a second function, and a third function; the policy execution module 305 is also used for:
通过该第一应用程序的第一预设函数调用该第一函数,以通过该第一函数分别处理多个该第二目标数据,得到多个第一数据;calling the first function through a first preset function of the first application program, so as to process a plurality of second target data respectively through the first function to obtain a plurality of first data;
通过该第一应用程序的第二预设函数调用该第二函数,以通过该第二函数对多个该第一数据进行聚合处理,得到多个第二数据;calling the second function through the second preset function of the first application program, so as to aggregate the plurality of first data through the second function to obtain a plurality of second data;
通过该第一应用程序的第三预设函数调用该第三函数,以通过该第三函数处理多个该第二数据。calling the third function through a third preset function of the first application program, so as to process a plurality of the second data through the third function.
可选地,图6是根据一示例性实施例示出的第四种数据处理装置的框图,如图6所示,该装置还包括:Optionally, FIG. 6 is a block diagram of a fourth data processing device according to an exemplary embodiment. As shown in FIG. 6, the device further includes:
第二格式转换模块309,用于按照该第一应用程序能够处理的第二数据格式,将第一处理结果转换为第二处理结果,并输出该第二处理结果,该第一处理结果为通过该第二应用程序对该第二目标数据执行该目标处理策略的结果。The second format conversion module 309 is configured to convert the first processing result into a second processing result according to the second data format that the first application program can process, and output the second processing result, and the first processing result is passed A result of the second application executing the target processing policy on the second target data.
通过上述装置,在第一应用程序不能对第一目标数据执行目标处理策略的情况下,按照第二应用程序能够处理的第一数据格式,对第一目标数据进行格式转换得到第二目标数据,通过第二应用程序对该第二目标数据执行目标处理策略,这样,无需重新定义框架,可以实现第一应用程序和第二应用程序之间相互通用,降低了实现难度。With the above device, in the case that the first application program cannot execute the target processing policy on the first target data, the first target data is format-converted according to the first data format that the second application program can process to obtain the second target data, The target processing strategy is executed on the second target data through the second application program, so that the mutual commonality between the first application program and the second application program can be realized without redefining the framework, and the implementation difficulty is reduced.
下面参考图7,其示出了适于用来实现本公开实施例的电子设备700的结构示意图。本公开实施例中的终端设备可以包括但不限于诸如移动电话、笔记本电脑、数字广播接 收器、PDA(个人数字助理)、PAD(平板电脑)、PMP(便携式多媒体播放器)、车载终端(例如车载导航终端)等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。图7示出的电子设备仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。Referring now to FIG. 7 , it shows a schematic structural diagram of an electronic device 700 suitable for implementing the embodiments of the present disclosure. The terminal equipment in the embodiment of the present disclosure may include but not limited to such as mobile phone, notebook computer, digital broadcast receiver, PDA (personal digital assistant), PAD (tablet computer), PMP (portable multimedia player), vehicle terminal (such as mobile terminals such as car navigation terminals) and fixed terminals such as digital TVs, desktop computers and the like. The electronic device shown in FIG. 7 is only an example, and should not limit the functions and application scope of the embodiments of the present disclosure.
如图7所示,电子设备700可以包括处理装置(例如中央处理器、图形处理器等)701,其可以根据存储在只读存储器(ROM)702中的程序或者从存储装置708加载到随机访问存储器(RAM)703中的程序而执行各种适当的动作和处理。在RAM 703中,还存储有电子设备700操作所需的各种程序和数据。处理装置701、ROM 702以及RAM 703通过总线704彼此相连。输入/输出(I/O)接口705也连接至总线704。As shown in FIG. 7 , an electronic device 700 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) Various appropriate actions and processes are executed by programs in the memory (RAM) 703 . In the RAM 703, various programs and data necessary for the operation of the electronic device 700 are also stored. The processing device 701, ROM 702, and RAM 703 are connected to each other through a bus 704. An input/output (I/O) interface 705 is also connected to the bus 704 .
通常,以下装置可以连接至I/O接口705:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置706;包括例如液晶显示器(LCD)、扬声器、振动器等的输出装置707;包括例如磁带、硬盘等的存储装置708;以及通信装置709。通信装置709可以允许电子设备700与其他设备进行无线或有线通信以交换数据。虽然图7示出了具有各种装置的电子设备700,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。Typically, the following devices can be connected to the I/O interface 705: input devices 706 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; including, for example, a liquid crystal display (LCD), speaker, vibration an output device 707 such as a computer; a storage device 708 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 709. The communication means 709 may allow the electronic device 700 to communicate with other devices wirelessly or by wire to exchange data. While FIG. 7 shows electronic device 700 having various means, it should be understood that implementing or having all of the means shown is not a requirement. More or fewer means may alternatively be implemented or provided.
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在非暂态计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置709从网络上被下载和安装,或者从存储装置708被安装,或者从ROM 702被安装。在该计算机程序被处理装置701执行时,执行本公开实施例的方法中限定的上述功能。In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product, which includes a computer program carried on a non-transitory computer readable medium, where the computer program includes program code for executing the method shown in the flowchart. In such an embodiment, the computer program may be downloaded and installed from a network via communication means 709, or from storage means 708, or from ROM 702. When the computer program is executed by the processing device 701, the above-mentioned functions defined in the methods of the embodiments of the present disclosure are executed.
需要说明的是,本公开上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信 号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。It should be noted that the above-mentioned computer-readable medium in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. A computer readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer diskettes, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present disclosure, however, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave carrying computer-readable program code therein. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can transmit, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device . Program code embodied on a computer readable medium may be transmitted by any appropriate medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
在一些实施方式中,客户端、服务器可以利用诸如HTTP(HyperText Transfer Protocol,超文本传输协议)之类的任何当前已知或未来研发的网络协议进行通信,并且可以与任意形式或介质的数字数据通信(例如,通信网络)互连。通信网络的示例包括局域网(“LAN”),广域网(“WAN”),网际网(例如,互联网)以及端对端网络(例如,ad hoc端对端网络),以及任何当前已知或未来研发的网络。In some embodiments, the client and the server can communicate using any currently known or future network protocols such as HTTP (HyperText Transfer Protocol, Hypertext Transfer Protocol), and can communicate with digital data in any form or medium The communication (eg, communication network) interconnections. Examples of communication networks include local area networks ("LANs"), wide area networks ("WANs"), internetworks (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network of.
上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。The above-mentioned computer-readable medium may be included in the above-mentioned electronic device, or may exist independently without being incorporated into the electronic device.
上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备:响应于接收到数据处理指令,获取待处理的第一目标数据,所述数据处理指令用于指示对所述第一目标数据执行目标处理策略;确定所述第一应用程序是否能够对所述第一目标数据执行所述目标处理策略;在确定所述第一应用程序不能对所述第一目标数据执行所述目标处理策略的情况下,确定能够执行所述目标处理策略的第二应用程序,所述第二应用程序与所述第一应用程序的编码方式不同;按照所述第二应用程序能够处理的第一数据格式,将所述第一目标数据转换为第二目标数据;通过所述第二应用程序对所述第二目标数据执行所述目标处理策略。The above-mentioned computer-readable medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device: responds to receiving a data processing instruction, acquires the first target data to be processed, so The data processing instruction is used to instruct to execute the target processing policy on the first target data; determine whether the first application program can execute the target processing policy on the first target data; If the target processing policy cannot be executed on the first target data, determine a second application program capable of executing the target processing policy, where the second application program is coded differently from the first application program; Converting the first target data into second target data according to the first data format that the second application program can process; executing the target processing policy on the second target data through the second application program.
可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,上述程序设计语言包括但不限于面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言——诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)——连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, or combinations thereof, including but not limited to object-oriented programming languages—such as Java, Smalltalk, C++, and Includes conventional procedural programming languages - such as "C" or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (for example, using an Internet service provider to connected via the Internet).
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或 多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, program segment, or portion of code that contains one or more logical functions for implementing specified executable instructions. It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved. It should also be noted that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented by a dedicated hardware-based system that performs the specified functions or operations , or may be implemented by a combination of dedicated hardware and computer instructions.
描述于本公开实施例中所涉及到的模块可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,模块的名称在某种情况下并不构成对该模块本身的限定,例如,数据获取模块还可以被描述为“获取待处理的第一目标数据的模块”。The modules involved in the embodiments described in the present disclosure may be implemented by software or by hardware. Wherein, the name of the module does not constitute a limitation of the module itself under certain circumstances, for example, the data acquisition module may also be described as "a module for acquiring the first target data to be processed".
本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,非限制性地,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、片上系统(SOC)、复杂可编程逻辑设备(CPLD)等等。The functions described herein above may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), System on Chips (SOCs), Complex Programmable Logical device (CPLD) and so on.
在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media would include one or more wire-based electrical connections, portable computer discs, hard drives, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, compact disk read only memory (CD-ROM), optical storage, magnetic storage, or any suitable combination of the foregoing.
根据本公开的一个或多个实施例,示例1提供了一种数据处理方法,应用于第一应用程序,所述方法包括:响应于接收到数据处理指令,获取待处理的第一目标数据,所述数据处理指令用于指示对所述第一目标数据执行目标处理策略;确定所述第一应用程序是否能够对所述第一目标数据执行所述目标处理策略;在确定所述第一应用程序不能对所述第一目标数据执行所述目标处理策略的情况下,确定能够执行所述目标处理策略的第二应用程序,所述第二应用程序与所述第一应用程序的编码方式不同;按照所述第二应用程序能够处理的第一数据格式,将所述第一目标数据转换为第二目标数据;通过所述第二应用程序对所述第二目标数据执行所述目标处理策略。According to one or more embodiments of the present disclosure, Example 1 provides a data processing method applied to a first application program, the method comprising: acquiring first target data to be processed in response to receiving a data processing instruction, The data processing instruction is used to instruct to execute the target processing policy on the first target data; determine whether the first application program can execute the target processing policy on the first target data; When the program cannot execute the target processing policy on the first target data, determine a second application program capable of executing the target processing policy, where the second application program is coded differently from the first application program ; convert the first target data into second target data according to the first data format that the second application program can process; execute the target processing policy on the second target data through the second application program .
根据本公开的一个或多个实施例,示例2提供了示例1的方法,所述确定所述第一应用程序是否能够对所述第一目标数据执行所述目标处理策略包括:确定所述第一应用 程序是否包括第一目标函数,所述第一目标函数用于执行所述目标处理策略;在确定所述第一应用程序包括所述第一目标函数的情况下,确定所述第一应用程序能够对所述第一目标数据执行所述目标处理策略;在确定所述第一应用程序不包括所述第一目标函数的情况下,确定所述第一应用程序不能对所述第一目标数据执行所述目标处理策略。According to one or more embodiments of the present disclosure, Example 2 provides the method of Example 1, the determining whether the first application program can execute the target processing policy on the first target data includes: determining the first target data Whether an application program includes a first objective function, and the first objective function is used to execute the target processing strategy; when it is determined that the first application program includes the first objective function, determining that the first application program a program capable of executing the target processing policy on the first target data; in a case where it is determined that the first application program does not include the first target function, it is determined that the first application program cannot process the first target data Data enforces the target processing policy.
根据本公开的一个或多个实施例,示例3提供了示例1的方法,所述确定能够执行所述目标处理策略的第二应用程序包括:将多个预设应用程序中包括第二目标函数的预设应用程序,作为所述第二应用程序,所述第二目标函数用于执行所述目标处理策略。According to one or more embodiments of the present disclosure, Example 3 provides the method of Example 1, the determining the second application that can execute the target processing strategy includes: including the second target function in a plurality of preset application programs The preset application program is the second application program, and the second objective function is used to execute the target processing policy.
根据本公开的一个或多个实施例,示例4提供了示例3的方法,所述按照所述第二应用程序能够处理的第一数据格式,将所述第一目标数据转换为第二目标数据包括:按照所述第二应用程序的第二目标函数能够处理的第一数据格式,将所述第一目标数据转换为所述第二目标数据;所述通过所述第二应用程序对所述第二目标数据执行所述目标处理策略包括:通过所述第二目标函数对所述第二目标数据执行所述目标处理策略。According to one or more embodiments of the present disclosure, Example 4 provides the method of Example 3, converting the first target data into second target data according to the first data format that the second application program can handle including: converting the first target data into the second target data according to the first data format that can be processed by the second target function of the second application program; Executing the target processing policy on the second target data includes: executing the target processing policy on the second target data through the second target function.
根据本公开的一个或多个实施例,示例5提供了示例4的方法,在所述按照所述第二应用程序的第二目标函数能够处理的第一数据格式,将所述第一目标数据转换为所述第二目标数据前,所述方法还包括:确定所述第一应用程序是否缓存所述第二应用程序的第二目标函数对应的目标资源包;所述按照所述第二应用程序的第二目标函数能够处理的第一数据格式,将所述第一目标数据转换为所述第二目标数据包括:在确定所述第一应用程序缓存所述第二应用程序的第二目标函数对应的目标资源包的情况下,按照所述第二应用程序的第二目标函数能够处理的第一数据格式,将所述第一目标数据转换为所述第二目标数据。According to one or more embodiments of the present disclosure, Example 5 provides the method of Example 4. In the first data format that can be processed by the second objective function of the second application program, the first target data is Before converting to the second target data, the method further includes: determining whether the first application program caches the target resource package corresponding to the second target function of the second application program; A first data format that can be processed by the second object function of the program, converting the first object data into the second object data includes: determining that the first application program caches the second object of the second application program In the case of the target resource package corresponding to the function, the first target data is converted into the second target data according to the first data format that can be processed by the second target function of the second application program.
根据本公开的一个或多个实施例,示例6提供了示例5的方法,所述方法还包括:在确定所述第一应用程序未缓存所述第二应用程序的第二目标函数对应的目标资源包的情况下,从所述第二应用程序对应的服务器获取所述目标资源包;加载所述目标资源包;在所述目标资源包加载完成后,按照所述第二应用程序的第二目标函数能够处理的第一数据格式,将所述第一目标数据转换为所述第二目标数据。According to one or more embodiments of the present disclosure, Example 6 provides the method of Example 5, the method further comprising: after determining that the first application program does not cache the target corresponding to the second target function of the second application program In the case of a resource pack, the target resource pack is obtained from the server corresponding to the second application; the target resource pack is loaded; after the target resource pack is loaded, according to the second A first data format that can be processed by the objective function, converting the first objective data into the second objective data.
根据本公开的一个或多个实施例,示例7提供了示例4的方法,所述第二目标数据包括多个,所述第二目标函数包括第一函数、第二函数以及第三函数;所述通过所述第二目标函数对所述第二目标数据执行所述目标处理策略包括:通过所述第一应用程序的第一预设函数调用所述第一函数,以通过所述第一函数分别处理多个所述第二目标数据,得到多个第一数据;通过所述第一应用程序的第二预设函数调用所述第二函数,以通过所述第二函数对多个所述第一数据进行聚合处理,得到多个第二数据;通过所述第一应 用程序的第三预设函数调用所述第三函数,以通过所述第三函数处理多个所述第二数据。According to one or more embodiments of the present disclosure, Example 7 provides the method of Example 4, the second target data includes a plurality, and the second target function includes a first function, a second function, and a third function; Executing the target processing strategy on the second target data through the second target function includes: calling the first function through a first preset function of the first application program, so as to use the first function Process a plurality of the second target data respectively to obtain a plurality of first data; call the second function through the second preset function of the first application program, so as to use the second function for the plurality of the Aggregating the first data to obtain a plurality of second data; calling the third function through a third preset function of the first application program, so as to process the plurality of second data through the third function.
根据本公开的一个或多个实施例,示例8提供了示例1至示例7中任一示例的方法,所述方法还包括:按照所述第一应用程序能够处理的第二数据格式,将第一处理结果转换为第二处理结果,并输出所述第二处理结果,所述第一处理结果为通过所述第二应用程序对所述第二目标数据执行所述目标处理策略的结果。According to one or more embodiments of the present disclosure, Example 8 provides the method of any one of Examples 1 to 7, the method further comprising: according to the second data format that the first application program can handle, converting the first A processing result is converted into a second processing result, and the second processing result is output, and the first processing result is a result of executing the target processing policy on the second target data through the second application program.
根据本公开的一个或多个实施例,示例9提供了一种数据处理装置,应用于第一应用程序,所述装置包括:数据获取模块,用于响应于接收到数据处理指令,获取待处理的第一目标数据,所述数据处理指令用于指示对所述第一目标数据执行目标处理策略;执行确定模块,用于确定所述第一应用程序是否能够对所述第一目标数据执行所述目标处理策略;应用程序确定模块,用于在确定所述第一应用程序不能对所述第一目标数据执行所述目标处理策略的情况下,确定能够执行所述目标处理策略的第二应用程序,所述第二应用程序与所述第一应用程序的编码方式不同;第一格式转换模块,用于按照所述第二应用程序能够处理的第一数据格式,将所述第一目标数据转换为第二目标数据;策略执行模块,用于通过所述第二应用程序对所述第二目标数据执行所述目标处理策略。According to one or more embodiments of the present disclosure, Example 9 provides a data processing device, which is applied to a first application program, and the device includes: a data acquisition module, configured to acquire a data processing instruction to be processed in response to receiving a data processing instruction the first target data, the data processing instruction is used to instruct to execute the target processing policy on the first target data; the execution determining module is used to determine whether the first application program can execute the target processing policy on the first target data The target processing strategy; an application program determination module, configured to determine a second application capable of executing the target processing strategy when it is determined that the first application program cannot execute the target processing strategy for the first target data program, the encoding method of the second application program is different from that of the first application program; the first format conversion module is configured to convert the first target data into the first data format that can be processed by the second application program converted into second target data; a policy execution module, configured to execute the target processing policy on the second target data through the second application program.
根据本公开的一个或多个实施例,示例10提供了一种计算机可读介质,其上存储有计算机程序,该程序被处理装置执行时实现示例1-8中任一示例所述方法的步骤。According to one or more embodiments of the present disclosure, Example 10 provides a computer-readable medium on which a computer program is stored, and when the program is executed by a processing device, the steps of the method described in any one of Examples 1-8 are implemented. .
根据本公开的一个或多个实施例,示例11提供了一种电子设备,包括:存储装置,其上存储有计算机程序;处理装置,用于执行所述存储装置中的所述计算机程序,以实现示例1-8中任一示例所述方法的步骤。According to one or more embodiments of the present disclosure, Example 11 provides an electronic device, including: a storage device on which a computer program is stored; a processing device configured to execute the computer program in the storage device to Implement the steps of the method described in any one of Examples 1-8.
以上描述仅为本公开的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本公开中所涉及的公开范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述公开构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本公开中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。The above description is only a preferred embodiment of the present disclosure and an illustration of the applied technical principles. Those skilled in the art should understand that the disclosure scope involved in this disclosure is not limited to the technical solution formed by the specific combination of the above-mentioned technical features, but also covers the technical solutions formed by the above-mentioned technical features or Other technical solutions formed by any combination of equivalent features. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.
此外,虽然采用特定次序描绘了各操作,但是这不应当理解为要求这些操作以所示出的特定次序或以顺序次序执行来执行。在一定环境下,多任务和并行处理可能是有利的。同样地,虽然在上面论述中包含了若干具体实现细节,但是这些不应当被解释为对本公开的范围的限制。在单独的实施例的上下文中描述的某些特征还可以组合地实现在单个实施例中。相反地,在单个实施例的上下文中描述的各种特征也可以单独地或以任何合适的子组合的方式实现在多个实施例中。In addition, while operations are depicted in a particular order, this should not be understood as requiring that the operations be performed in the particular order shown or performed in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while the above discussion contains several specific implementation details, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
尽管已经采用特定于结构特征和/或方法逻辑动作的语言描述了本主题,但是应当理 解所附权利要求书中所限定的主题未必局限于上面描述的特定特征或动作。相反,上面所描述的特定特征和动作仅仅是实现权利要求书的示例形式。关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims. Regarding the apparatus in the foregoing embodiments, the specific manner in which each module executes operations has been described in detail in the embodiments related to the method, and will not be described in detail here.

Claims (11)

  1. 一种数据处理方法,其特征在于,应用于第一应用程序,所述方法包括:A data processing method, characterized in that it is applied to a first application program, the method comprising:
    响应于接收到数据处理指令,获取待处理的第一目标数据,所述数据处理指令用于指示对所述第一目标数据执行目标处理策略;acquiring first target data to be processed in response to receiving a data processing instruction, the data processing instruction being used to instruct execution of a target processing policy on the first target data;
    确定所述第一应用程序是否能够对所述第一目标数据执行所述目标处理策略;determining whether the first application is capable of executing the target processing policy on the first target data;
    在确定所述第一应用程序不能对所述第一目标数据执行所述目标处理策略的情况下,确定能够执行所述目标处理策略的第二应用程序,所述第二应用程序与所述第一应用程序的编码方式不同;In a case where it is determined that the first application program cannot execute the target processing policy on the first target data, determining a second application program capable of executing the target processing policy, the second application program being identical to the first application program An application is coded differently;
    按照所述第二应用程序能够处理的第一数据格式,将所述第一目标数据转换为第二目标数据;converting the first target data into second target data according to a first data format capable of being processed by the second application;
    通过所述第二应用程序对所述第二目标数据执行所述目标处理策略。The target processing policy is executed on the second target data by the second application.
  2. 根据权利要求1所述的方法,其特征在于,所述确定所述第一应用程序是否能够对所述第一目标数据执行所述目标处理策略包括:The method according to claim 1, wherein the determining whether the first application program can execute the target processing policy on the first target data comprises:
    确定所述第一应用程序是否包括第一目标函数,所述第一目标函数用于执行所述目标处理策略;determining whether the first application program includes a first objective function for implementing the objective processing policy;
    在确定所述第一应用程序包括所述第一目标函数的情况下,确定所述第一应用程序能够对所述第一目标数据执行所述目标处理策略;determining that the first application is capable of executing the target processing policy on the first target data, if the first application is determined to include the first target function;
    在确定所述第一应用程序不包括所述第一目标函数的情况下,确定所述第一应用程序不能对所述第一目标数据执行所述目标处理策略。In a case where it is determined that the first application program does not include the first target function, it is determined that the first application program cannot execute the target processing policy on the first target data.
  3. 根据权利要求1所述的方法,其特征在于,所述确定能够执行所述目标处理策略的第二应用程序包括:The method according to claim 1, wherein the determining the second application program capable of executing the target processing policy comprises:
    将多个预设应用程序中包括第二目标函数的预设应用程序,作为所述第二应用程序,所述第二目标函数用于执行所述目标处理策略。A preset application program including a second objective function among the plurality of preset application programs is used as the second application program, and the second objective function is used to execute the target processing strategy.
  4. 根据权利要求3所述的方法,其特征在于,所述按照所述第二应用程序能够处理的第一数据格式,将所述第一目标数据转换为第二目标数据包括:The method according to claim 3, wherein converting the first target data into the second target data according to the first data format that can be processed by the second application program comprises:
    按照所述第二应用程序的第二目标函数能够处理的第一数据格式,将所述第一目标数据转换为所述第二目标数据;converting the first target data into the second target data according to a first data format that can be processed by a second target function of the second application;
    所述通过所述第二应用程序对所述第二目标数据执行所述目标处理策略包括:The executing the target processing policy on the second target data through the second application program includes:
    通过所述第二目标函数对所述第二目标数据执行所述目标处理策略。The target processing strategy is executed on the second target data by the second target function.
  5. 根据权利要求4所述的方法,其特征在于,在所述按照所述第二应用程序的第二 目标函数能够处理的第一数据格式,将所述第一目标数据转换为所述第二目标数据前,所述方法还包括:The method according to claim 4, characterized in that converting the first object data into the second object in the first data format that can be processed by the second object function of the second application program Before the data, the method also includes:
    确定所述第一应用程序是否缓存所述第二应用程序的第二目标函数对应的目标资源包;Determine whether the first application program caches the target resource bundle corresponding to the second target function of the second application program;
    所述按照所述第二应用程序的第二目标函数能够处理的第一数据格式,将所述第一目标数据转换为所述第二目标数据包括:The converting the first target data into the second target data according to the first data format that can be processed by the second target function of the second application program includes:
    在确定所述第一应用程序缓存所述第二应用程序的第二目标函数对应的目标资源包的情况下,按照所述第二应用程序的第二目标函数能够处理的第一数据格式,将所述第一目标数据转换为所述第二目标数据。When it is determined that the first application program caches the target resource bundle corresponding to the second target function of the second application program, according to the first data format that the second target function of the second application program can handle, the The first target data is converted into the second target data.
  6. 根据权利要求5所述的方法,其特征在于,所述方法还包括:The method according to claim 5, wherein the method further comprises:
    在确定所述第一应用程序未缓存所述第二应用程序的第二目标函数对应的目标资源包的情况下,从所述第二应用程序对应的服务器获取所述目标资源包;When it is determined that the first application program does not cache the target resource package corresponding to the second target function of the second application program, acquiring the target resource package from a server corresponding to the second application program;
    加载所述目标资源包;Load the target resource bundle;
    在所述目标资源包加载完成后,按照所述第二应用程序的第二目标函数能够处理的第一数据格式,将所述第一目标数据转换为所述第二目标数据。After the target resource package is loaded, convert the first target data into the second target data according to the first data format that can be processed by the second target function of the second application program.
  7. 根据权利要求4所述的方法,其特征在于,所述第二目标数据包括多个,所述第二目标函数包括第一函数、第二函数以及第三函数;所述通过所述第二目标函数对所述第二目标数据执行所述目标处理策略包括:The method according to claim 4, wherein the second target data includes a plurality, the second target function includes a first function, a second function and a third function; The function executing the target processing policy on the second target data includes:
    通过所述第一应用程序的第一预设函数调用所述第一函数,以通过所述第一函数分别处理多个所述第二目标数据,得到多个第一数据;calling the first function through a first preset function of the first application, so as to process a plurality of second target data respectively through the first function to obtain a plurality of first data;
    通过所述第一应用程序的第二预设函数调用所述第二函数,以通过所述第二函数对多个所述第一数据进行聚合处理,得到多个第二数据;calling the second function through a second preset function of the first application, so as to aggregate a plurality of first data through the second function to obtain a plurality of second data;
    通过所述第一应用程序的第三预设函数调用所述第三函数,以通过所述第三函数处理多个所述第二数据。calling the third function through a third preset function of the first application program, so as to process a plurality of the second data through the third function.
  8. 根据权利要求1-7任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1-7, wherein the method further comprises:
    按照所述第一应用程序能够处理的第二数据格式,将第一处理结果转换为第二处理结果,并输出所述第二处理结果,所述第一处理结果为通过所述第二应用程序对所述第二目标数据执行所述目标处理策略的结果。convert the first processing result into a second processing result according to the second data format that the first application program can process, and output the second processing result, the first processing result is passed through the second application program A result of executing the target processing policy on the second target data.
  9. 一种数据处理装置,其特征在于,应用于第一应用程序,所述装置包括:A data processing device, characterized in that it is applied to a first application program, said device comprising:
    数据获取模块,用于响应于接收到数据处理指令,获取待处理的第一目标数据,所述数据处理指令用于指示对所述第一目标数据执行目标处理策略;A data acquisition module, configured to acquire first target data to be processed in response to receiving a data processing instruction, where the data processing instruction is used to instruct execution of a target processing policy on the first target data;
    执行确定模块,用于确定所述第一应用程序是否能够对所述第一目标数据执行所述目标处理策略;an execution determining module, configured to determine whether the first application program can execute the target processing policy on the first target data;
    应用程序确定模块,用于在确定所述第一应用程序不能对所述第一目标数据执行所述目标处理策略的情况下,确定能够执行所述目标处理策略的第二应用程序,所述第二应用程序与所述第一应用程序的编码方式不同;An application program determining module, configured to determine a second application program capable of executing the target processing policy when it is determined that the first application program cannot execute the target processing policy on the first target data, the first application program The encoding method of the second application program is different from that of the first application program;
    第一格式转换模块,用于按照所述第二应用程序能够处理的第一数据格式,将所述第一目标数据转换为第二目标数据;a first format conversion module, configured to convert the first target data into second target data according to a first data format that can be processed by the second application program;
    策略执行模块,用于通过所述第二应用程序对所述第二目标数据执行所述目标处理策略。A policy execution module, configured to execute the target processing policy on the second target data through the second application program.
  10. 一种计算机可读介质,其上存储有计算机程序,其特征在于,该程序被处理装置执行时实现权利要求1-8中任一项所述方法的步骤。A computer-readable medium, on which a computer program is stored, wherein, when the program is executed by a processing device, the steps of the method according to any one of claims 1-8 are realized.
  11. 一种电子设备,其特征在于,包括:An electronic device, characterized in that it comprises:
    存储装置,其上存储有计算机程序;a storage device on which a computer program is stored;
    处理装置,用于执行所述存储装置中的所述计算机程序,以实现权利要求1-8中任一项所述方法的步骤。A processing device configured to execute the computer program in the storage device to implement the steps of the method according to any one of claims 1-8.
PCT/CN2022/120087 2021-10-22 2022-09-21 Data processing method and apparatus, and readable medium and electronic device WO2023065937A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111234197.1 2021-10-22
CN202111234197.1A CN113971192A (en) 2021-10-22 2021-10-22 Data processing method and device, readable medium and electronic equipment

Publications (1)

Publication Number Publication Date
WO2023065937A1 true WO2023065937A1 (en) 2023-04-27

Family

ID=79587969

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/120087 WO2023065937A1 (en) 2021-10-22 2022-09-21 Data processing method and apparatus, and readable medium and electronic device

Country Status (2)

Country Link
CN (1) CN113971192A (en)
WO (1) WO2023065937A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113971192A (en) * 2021-10-22 2022-01-25 北京火山引擎科技有限公司 Data processing method and device, readable medium and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108415786A (en) * 2018-03-13 2018-08-17 联想(北京)有限公司 Information processing method and device, electronic equipment and computer-readable medium
CN109033123A (en) * 2018-05-31 2018-12-18 康键信息技术(深圳)有限公司 Querying method, device, computer equipment and storage medium based on big data
CN109426571A (en) * 2017-08-28 2019-03-05 阿里巴巴集团控股有限公司 Function call and the method for data access, system, storage medium, processor and device
CN111124713A (en) * 2019-12-24 2020-05-08 北京安兔兔科技有限公司 Equipment system function calling method and device, terminal equipment and storage medium
CN113971192A (en) * 2021-10-22 2022-01-25 北京火山引擎科技有限公司 Data processing method and device, readable medium and electronic equipment

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111611221A (en) * 2019-02-26 2020-09-01 北京京东尚科信息技术有限公司 Hybrid computing system, data processing method and device
CN111897525A (en) * 2020-07-15 2020-11-06 深圳市腾讯网域计算机网络有限公司 Big data processing method and system
CN112860798B (en) * 2021-02-10 2022-07-12 挂号网(杭州)科技有限公司 Data processing method and device, electronic equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109426571A (en) * 2017-08-28 2019-03-05 阿里巴巴集团控股有限公司 Function call and the method for data access, system, storage medium, processor and device
CN108415786A (en) * 2018-03-13 2018-08-17 联想(北京)有限公司 Information processing method and device, electronic equipment and computer-readable medium
CN109033123A (en) * 2018-05-31 2018-12-18 康键信息技术(深圳)有限公司 Querying method, device, computer equipment and storage medium based on big data
CN111124713A (en) * 2019-12-24 2020-05-08 北京安兔兔科技有限公司 Equipment system function calling method and device, terminal equipment and storage medium
CN113971192A (en) * 2021-10-22 2022-01-25 北京火山引擎科技有限公司 Data processing method and device, readable medium and electronic equipment

Also Published As

Publication number Publication date
CN113971192A (en) 2022-01-25

Similar Documents

Publication Publication Date Title
CN111581563B (en) Page response method and device, storage medium and electronic equipment
CN110753089B (en) Method, device, medium and electronic equipment for managing client
CN111930534A (en) Data calling method and device and electronic equipment
WO2023029854A1 (en) Data query method and apparatus, storage medium, and electronic device
WO2023065937A1 (en) Data processing method and apparatus, and readable medium and electronic device
CN111338944B (en) Remote Procedure Call (RPC) interface testing method, device, medium and equipment
CN111309304B (en) Method, device, medium and electronic equipment for generating IDL file
CN111241137B (en) Data processing method, device, electronic equipment and storage medium
CN109614089B (en) Automatic generation method, device, equipment and storage medium of data access code
WO2023001281A1 (en) Table data processing method and apparatus, terminal, and storage medium
CN114036107B (en) Medical data query method and device based on hudi snapshot
CN111143355B (en) Data processing method and device
CN112507676B (en) Method and device for generating energy report, electronic equipment and computer readable medium
CN112100211B (en) Data storage method, apparatus, electronic device, and computer readable medium
CN111796865A (en) Byte code file modification method and device, terminal equipment and medium
CN111580890A (en) Method, apparatus, electronic device, and computer-readable medium for processing features
CN112084003B (en) Method, device, medium and electronic equipment for isolating data
CN112307061A (en) Method and device for querying data
CN111258670B (en) Method and device for managing component data, electronic equipment and storage medium
CN111209042B (en) Method, device, medium and electronic equipment for establishing function stack
CN111399902B (en) Client source file processing method and device, readable medium and electronic equipment
CN117806644A (en) Header dependency analysis method, device, storage medium, and program product
CN116243926A (en) Service processing method, device, medium and electronic equipment
CN116680316A (en) Method, device, medium and electronic equipment for acquiring dimension data
CN114780263A (en) Service calling method, device, equipment and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22882548

Country of ref document: EP

Kind code of ref document: A1