Data acquisition method, device, electronic device and storage medium

By functionally encapsulating the data acquisition service, a flexible data acquisition method is realized, which solves the hard-coding problem caused by different business requirements in the existing technology, improves flexibility and reduces costs.

CN111752688BActive Publication Date: 2024-09-06WUBA
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202010496532.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-03
Publication Date
2024-09-06
Estimated Expiration
2040-06-03

AI Technical Summary

Technical Problem

Due to different business needs, existing data collection services require hard-coding to call different services, resulting in low flexibility and increased communication costs and time costs.

Method used

By functionally encapsulating data acquisition services, each function can be called independently or in combination, using configuration files and parameters to execute functions, supporting multi-threaded calls, and reducing the need to regenerate data collection programs.

Benefits of technology

It improves the flexibility of data acquisition, reduces time and communication costs, reduces development costs, and supports personalized needs and function reuse.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111752688B
    Figure CN111752688B
Patent Text Reader

Abstract

The present invention provides a data acquisition method, device, electronic device and storage medium. The method comprises: receiving a data collection instruction, wherein the data collection instruction comprises parameters and a configuration file for acquiring data, wherein the configuration file comprises at least one of address information and interface information of at least one function, wherein the function is obtained by functional encapsulation for any data acquisition service, and the data acquisition services corresponding to each function are different; calling each function according to the configuration file, and executing each function based on the parameters; obtaining the execution result of each function and returning it. Thus, decoupling is achieved through the relationship between each data acquisition service, so that each function can be called independently or in combination, which can improve flexibility and reduce time cost and communication cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a data acquisition method, device, electronic equipment and storage medium. Background Art

[0002] The data collection service collects the desired data by calling other services or custom functions through certain data in the sample data. Moreover, since the business requirements of different businesses are different, the data required by each business is also different, that is, the called services are not fixed. It is possible that business A needs to call two services, and business B needs to call three other existing services, etc. These need to be hard-coded in advance, and the entire data collection program can be published before it can be used. Furthermore, if the service to be called is not in the connected service, the data collection program needs to be regenerated.

[0003] It can be seen from this that since different businesses need to call different services, the services corresponding to each business need to be hard-coded and released in advance, which is a lot of work; moreover, if the user cannot adjust the business logic at will when connecting to a new service, it will increase communication costs and time costs, resulting in inflexible operations. Summary of the invention

[0004] The embodiments of the present invention provide a data acquisition method, device, electronic device and storage medium to solve the problems of low flexibility, high communication cost and time cost in existing solutions.

[0005] In order to solve the above-mentioned technical problems, the present invention is achieved as follows:

[0006] In a first aspect, an embodiment of the present invention provides a data acquisition method, comprising:

[0007] Receive a data collection instruction, wherein the data collection instruction includes parameters and a configuration file for acquiring data, wherein the configuration file includes at least one of address information and interface information of at least one function, wherein the function is obtained by functional encapsulation for any data acquisition service, and the data acquisition services corresponding to each function are different;

[0008] Calling each of the functions according to the configuration file and executing each of the functions based on the parameters;

[0009] Get the execution result of each of the functions and return it.

[0010] Optionally, before receiving the data collection instruction, the method further includes:

[0011] Receive a function selection instruction and display a preset function publishing page, wherein the function publishing page includes a function identifier of each currently available function;

[0012] The configuration file is generated according to the function identifier selected by the user through the function publishing page.

[0013] Optionally, the step of receiving a function selection instruction and displaying a preset function publishing page includes:

[0014] Receiving a function selection instruction, and obtaining the business to which the function instruction belongs;

[0015] A preset function publishing page is displayed, and a function identifier of each function available under the service is displayed on the function publishing page.

[0016] Optionally, the method further comprises:

[0017] receiving a function publishing request, wherein the function publishing request carries at least one function to be published;

[0018] In the case that the sender of the function publishing request has function publishing authority, each of the functions to be published is obtained, and at least one of the address information and the interface information of each of the functions to be published is recorded.

