The present application is a divisional application of patent 2021103537850 of 2021.04.01 application.
Disclosure of Invention
To this end, the present invention provides a data processing method, a data interaction system and a computing device in an effort to solve or at least alleviate the above-presented problems.
According to one aspect of the invention, a data processing method is provided, which is executed in a proxy layer of an operating system, wherein the proxy layer comprises one or more transmission interfaces and processing interfaces, the method comprises the steps of acquiring a data structure sent by a data providing application based on a corresponding transmission interface, receiving a data processing request sent by a data requesting application based on a corresponding processing interface, request parameters of the data processing request comprise a target data structure type, acquiring a data structure template corresponding to the processing interface, executing corresponding data processing based on the data structure template and the request parameters, and returning a data processing result to the data requesting application.
Optionally, in the data processing method according to the invention, before acquiring the data structure sent by the data providing application based on the transmission interface, the method comprises the steps of generating the transmission interface according to the data provided by the data providing application and generating a corresponding processing interface.
Optionally, in the data processing method according to the invention, the step of generating the transmission interface according to the data provided by the data providing application comprises the steps of obtaining the data suitable for being provided by the data providing application, obtaining one or more corresponding data structures based on the data, constructing corresponding data structure templates according to the data structures, and generating the corresponding transmission interface according to each data structure template.
Optionally, in the data processing method according to the present invention, after generating the corresponding transmission interfaces according to each data structure template, the method further includes the step of establishing an association between the transmission interfaces and the data providing application so that the data providing application transmits the data structures based on the transmission interfaces.
Optionally, in the data processing method according to the present invention, the data structure template includes one or more data structure types, each data structure type corresponding to an attribute variable.
Optionally, in the data processing method according to the present invention, the interface parameters of the transmission interface include one or more key-value pairs, each key-value pair corresponding to a data structure type and a corresponding attribute variable in the data structure template.
Optionally, in the data processing method according to the invention, generating the corresponding processing interface comprises generating the corresponding processing interface according to each data structure template.
According to one aspect of the present invention, there is provided a data interaction system, an agent layer comprising one or more transport interfaces and processing interfaces adapted to perform the method as described above, a data providing application adapted to send a data structure to the agent layer based on the respective transport interfaces, and a data requesting application adapted to send a data processing request to the agent layer based on the respective processing interfaces and to receive data processing results returned by the agent layer after performing the respective data processing based on the data structure templates and request parameters corresponding to the processing interfaces.
According to one aspect of the invention there is provided a computing device comprising at least one processor, and a memory storing program instructions, wherein the program instructions are configured to be adapted to be executed by the at least one processor, the program instructions comprising instructions for performing the method as described above.
According to one aspect of the present invention, there is provided a readable storage medium storing program instructions which, when read and executed by a computing device, cause the computing device to perform a method as described above.
According to the technical scheme of the invention, a data processing method and a data interaction system are provided, wherein the agent layer can construct a data structure template according to data provided by a data providing application, and a transmission interface and a corresponding processing interface are generated based on the data structure template. The proxy-based layer may provide a unified transport interface for a plurality of data-providing applications such that the data-providing applications may send data structures to the proxy layer based on the unified transport interface. Also, the proxy layer may provide a unified processing interface for the plurality of data request applications such that the data request applications may proxy layer processing data based on the unified processing interface. Thus, each transmission interface and each processing interface created based on the agent layer can be used for data interaction and data processing requirements of various applications, and the data requirements of various services are met. According to the technical scheme of the invention, the proxy layer can integrate the data structure provided by the data providing application, and complex data processing operation is uniformly executed by the proxy layer, so that the complex process and processing deviation of each data request application for executing data analysis and data processing are avoided, and the development efficiency of the data request application is improved.
Furthermore, according to the technical scheme of the invention, when the interface function needs to be expanded, the new function can be realized only by newly adding the key value pair corresponding to the new function in the data byte stream of the interface, the original key value pair of the interface is not required to be changed, and the function before the interface is not influenced, thereby realizing the forward compatibility effect.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
Fig. 1 is a schematic block diagram of an example computing device 100.
As shown in FIG. 1, in a basic configuration 102, a computing device 100 typically includes a system memory 106 and one or more processors 104. The memory bus 108 may be used for communication between the processor 104 and the system memory 106.
Depending on the desired configuration, the processor 104 may be any type of processing including, but not limited to, a microprocessor (UP), a microcontroller (UC), a digital information processor (DSP), or any combination thereof. The processor 104 may include one or more levels of caches, such as a first level cache 110 and a second level cache 112, a processor core 114, and registers 116. The example processor core 114 may include an Arithmetic Logic Unit (ALU), a Floating Point Unit (FPU), a digital signal processing core (DSP core), or any combination thereof. The example memory controller 118 may be used with the processor 104, or in some implementations, the memory controller 118 may be an internal part of the processor 104.
Depending on the desired configuration, system memory 106 may be any type of memory including, but not limited to, volatile memory (such as RAM), non-volatile memory (such as ROM, flash memory, etc.), or any combination thereof. The system memory 106 may include an operating system 120, one or more applications 122, and program data 124. In some implementations, the application 122 may be arranged to execute instructions on an operating system by the one or more processors 104 using the program data 124.
Computing device 100 may also include a storage interface bus 134. Storage interface bus 134 enables communication from storage devices 132 (e.g., removable storage 136 and non-removable storage 138) to base configuration 102 via bus/interface controller 130. At least a portion of the operating system 120, applications 122, and data 124 may be stored on removable storage 136 and/or non-removable storage 138, and loaded into the system memory 106 via the storage interface bus 134 and executed by the one or more processors 104 when the computing device 100 is powered up or the application 122 is to be executed.
Computing device 100 may also include an interface bus 140 that facilitates communication from various interface devices (e.g., output devices 142, peripheral interfaces 144, and communication devices 146) to basic configuration 102 via bus/interface controller 130. The example output device 142 includes a graphics processing unit 148 and an audio processing unit 150. They may be configured to facilitate communication with various external devices such as a display or speakers via one or more a/V ports 152. Example peripheral interfaces 144 may include a serial interface controller 154 and a parallel interface controller 156, which may be configured to facilitate communication with external devices such as input devices (e.g., keyboard, mouse, pen, voice input device, touch input device) or other peripherals (e.g., printer, scanner, etc.) via one or more I/O ports 158. An example communication device 146 may include a network controller 160, which may be arranged to facilitate communication with one or more other computing devices 162 via one or more communication ports 164 over a network communication link.
The network communication link may be one example of a communication medium. Communication media may typically be embodied by computer readable instructions, data structures, program modules, and may include any information delivery media in a modulated data signal, such as a carrier wave or other transport mechanism. A "modulated data signal" may be a signal that has one or more of its data set or changed in such a manner as to encode information in the signal. By way of non-limiting example, communication media may include wired media such as a wired network or special purpose network, and wireless media such as acoustic, radio Frequency (RF), microwave, infrared (IR) or other wireless media. The term computer readable media as used herein may include both storage media and communication media.
Computing device 100 may be implemented as a personal computer including desktop and notebook computer configurations. Of course, computing device 100 may also be implemented as part of a small-sized portable (or mobile) electronic device such as a cellular telephone, a digital camera, a Personal Digital Assistant (PDA), a personal media player device, a wireless web-watch device, a personal headset device, an application-specific device, or a hybrid device that may include any of the above functions. And may even be implemented as servers, such as file servers, database servers, application servers, WEB servers, and the like. The embodiments of the present invention are not limited in this regard.
In an embodiment in accordance with the invention, the operating system of computing device 100 is configured to perform data processing method 300 in accordance with the invention. Wherein the agent layer 250 is disposed on an operating system of the computing device 100, the agent layer 250 comprising a plurality of program instructions for executing the data processing method 300 according to the present invention, such that the data processing method 300 of the present invention may be executed at the agent layer.
FIG. 2 shows a schematic diagram of a data interaction system 200 according to one embodiment of the invention. The data interaction system 200 resides in a computing device (such as the computing device 100 described previously) and may be disposed above an operating system. The data interaction system 200 according to the present invention may be used for data interaction of applications with system services.
In an embodiment in accordance with the invention, as shown in FIG. 2, a data interaction system 200 includes one or more data providing applications 210, a proxy layer 250, and one or more data requesting applications 220. Wherein the proxy layer 250 is adapted to perform the data processing method 300 of the present invention, by performing the data processing method 300 of the present invention, it is possible to implement the data providing application 210 and the data requesting application 220 to implement data interaction with the operating system based on the proxy layer 350. The data processing method 300 of the present invention will be described in detail below.
It should be noted that, the data providing application 210 is an application adapted to provide data, and the data requesting application 220 is an application adapted to request data. Here, the present invention is not limited to the specific kind and number of data providing applications and data requesting applications. By providing the proxy layer 250, the data provided by the data providing application 210 can be uniformly processed by the proxy layer 250 and implemented as a corresponding data interface, so as to provide a uniform data interface for one or more data requesting applications 220 which need to use the data. Here, the present invention is not limited to the specific structure of the data provided by the data providing application 210.
According to one embodiment of the invention, the proxy layer 250 may provide one or more transport interfaces and processing interfaces to the application. Specifically, the proxy layer 250 may generate corresponding one or more transport interfaces and corresponding one or more processing interfaces in advance from the data construct provided by the data providing application 210, and provide these transport interfaces and processing interfaces to the application. Wherein the proxy layer 250 may provide a transport interface for the data-providing application 210 such that the data-providing application 210 transmits a data structure to the proxy layer 250 based on the corresponding transport interface, and the proxy layer 250 may provide a processing interface for the data-requesting application 220 such that the data-requesting application 220 requests data from the proxy layer 250 or requests the proxy layer 250 to process data based on the corresponding processing interface.
FIG. 2 illustrates a flow chart of a data processing method 300 according to one embodiment of the invention.
As shown in fig. 2, the method 300 begins at step S310. In step S310, the acquired data providing application 310 transmits a data structure based on the corresponding transmission interface. Here, the data structure transmitted by the data providing application 310 based on the corresponding transmission interface is a specific data structure instance including specific data contents.
It should be noted that, before executing step S310, the proxy layer 250 constructs and generates one or more corresponding transmission interfaces and one or more corresponding processing interfaces in advance according to the data provided by the data providing application 210, so as to provide these transmission interfaces and processing interfaces to the application. Wherein a transport interface is provided for the data providing application 210 and a processing interface is provided for the data requesting application 220.
Specifically, when generating the transmission interface according to the data provided by the data providing application 210, the agent layer obtains all the data that can be provided by the data providing application 210 in advance, and by analyzing and parsing the data provided by the data providing application 210, one or more specific data structures (specific implementation) can be obtained based on the data.
After retrieving one or more specific data structures based on the data provided by the data providing application 210, the proxy layer 250 may convert the specific data structures into corresponding data structure templates. Specifically, the concrete data structure (concrete implementation) is converted into the corresponding data structure template by abstract processing on the concrete data structure and discarding concrete contents and implementation details in the data structure instance.
Specifically, the data providing application 210 provides a data structure designed for a specific service, and is applicable only to the specific service. On the basis of the method, the specific data structure is subjected to abstract processing, so that a corresponding data structure template is constructed according to the specific data structure, and the constructed data structure template can adapt to the data transmission and data processing requirements of various services. Here, a corresponding one of the data structure templates may be constructed according to each of the acquired specific data structures, or one of the data structure templates may be constructed according to the acquired associated multiple data structures. That is, a data structure template may be constructed based on one or more specific data structures.
In one embodiment, each data structure template resulting from the abstract transformations may include one or more data structure types (tags). Here, each data structure type corresponds to an attribute variable.
After the data structure templates are constructed, corresponding transmission interfaces are respectively generated according to each constructed data structure template, wherein the data structure templates and the transmission interfaces are in mutual corresponding relation, each transmission interface corresponds to one data structure template respectively, and each data structure template can comprise one or more data structure types, so that each transmission interface can correspond to one or more data structure types. Based on this, the transport interface generated according to the data structure template can be used for the transport requirements of various service data, and the proxy layer 250 can provide various data providing applications by constructing a unified transport interface, and these applications can call the existing transport interface to provide specific data structures under different service scenarios to the proxy layer 250. It should be appreciated that the data providing application 210, when providing data to the proxy layer, sends the data to the proxy layer 250 by invoking a corresponding transport interface based on which the data provided by the data providing application 210 can be converted into a corresponding data structure to be sent to the proxy layer 250.
In one embodiment, the interface parameters of the transport interface may be implemented as a key-to-byte stream format, such as, but not limited to, json data format. Here, each key value in the interface parameter corresponds to a data structure type and a corresponding attribute variable in the data structure template. Therefore, when the function of the interface needs to be expanded, the new function can be realized only by newly adding the key value pair corresponding to the new function in the data byte stream of the interface, the original existing key value pair of the interface is not required to be changed, and the function before the interface is not influenced, so that the forward compatibility effect is realized.
It should be further noted that the data structure-based templates are constructed from data provided by the data providing application 210, and thus, one or more transmission interfaces corresponding to the data providing application 210 are generated from the constructed one or more data structure templates. According to one embodiment, the proxy layer 250 establishes an association between one or more transport interfaces and the data providing application 210, that is, binds the data providing application 210 to the one or more transport interfaces, after the one or more transport interfaces are finally generated according to the data provided by the data providing application 210. In this way, the data-providing application 210 may directly invoke the transport interfaces associated therewith, based on which the corresponding concrete data structures are provided to the proxy layer 250.
According to one embodiment of the invention, the proxy layer 250, after constructing one or more transport interfaces from the data provided by the data providing application 210, also constructs and generates a corresponding one or more processing interfaces. It should be noted that, each processing interface is also generated according to each data structure template constructed as described above, specifically, for each constructed data structure template, a processing interface corresponding to the data structure template is generated separately. It will be appreciated that the processing interface and the transmission interface are also in a corresponding relationship to each other.
That is, each processing interface created by the proxy layer 250 build corresponds to a data structure template, and each data structure template may include one or more data structure types, such that each processing interface may correspond to one or more data structure types. Based on this, the processing interface generated according to the data structure template can meet the service requirements of multiple applications, the proxy layer 250 can provide various data request applications by constructing a unified processing interface, and these data request applications can call the existing processing interface to send data processing requests to the proxy layer 250, and the corresponding data processing requirements are realized based on the processing interface of the proxy layer.
It should also be noted that since each processing interface corresponds to a data structure template that includes one or more data structure types, in other words, each processing interface may correspond to one or more data structure types. Thus, when the data request application calls the processing interface, the data processing request needs to be sent to the corresponding processing interface by taking the target data structure type as a request parameter.
Specifically, the proxy layer 250 may perform steps S320 to S330 described below based on the one or more processing interfaces constructed.
In step S310, the received data request application 220 processes the request for data transmitted based on the corresponding processing interface. Here, the request parameters of the data processing request include the target data structure type.
Subsequently, in step S320, a data structure template corresponding to the processing interface is acquired, the proxy layer performs corresponding data processing based on the data structure template and the request parameters (e.g., the target data structure type), and returns the data processing result to the data request application 220. Here, it should be understood that the proxy layer may generate a corresponding target data structure (specific implementation) according to the data structure template and the target data structure type, and perform a corresponding data processing operation according to the specific implementation target data structure, to obtain a data processing result.
It should be noted that, after the data request application 220 invokes the processing interface, the proxy layer 250 implements a specific target data structure, and performs a corresponding operation according to the specific implemented target data structure, so as to return a data processing result to the data request application 220. Here, the proxy layer may return the processing result to the data request application 220 in the form of a parameter. In this way, the complex data processing operation corresponding to each data structure template is uniformly executed by the proxy layer 250, so that the complex and repeated processes of analyzing the data structure and executing the data processing operation required by each data request application in the prior art are avoided, the deviation of different applications in the process of analyzing the data structure and processing the data is avoided, the development difficulty of the data request application is reduced, and the development efficiency is improved.
For example, in an operating system such as UOS or Windows, establishing a bluetooth connection is a specific example of implementation of data interaction between an application and a system service. According to prior art embodiments, when one or more applications require the use of bluetooth functionality, it is first necessary to query whether bluetooth is available. Under the condition that an interface provided by an operating system is directly used, each application needs to know the whole set of Bluetooth processing logic, the application judges whether the current hardware is connected with the Bluetooth adapter or not, then judges whether the adapter is in an open state or not and whether the adapter is in an ignore state or not, and finally acquires data such as the MAC address of Bluetooth and the like so as to establish connection with the designated Bluetooth.
According to the technical scheme of the invention, in the implementation mode of establishing the Bluetooth connection, the proxy layer performs unified processing on data in the Bluetooth connection process, builds a corresponding data structure template, and provides a unified interface for all applications needing to use the Bluetooth function. For example, the proxy layer in the present invention may provide a connection interface (ConnectBlutooth) for the above bluetooth connection flow, and when the application requesting the bluetooth connection function calls the connection interface, only the identifier (request parameter) of the bluetooth address of the opposite end needs to be provided, all connection checking and connection establishment are passed to the proxy layer for processing, and finally, the proxy layer returns an error code to the application to feed back the result of executing the bluetooth connection. For the proxy interface of the bluetooth connection, the interface is ConnectBlutooth, the request parameter is the opposite terminal address-string, and the returned data is the bluetooth connection result-int.
Here, the above establishment of the bluetooth connection is only one specific implementation of the method 300 according to the present invention, but the present invention is not limited to this implementation. It should be noted that, the specific implementation of data interaction between applications and systems in the prior art is within the scope of the present invention.
In summary, according to the technical scheme of the invention, the proxy layer constructs a data structure template according to data provided by the data providing application, and generates a transmission interface and a corresponding processing interface based on the data structure template. The proxy-based layer may provide a unified transport interface for a plurality of data-providing applications such that the data-providing applications may send data structures to the proxy layer based on the unified transport interface. Also, the proxy layer may provide a unified processing interface for the plurality of data request applications such that the data request applications may proxy layer processing data based on the unified processing interface. Thus, the transport interface and the processing interface created based on the proxy layer in the invention can be used for data interaction and data processing requirements of various applications. According to the technical scheme of the invention, the proxy layer can integrate the data structure provided by the data providing application, and complex data processing operation is uniformly executed by the proxy layer, so that the complex process and processing deviation of each data request application for executing data analysis and data processing are avoided, and the development efficiency of the data request application is improved.
Furthermore, according to the technical scheme of the invention, when the interface function needs to be expanded, the new function can be realized only by newly adding the key value pair corresponding to the new function in the data byte stream of the interface, the original key value pair of the interface is not required to be changed, and the function before the interface is not influenced, thereby realizing the forward compatibility effect.
The various techniques described herein may be implemented in connection with hardware or software or, alternatively, with a combination of both. Thus, the methods and apparatus of the present invention, or certain aspects or portions of the methods and apparatus of the present invention, may take the form of program code (i.e., instructions) embodied in tangible media, such as removable hard drives, U-drives, floppy diskettes, CD-ROMs, or any other machine-readable storage medium, wherein, when the program is loaded into and executed by a machine, such as a computer, the machine becomes an apparatus for practicing the invention.
In the case of program code execution on programmable computers, the computing device will generally include a processor, a storage medium readable by the processor (including volatile and non-volatile memory and/or storage elements), at least one input device, and at least one output device. The processor is configured to execute the multi-language garbage text recognition method according to the instructions in the program codes stored in the memory.
By way of example, and not limitation, readable media comprise readable storage media and communication media. The readable storage medium stores information such as computer readable instructions, data structures, program modules, or other data. Communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media. Combinations of any of the above are also included within the scope of readable media.
In the description provided herein, algorithms and displays are not inherently related to any particular computer, virtual system, or other apparatus. Various general-purpose systems may also be used with examples of the invention. The required structure for a construction of such a system is apparent from the description above. In addition, the present invention is not directed to any particular programming language. It will be appreciated that the teachings of the present invention described herein may be implemented in a variety of programming languages, and the above description of specific languages is provided for disclosure of enablement and best mode of the present invention.
In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. This method of disclosure, however, is not to be interpreted as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules or units or components of the devices in the examples disclosed herein may be arranged in a device as described in this embodiment, or alternatively may be located in one or more devices different from the devices in this example. The modules in the foregoing examples may be combined into one module or may be further divided into a plurality of sub-modules.
Those skilled in the art will appreciate that the modules in the apparatus of the embodiments may be adaptively changed and disposed in one or more apparatuses different from the embodiments. The modules or units or components of the embodiments may be combined into one module or unit or component and, furthermore, they may be divided into a plurality of sub-modules or sub-units or sub-components. Any combination of all features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or units of any method or apparatus so disclosed, may be used in combination, except insofar as at least some of such features and/or processes or units are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings), may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features but not others included in other embodiments, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments can be used in any combination.
Furthermore, some of the embodiments are described herein as methods or combinations of method elements that may be implemented by a processor of a computer system or by other means of performing the functions. Thus, a processor with the necessary instructions for implementing the described method or method element forms a means for implementing the method or method element. Furthermore, the elements of the apparatus embodiments described herein are examples of apparatus for performing the functions performed by the elements for the purpose of practicing the invention.
As used herein, unless otherwise specified the use of the ordinal terms "first," "second," "third," etc., to describe a general object merely denote different instances of like objects, and are not intended to imply that the objects so described must have a given order, either temporally, spatially, in ranking, or in any other manner.
While the invention has been described with respect to a limited number of embodiments, those skilled in the art, having benefit of the above description, will appreciate that other embodiments are contemplated within the scope of the invention as described herein. Furthermore, it should be noted that the language used in the specification has been principally selected for readability and instructional purposes, and may not have been selected to delineate or circumscribe the inventive subject matter. Accordingly, many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the appended claims. The disclosure of the present invention is intended to be illustrative, but not limiting, of the scope of the invention, which is defined by the appended claims.