[0019] Optionally, the functional encapsulation method of the data acquisition service includes at least one of functional encapsulation using FaaS technology and functional encapsulation using Groovy technology.

[0020] Optionally, the step of calling each of the functions according to the configuration file and executing each of the functions based on the parameters includes:

[0021] In response to the configuration document corresponding to a plurality of functions, calling each of the functions through multithreading, and executing each of the functions based on the parameters;

[0022] Each thread is used to call and execute a function, and the functions called by each thread are different.

[0023] In a second aspect, an embodiment of the present invention provides a data acquisition device, including:

[0024] An instruction receiving module, used to receive a data collection instruction, wherein the data collection instruction includes parameters and a configuration file for acquiring data, wherein the configuration file includes at least one of address information and interface information of at least one function, wherein the function is obtained by functional encapsulation for any data acquisition service, and the data acquisition services corresponding to each function are different from each other;

[0025] A function calling module, used for calling each of the functions according to the configuration file and executing each of the functions based on the parameters;

[0026] The data return module is used to obtain and return the execution result of each function.

[0027] Optionally, the device further comprises:

[0028] A function display module, used to receive a function selection instruction and display a preset function publishing page, wherein the function publishing page includes a function identifier of each currently available function;

[0029] The configuration file generation module is used to generate the configuration file according to the function identifier selected by the user through the function publishing page.

[0030] Optionally, the function display module includes:

[0031] A business determination submodule, used for receiving a function selection instruction and obtaining the business to which the function instruction belongs;

[0032] The function display submodule is used to display a preset function publishing page, and to display the function identifier of each function available under the service on the function publishing page.

[0033] Optionally, the device further comprises:

[0034] A request receiving module, used for receiving a function publishing request, wherein the function publishing request carries at least one function to be published;

[0035] The function publishing module is used to obtain each function to be published and record at least one of the address information and interface information of each function to be published when the sender of the function publishing request has function publishing authority.

[0036] Optionally, the functional encapsulation method of the data acquisition service includes at least one of functional encapsulation using FaaS technology and functional encapsulation using Groovy technology.

[0037] Optionally, the function calling module is further used to call each of the functions through multi-threading in response to the configuration document corresponding to multiple functions, and execute each of the functions based on the parameters;

[0038] Each thread is used to call and execute a function, and the functions called by each thread are different.

[0039] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps of the data acquisition method described in the first aspect when executed by the processor.

[0040] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the data acquisition method described in the first aspect are implemented.

[0041] In the embodiment of the present invention, the relationship between various data acquisition services is decoupled so that each function can be called independently or in combination, which can improve flexibility and reduce time cost and communication cost.

[0042] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0044] Figure 1 is a flow chart of steps of a data acquisition method in an embodiment of the present invention;

[0045] Figure 2 is a flowchart of another method for acquiring data in an embodiment of the present invention;

[0046] Figure 3 is a structural schematic diagram of a data acquisition device in an embodiment of the present invention;

[0047] Figure 4 is a structural schematic diagram of another data acquisition device in an embodiment of the present invention;

[0048] Figure 5 It is a schematic diagram of the hardware structure of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION

[0049] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0050] Reference Figure 1, shows a step flow chart of a data acquisition method in an embodiment of the present invention.

[0051] Step 110, receiving a data collection instruction, wherein the data collection instruction includes parameters and a configuration file for acquiring data, wherein the configuration file includes at least one of address information and interface information of at least one function, wherein the function is obtained by functional encapsulation for any data acquisition service, and the data acquisition services corresponding to each function are different.

[0052] In an embodiment of the present invention, in order to facilitate the reuse of various services, so that users can customize the services they need and call the corresponding services, thereby improving the flexibility of data acquisition, each data acquisition service can be functionalized in advance to obtain mutually decoupled functions corresponding to each data acquisition service, so that each data acquisition service can be flexibly called in the form of calling functions, and each time a function is updated, it will not affect other functions, and there is no need to reload the code files corresponding to all functions.

[0053] In addition, in actual applications, when acquiring data, the scope of the data to be acquired is generally limited based on given parameters, and then the data acquisition service corresponding to the currently required data collection can be used to refer to the given parameters to obtain the data corresponding to the parameters, which is the currently required data. At this time, the given parameters can limit the data to be acquired to a certain extent. For example, in the model training process, in order to screen suitable sample data, certain conditions can be set for the sample data to be acquired by pre-given parameters to limit the scope of the sample data to be acquired. Then, when acquiring sample data, the currently required service can be called based on the given parameters to obtain the required sample data.

[0054] For example, if a given UserID is used as a parameter for acquiring data, and a cloud authentication service is called to acquire authentication information, and a portrait service is called to acquire portrait information, etc., the acquired information is material data. Then, the authentication information and portrait information of the UserID defined by the parameters can be acquired by setting parameters. The cloud authentication service, portrait service, etc. are all data acquisition services. Of course, data acquisition services can include any related services that can be used to acquire data, such as feature snapshot services for acquiring portrait data, content algorithm services for content analysis, custom services that meet personalized needs, and so on.

[0055] In the embodiment of the present invention, the data acquisition service can be functionalized in any available manner, such as separating the code segments corresponding to each service from the original code segments as a whole and encapsulating them into a function that can be called separately, etc., which is not limited in the embodiment of the present invention. Moreover, the specific content of the parameters can also be customized according to specific application scenarios and requirements, etc., which is not limited in the embodiment of the present invention.

[0056] Moreover, after each data acquisition service is functionalized, in order to be able to call the currently required function to acquire data in the future, a configuration file that meets the current data acquisition requirements can also be carried in the data acquisition instruction based on the current data acquisition requirements. The configuration file can include but is not limited to at least one of the address information and interface information of at least one function, which is used to call each currently required function to perform the data acquisition operation. For example, after encapsulating the data acquisition service as a function, the interface provided by the corresponding function to the outside can be set, that is, the interface information of the function; or the address information of the corresponding function can be obtained, that is, the address information used to call the corresponding function; and so on.

[0057] In addition, in the embodiment of the present invention, the data collection instruction can be triggered by any available method, which is not limited by the embodiment of the present invention. For example, after the user selects the currently required function, a corresponding configuration file can be generated and the data collection instruction can be triggered, and so on.

[0058] Secondly, in the embodiment of the present invention, the reference information can be stored in any available manner, which is not limited in the embodiment of the present invention. For example, the reference information data can be stored in a hive data table.

[0059] Step 120: Call each of the functions according to the configuration file, and execute each of the functions based on the parameters.

[0060] After receiving the data collection instruction, each of the currently required functions can be called according to the configuration file contained in the corresponding data collection instruction, and each of the functions can be executed based on the parameters. Specifically, each currently required function can be found according to the address information, interface information, etc. contained in the configuration file, and then the corresponding function can be called. Moreover, the corresponding function can be executed based on the parameters contained in the corresponding data collection instruction to obtain the execution result of the corresponding function, that is, the material data corresponding to the corresponding parameter information. For example, assuming that the parameter is the user identifier UserID1, and the function includes a function obtained by functionally encapsulating the portrait service for obtaining user portrait data, then the user portrait data of UserID1 can be obtained by executing the function.

[0061] Step 130, obtaining and returning the execution result of each of the functions.

[0062] After each function currently called is executed, the execution result of each function can be obtained and returned to the corresponding requester.

[0063] Reference Figure 2 In an embodiment of the present invention, the method may further include:

[0064] Step 140: receiving a function selection instruction and displaying a preset function publishing page, wherein the function publishing page includes a function identifier of each currently available function.

[0065] Step 150: Generate the configuration file according to the function identifier selected by the user through the function publishing page.

[0066] In an embodiment of the present invention, in order to facilitate the user to select the currently required data acquisition service, the currently available functions can be displayed in the form of a page. Then, when a function selection instruction is received, a preset function publishing page can be displayed, and the function identifier of each currently available function can be displayed in the function publishing page. Further, the user can select the function identifier required by himself in the function publishing page by clicking on the function identifier or any other available method. Moreover, after the user selects the function identifier required by himself, a corresponding configuration file can be generated for the selected function identifier. At this time, the configuration file can include at least one of the address information and interface information of the function corresponding to each function identifier selected by the user.

[0067] The function selection instruction can be triggered by any available method, which is not limited in the embodiment of the present invention. Moreover, the function identifier can be any identification information that can characterize each function, such as the function name, the name of the data acquisition service corresponding to the function, the function icon, the icon of the data acquisition service corresponding to the function, etc., which can be customized according to the needs, which is not limited in the embodiment of the present invention.

[0068] In addition, in actual applications, application scenarios can be divided according to business, and the data required for different businesses can be different, that is, the data acquisition services required for different businesses can be different. Of course, there may be overlaps, and the data acquisition requirements for the same business are generally similar. Therefore, in an embodiment of the present invention, it is also possible to preset data requirements for different businesses, set the corresponding relationship between each business and function respectively, and then generate configuration files corresponding to each business. Then, when the user triggers a data collection instruction, the configuration file under the corresponding business can be obtained as the configuration file of the corresponding data collection instruction according to the business to which the corresponding data collection instruction belongs.

[0069] Optionally, in the embodiment of the present invention, step 140 may further include:

[0070] Step 141, receiving a function selection instruction, and obtaining the business to which the function instruction belongs;

[0071] Step 142: display a preset function publishing page, and display the function identifier of each function available under the service on the function publishing page.

[0072] As described above, in the embodiment of the present invention, the correspondence between different services and functions can be preset, so as to customize the functions applicable to each service. However, at this time, the functions under the same service are uniformly set, and in the actual application process, different users under the same service, or the same user in different time periods may have different data requirements, and it is difficult to consider the personalized needs of different users in the form of uniformly configuring functions under different services.

[0073] Therefore, in the embodiment of the present invention, in order to further improve the calling flexibility of each function and meet the personalized needs of different users, after receiving the function selection instruction, the business to which the function instruction belongs can be obtained; and then when displaying the preset function publishing page, only the function identifier of each function available under the business can be displayed in the function publishing page, and the user of the user can select the currently required function identifier in the current function publishing page. While limiting the functions applicable to each business, the personalized needs of the user can be met.

[0074] Optionally, in the embodiment of the present invention, the following may also be included:

[0075] Step 160, receiving a function publishing request, wherein the function publishing request carries at least one function to be published;

[0076] Step 170: if the sender of the function publishing request has function publishing authority, obtain each of the functions to be published, and record at least one of the address information and interface information of each of the functions to be published.

[0077] In actual applications, as the number of users increases, the data needs of each user will become more and more diverse. However, it is difficult for the administrator to timely learn about the new data needs of different users and to timely encapsulate functions that match the corresponding data needs. For users, if the currently available functions cannot meet their current data needs, they can report their own data needs to the administrator to remind the administrator to update the function, and the user's own data needs cannot be met in time.

[0078] Therefore, in an embodiment of the present invention, in order to reduce the above-mentioned communication costs and time costs, function publishing permissions can be issued in advance to verified users to facilitate users to publish new functions according to their own needs. Since each function is independently packaged, each function can be called individually or in combination, and only a single function needs to be published without republishing all other functions, which can effectively reduce publishing costs.

[0079] Specifically, a function publishing request may be received, the function publishing request carrying at least one function to be published; if the sender of the corresponding function publishing request has function publishing authority, each function to be published may be obtained, and at least one of the address information and interface information of each function to be published may be recorded. Accordingly, the function carried by the function publishing request is also obtained by functional encapsulation for any data acquisition service. Of course, the data acquisition service corresponding to the published function may also be different from the data acquisition service corresponding to any existing function.

[0080] Of course, in an embodiment of the present invention, the user can also directly publish a new data acquisition service. Then, after obtaining the data acquisition service published by the user, each data acquisition service can be functionally encapsulated to obtain the encapsulated function corresponding to each data acquisition service, so that the corresponding encapsulated function can be called repeatedly.

[0081] In addition, if each function is displayed in a page format, after the newly released function is obtained, the function identifier of each currently available function displayed in the function release page can be updated accordingly to add the function identifier of the latest successfully released function.

[0082] Secondly, in the embodiment of the present invention, each encapsulated function can be recorded in a preset storage area. The storage area can be customized according to the requirements, which is not limited in the embodiment of the present invention. For example, the storage area can be set as a MySql database, and then each function, function address information, interface information, etc., the corresponding relationship between the function and the business, etc. can be recorded in the MySql database to facilitate flexible reuse.

[0083] Optionally, in an embodiment of the present invention, the functional encapsulation method of the data acquisition service includes but is not limited to at least one of functional encapsulation using FaaS technology and functional encapsulation using Groovy technology.

[0084] Among them, FaaS is the abbreviation of Functions as a Service, which can be broadly understood as function service or function service. When using FaaS, you only need to pay attention to the business code logic, not the server resources, so FaaS is also closely related to the fact that developers do not need to pay attention to the server Serverless. It can be said that FaaS provides a more segmented and abstract service capability. FaaS gradually forms an event-driven architecture with code functions as the main body. When using FaaS, functions can be used as an online service or remote computing service, which can be executed through API (Application Programming Interface), email, IoT (Internet of Things), queue, etc. Groovy is a dynamic language based on JVM (Java Virtual Machine), and it is also an object-oriented language. Its syntax is very similar to Java.

[0085] In the embodiment of the present invention, the functional encapsulation method of different data acquisition services in different application scenarios may be different, and the specific customization can be made according to the needs, which is not limited by the embodiment of the present invention. For example, in the case of recording parameters and / or the data finally obtained through the above-mentioned hive data table, each data acquisition service can be encapsulated as a function through FaaS technology; or, in the case where the parameter is offline data, the data acquisition service can be encapsulated as a function through FaaS technology, and in the case where the parameter is online data, the data acquisition service can be encapsulated as a function through Groovy technology; and so on.

[0086] In addition, FaaS technology also has call-related information such as the number of calls and call time of the encapsulated function. Therefore, when the above requirements exist, Faas technology can be used for function encapsulation; and Faas technology can support common assembly languages ​​​​such as Java. Therefore, in order to facilitate users to publish new functions according to their own needs, it is preferred to support users to publish new functions through Faas technology, and so on.

[0087] Optionally, in an embodiment of the present invention, step 120 may further include: in response to the configuration document corresponding to multiple functions, calling each of the functions through multiple threads, and executing each of the functions based on the parameters; wherein each thread is used to call and execute a function, and the functions called by each thread are different.

[0088] In actual applications, if the current data collection instruction needs to call multiple functions in combination, then each function can be called and executed in sequence through one thread, or multiple threads can be used to call functions simultaneously. Moreover, in order to improve the execution efficiency of the functions in the data acquisition process, each function can be called simultaneously through multiple threads. Specifically, each of the functions can be called through multiple threads, and each of the functions can be executed based on the parameters, and each thread is used to call and execute a function, and the functions called by each thread are different. Then the total number of threads can be less than the total number of functions corresponding to the configuration document, but it is preferably possible to set the number of threads to be the same as the total number of functions corresponding to the configuration document, so that each function can be called and executed simultaneously.

[0089] In addition, in the embodiment of the present invention, functions can be called in any available manner, which is not limited by the embodiment of the present invention. For example, if the Http address assigned to each function after encapsulation is used as the address information of the corresponding function, and the configuration file includes the address information of the function, then each function can be called in multiple threads through http (HyperTextTransport Protocol), etc.

[0090] In the embodiment of the present invention, the relationship between various data acquisition services is decoupled so that each function can be called independently or in combination, which can improve flexibility and reduce time cost and communication cost.

[0091] Moreover, configuring functions and services can reduce development costs. Multiple services can flexibly reuse functions, and there is no need to repeatedly publish the entire data acquisition service. Only functions need to be published separately, which reduces the cost of publishing. Users can also write and publish functions with the logic code they need, and can flexibly configure the relationship between services and functions to achieve function reuse.

[0092] Reference Figure 3 , shows a schematic structural diagram of a data acquisition device in an embodiment of the present invention.

[0093] The data acquisition device of the embodiment of the present invention includes: an instruction receiving module 210 , a function calling module 220 and a data returning module 230 .

[0094] The functions of each module and the interactions between them are introduced in detail below.

[0095] The instruction receiving module 210 is used to receive a data collection instruction, wherein the data collection instruction includes parameters and a configuration file for acquiring data, wherein the configuration file includes at least one of address information and interface information of at least one function, wherein the function is obtained by functional encapsulation for any data acquisition service, and the data acquisition services corresponding to each function are different from each other;

[0096] A function calling module 220, configured to call each of the functions according to the configuration file and execute each of the functions based on the parameters;

[0097] The data return module 230 is used to obtain and return the execution result of each function.

[0098] Reference Figure 4 In an embodiment of the present invention, the device may further include:

[0099] The function display module 240 is used to receive a function selection instruction and display a preset function publishing page, wherein the function publishing page includes a function identifier of each currently available function;

[0100] The configuration file generating module 250 is used to generate the configuration file according to the function identifier selected by the user through the function publishing page.

[0101] Optionally, in the embodiment of the present invention, the function display module 240 may further include:

[0102] A business determination submodule, used for receiving a function selection instruction and obtaining the business to which the function instruction belongs;

[0103] The function display submodule is used to display a preset function publishing page, and to display the function identifier of each function available under the service on the function publishing page.

[0104] Optionally, in the embodiment of the present invention, the device may further include:

[0105] A request receiving module, used for receiving a function publishing request, wherein the function publishing request carries at least one function to be published;

[0106] The function publishing module is used to obtain each function to be published and record at least one of the address information and interface information of each function to be published when the sender of the function publishing request has function publishing authority.

[0107] Optionally, in an embodiment of the present invention, the functional encapsulation method of the data acquisition service includes at least one of functional encapsulation using FaaS technology and functional encapsulation using Groovy technology.

[0108] Optionally, in the embodiment of the present invention, the function calling module is further used to call each of the functions through multi-threading in response to the configuration document corresponding to multiple functions, and execute each of the functions based on the parameters;

[0109] Each thread is used to call and execute a function, and the functions called by each thread are different.

[0110] The data acquisition device provided by the embodiment of the present invention can achieve Figure 1 to Figure 2 To avoid repetition, the various processes implemented in the method embodiment are not described here.

[0111] Preferably, an embodiment of the present invention further provides an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the various processes of the above-mentioned data acquisition method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0112] The embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, each process of the above-mentioned data acquisition method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0113] Figure 5 A schematic diagram of the hardware structure of an electronic device for implementing various embodiments of the present invention.

[0114] The electronic device 500 includes but is not limited to: a radio frequency unit 501, a network module 502, an audio output unit 503, an input unit 504, a sensor 505, a display unit 506, a user input unit 507, an interface unit 508, a memory 509, a processor 510, and a power supply 511. Those skilled in the art will appreciate that Figure 5 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and the electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. In the embodiments of the present invention, the electronic device includes but is not limited to a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted terminal, a wearable device, and a pedometer.

[0115] It should be understood that in the embodiment of the present invention, the radio frequency unit 501 can be used for receiving and sending signals during information transmission or communication. Specifically, after receiving downlink data from the base station, it is sent to the processor 510 for processing; in addition, uplink data is sent to the base station. Generally, the radio frequency unit 501 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, etc. In addition, the radio frequency unit 501 can also communicate with the network and other devices through a wireless communication system.

[0116] The electronic device provides users with wireless broadband Internet access through the network module 502, such as helping users to send and receive emails, browse web pages, and access streaming media.

[0117] The audio output unit 503 can convert the audio data received by the RF unit 501 or the network module 502 or stored in the memory 509 into an audio signal and output it as sound. Moreover, the audio output unit 503 can also provide audio output related to a specific function performed by the electronic device 500 (for example, a call signal reception sound, a message reception sound, etc.). The audio output unit 503 includes a speaker, a buzzer, a receiver, etc.

[0118] The input unit 504 is used to receive audio or video signals. The input unit 504 may include a graphics processor (GPU) 5041 and a microphone 5042. The graphics processor 5041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The processed image frame can be displayed on the display unit 506. The image frame processed by the graphics processor 5041 can be stored in the memory 509 (or other storage medium) or sent via the radio frequency unit 501 or the network module 502. The microphone 5042 can receive sound and can process such sound into audio data. The processed audio data can be converted into a format output that can be sent to a mobile communication base station via the radio frequency unit 501 in the case of a telephone call mode.

[0119] The electronic device 500 also includes at least one sensor 505, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel 5061 according to the brightness of the ambient light, and the proximity sensor can turn off the display panel 5061 and / or the backlight when the electronic device 500 is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), and can detect the magnitude and direction of gravity when stationary, which can be used to identify the posture of the electronic device (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; the sensor 505 can also include a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, etc., which will not be repeated here.

[0120] The display unit 506 is used to display information input by the user or information provided to the user. The display unit 506 may include a display panel 5061, which may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.

[0121] The user input unit 507 can be used to receive input digital or character information, and to generate key signal input related to user settings and function control of the electronic device. Specifically, the user input unit 507 includes a touch panel 5071 and other input devices 5072. The touch panel 5071, also known as a touch screen, can collect the user's touch operation on or near it (such as the user's operation on the touch panel 5071 or near the touch panel 5071 using any suitable object or accessory such as a finger, stylus, etc.). The touch panel 5071 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the contact point coordinates, and then sends it to the processor 510, receives the command sent by the processor 510 and executes it. In addition, the touch panel 5071 can be implemented using multiple types such as resistive, capacitive, infrared and surface acoustic waves. In addition to the touch panel 5071, the user input unit 507 may also include other input devices 5072. Specifically, other input devices 5072 may include but are not limited to a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in detail here.

[0122] Furthermore, the touch panel 5071 may be overlaid on the display panel 5061. When the touch panel 5071 detects a touch operation on or near it, it transmits the information to the processor 510 to determine the type of the touch event. Then, the processor 510 provides a corresponding visual output on the display panel 5061 according to the type of the touch event. Figure 5 In the figure, the touch panel 5071 and the display panel 5061 are used as two independent components to realize the input and output functions of the electronic device. However, in some embodiments, the touch panel 5071 and the display panel 5061 can be integrated to realize the input and output functions of the electronic device, which is not limited here.

[0123] The interface unit 508 is an interface for connecting an external device to the electronic device 500. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, an audio input / output (I / O) port, a video I / O port, a headphone port, etc. The interface unit 508 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the electronic device 500 or may be used to transmit data between the electronic device 500 and an external device.

[0124] The memory 509 can be used to store software programs and various data. The memory 509 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 509 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0125] The processor 510 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. By running or executing software programs and / or modules stored in the memory 509 and calling data stored in the memory 509, it performs various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole. The processor 510 may include one or more processing units; preferably, the processor 510 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 510.

[0126] The electronic device 500 may also include a power supply 511 (such as a battery) for supplying power to each component. Preferably, the power supply 511 may be logically connected to the processor 510 through a power management system, thereby implementing functions such as charging, discharging, and power consumption management through the power management system.

[0127] In addition, the electronic device 500 includes some functional modules not shown, which will not be described in detail here.

[0128] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0129] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0130] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation modes, which are merely illustrative rather than restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are within the protection of the present invention.

[0131] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the embodiments of the present invention can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0132] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0133] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0134] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0135] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0136] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, ROM, RAM, magnetic disks, or optical disks.

[0137] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A data acquisition method, characterized in that: include: Receive a data collection instruction, wherein the data collection instruction includes parameters and a configuration file for acquiring data, wherein the configuration file includes at least one of address information and interface information of at least one function, wherein the configuration file is generated based on a selected function identifier, wherein the function is obtained by functional encapsulation for any data acquisition service, and the data acquisition services corresponding to each function are different from each other; Calling each of the functions according to the configuration file and executing each of the functions based on the parameters; Get the execution result of each function and return it; The functional encapsulation is achieved by separating the code segments corresponding to each data acquisition service from the original code segments and encapsulating them into separately called functions.

2. The method according to claim 1, characterized in that Before receiving the data collection instruction, the method further includes: Receive a function selection instruction and display a preset function publishing page, wherein the function publishing page includes a function identifier of each currently available function; The configuration file is generated according to the function identifier selected by the user through the function publishing page.

3. The method according to claim 2, characterized in that The step of receiving a function selection instruction and displaying a preset function publishing page includes: Receiving a function selection instruction, and obtaining the business to which the function selection instruction belongs; A preset function publishing page is displayed, and a function identifier of each function available under the service is displayed on the function publishing page.

4. The method according to claim 1, characterized in that: The method further comprises: receiving a function publishing request, wherein the function publishing request carries at least one function to be published; In the case that the sender of the function publishing request has function publishing authority, each of the functions to be published is obtained, and at least one of the address information and the interface information of each of the functions to be published is recorded.

5. The method according to any one of claims 1 to 4, characterized in that The functional encapsulation method of the data acquisition service includes at least one of functional encapsulation using FaaS technology and functional encapsulation using Groovy technology.

6. The method according to any one of claims 1 to 4, characterized in that The step of calling each of the functions according to the configuration file and executing each of the functions based on the parameters comprises: In response to the configuration document corresponding to a plurality of functions, calling each of the functions through multithreading, and executing each of the functions based on the parameters; Each thread is used to call and execute a function, and the functions called by each thread are different.

7. A data acquisition device, characterized in that: include: An instruction receiving module, used to receive a data collection instruction, wherein the data collection instruction includes parameters and a configuration file for acquiring data, wherein the configuration file includes at least one of address information and interface information of at least one function, wherein the configuration file is generated based on a selected function identifier, wherein the function is obtained by functional encapsulation for any data acquisition service, and the data acquisition services corresponding to each function are different from each other; A function calling module, used for calling each of the functions according to the configuration file and executing each of the functions based on the parameters; A data return module, used to obtain and return the execution result of each function; The functional encapsulation is achieved by separating the code segments corresponding to each data acquisition service from the original code segments and encapsulating them into separately called functions.

8. The device according to claim 7, characterized in that The device further comprises: A function display module, used to receive a function selection instruction and display a preset function publishing page, wherein the function publishing page includes a function identifier of each currently available function; The configuration file generation module is used to generate the configuration file according to the function identifier selected by the user through the function publishing page.

9. The device according to claim 8, characterized in that The function display module includes: A business determination submodule, used for receiving a function selection instruction and obtaining the business to which the function selection instruction belongs; The function display submodule is used to display a preset function publishing page, and to display the function identifier of each function available under the service on the function publishing page.

10. The device according to claim 9, characterized in that The device also includes: A request receiving module, used for receiving a function publishing request, wherein the function publishing request carries at least one function to be published; The function publishing module is used to obtain each function to be published and record at least one of the address information and interface information of each function to be published when the sender of the function publishing request has function publishing authority.

11. The device according to any one of claims 7 to 10, characterized in that The functional encapsulation method of the data acquisition service includes at least one of functional encapsulation using FaaS technology and functional encapsulation using Groovy technology.

12. The device according to any one of claims 7 to 10, characterized in that The function calling module is further used for calling each of the functions through multi-threading in response to the configuration document corresponding to multiple functions, and executing each of the functions based on the parameters; Each thread is used to call and execute a function, and the functions called by each thread are different.

13. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the data acquisition method according to any one of claims 1 to 6.

14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the data acquisition method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Method, apparatus, computer device and storage medium for configuring routing

    CN109039751A

  • Service processing method and device of gateway system, and equipment

    CN110365751A

  • Apparatus, system, and method for encapsulating logical units of work using business objects

    US20060282400A1

  • System and method for a unified interface to networked webservices

    US20180034924A1

  • Function as a service gateway

    US20190349447A1