CN115268935A - Data processing method and device - Google Patents

Data processing method and device Download PDF

Info

Publication number
CN115268935A
CN115268935A CN202210968743.2A CN202210968743A CN115268935A CN 115268935 A CN115268935 A CN 115268935A CN 202210968743 A CN202210968743 A CN 202210968743A CN 115268935 A CN115268935 A CN 115268935A
Authority
CN
China
Prior art keywords
client
server
class
annotation
field name
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210968743.2A
Other languages
Chinese (zh)
Inventor
饶福贵
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202210968743.2A priority Critical patent/CN115268935A/en
Publication of CN115268935A publication Critical patent/CN115268935A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • G06F8/427Parsing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The disclosure relates to a data processing method and a data processing device, which relate to the technical field of data processing, wherein the method comprises the following steps: firstly, obtaining annotation information corresponding to class attributes of a client, wherein the annotation information comprises server-end interface field names which are configured through an annotation format and correspond to the class attribute field names; then according to the annotation information, obtaining mapping information of the client class attribute field name and the server end interface field name; and then according to the mapping information, executing a program instruction by using the server-side interface field name corresponding to the client-side class attribute field name so as to process data of the client side and the server side. By applying the technical scheme disclosed by the invention, the corresponding relationship maintained when the client class attribute field name is inconsistent with the server-side interface field name can be reduced, the maintenance cost of research personnel on the server-side interface field can be reduced, and the work efficiency of research and development engineers is improved.

Description

Data processing method and device
Technical Field
The present disclosure relates to the field of data processing technologies, and in particular, to a data processing method and apparatus.
Background
In software project development, code may be out of specification, possibly due to history or developer capability issues, such as field name naming rules in code that do not satisfy project naming rules. Therefore, the field name of the client class attribute is inconsistent with the naming mode of the field name of the server-side interface.
In the related art, when the field name of the client class attribute is not consistent with the name of the field name of the server-side interface, the field name is parsed at the data parsing position according to the designated field defined by the server-side interface. However, the data returned by the server side has more hierarchies, so that the client side can also analyze and write the fields in multiple hierarchies, the codes of the analyzed fields become thick and heavy, the code readability becomes poor, and the maintenance cost is high.
Disclosure of Invention
The present disclosure provides a data processing method and apparatus, to at least solve the technical problems in the related art that a field is parsed at a data parsing site according to a designated field defined by a server-side interface, and a client side writes the field parsing in multiple hierarchies, which results in a thick and heavy code of the parsed field, poor code readability, and high maintenance cost. The technical scheme of the disclosure is as follows:
according to a first aspect of the embodiments of the present disclosure, there is provided a data processing method, including:
obtaining annotation information corresponding to class attributes of a client, wherein the annotation information comprises server-side interface field names which are configured through an annotation format and correspond to the class attribute field names;
acquiring mapping information of the client class attribute field name and the server end interface field name according to the annotation information;
and according to the mapping information, executing a program instruction by using the name of the server-side interface field corresponding to the name of the client-side class attribute field so as to process data of the client side and the server side.
According to a second aspect of the embodiments of the present disclosure, there is provided a data processing apparatus including:
the system comprises an acquisition unit, a processing unit and a display unit, wherein the acquisition unit is configured to acquire annotation information corresponding to class attributes of a client, and the annotation information comprises server-side interface field names which are configured through an annotation format and correspond to the class attribute field names;
the obtaining unit is further configured to obtain mapping information between the client class attribute field name and the server-side interface field name according to the annotation information;
and the processing unit is configured to execute a program instruction by using the server-side interface field name corresponding to the client-side class attribute field name according to the mapping information so as to perform data processing between the client side and the server side.
According to a third aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including: a processor and a memory for storing processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the data processing method of the first aspect as described above.
According to a fourth aspect of embodiments of the present disclosure, there is provided a storage medium, wherein instructions that, when executed by a processor of an electronic device, enable the electronic device to perform the data processing method of the first aspect.
According to a fifth aspect of embodiments of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the data processing method of the first aspect as described above.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
compared with the prior art, the method and the device have the advantages that when the field name of the client class attribute is inconsistent with the command mode of the server interface field name, class attribute marking can be carried out in an annotation mode, and the annotation information comprises the server interface field name which is configured in an annotation format and corresponds to the field name of the client class attribute. When the attribute field of the client and the server is analyzed or the attribute field requests are made, the mapping information of the name of the client class attribute field and the name of the server-side interface field can be obtained according to the annotation information corresponding to the class attribute of the client; and then according to the mapping information, executing a program instruction by using the name of the server-side interface field corresponding to the name of the client-side class attribute field so as to process data of the client side and the server side. By applying the technical scheme disclosed by the invention, the corresponding relationship maintained when the client class attribute field name is inconsistent with the server-side interface field name can be reduced, the maintenance cost of research personnel on the server-side interface field can be reduced, and the work efficiency of research and development engineers is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
FIG. 1 is a flow chart illustrating a method of data processing according to an exemplary embodiment.
FIG. 2 is a flow diagram illustrating another method of data processing according to an example embodiment.
FIG. 3 is a block diagram illustrating an example of a system in accordance with an example embodiment.
FIG. 4 is a flowchart illustrating an example method of applying according to an example embodiment.
FIG. 5 is a block diagram illustrating a data processing apparatus according to an example embodiment.
FIG. 6 is a block diagram illustrating an electronic device in accordance with an example embodiment.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in other sequences than those illustrated or described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
In order to at least solve the technical problems that in the related art, the field analysis is written in multiple hierarchies by a client according to the analysis of the specified field defined by the server-side interface at the data analysis position, so that the code of the analyzed field becomes thick and heavy, the code readability becomes poor, and the maintenance cost is high. The present embodiment provides a data processing method, as shown in fig. 1, the method includes the following steps:
step 101, obtaining annotation information corresponding to the class attribute of the client.
The annotation information may include server-side interface field names corresponding to the class attribute field names (which may include attribute field names of different classes and/or different attribute field names of the same class) configured in the annotation format. For this embodiment, the name of the client class attribute field may be configured with the name of the corresponding server interface field in an annotation manner. The annotation information corresponding to each of these class attributes may be preconfigured.
For example, when the field name of the client class attribute is inconsistent with the command mode of the server interface field name, the class attribute can be marked in an annotation mode, and the annotation information includes the server-side interface field name corresponding to the client class attribute field name and configured in an annotation format.
And 102, acquiring mapping information of the client class attribute field name and the server end interface field name according to the annotation information.
The mapping information includes the names of the server-side interface fields corresponding to the different attribute field names. For example, mapping information between field names with different attributes and server-side interface field names is obtained through class attributes of the client and annotation information corresponding to the class attributes.
And 103, executing a program instruction by utilizing the server-side interface field name corresponding to the client-side class attribute field name according to the mapping information so as to process data of the client side and the server side.
For example, when the attribute fields of the client and server are analyzed (server data is analyzed) or the attribute fields are requested (server data is requested), the name of the server interface field corresponding to the name of the client class attribute field can be obtained from the mapping information, and the name of the client class attribute field is converted into the name of the corresponding server interface field in the execution of the program instruction, so as to implement the execution of the program instruction code, and further implement the accurate processing of the data requested by the attribute fields of the client and server.
Compared with the prior art, in the embodiment, when the field name of the client class attribute is not consistent with the command mode of the server interface field name, the class attribute can be marked in an annotation mode, and the annotation information includes the server-side interface field name which is configured in an annotation format and corresponds to the client class attribute field name. When the attribute field of the client and the server is analyzed or the attribute field requests are made, the mapping information of the name of the client class attribute field and the name of the server-side interface field can be obtained according to the annotation information corresponding to the class attribute of the client; and then according to the mapping information, executing a program instruction by using the name of the server-side interface field corresponding to the name of the client-side class attribute field so as to process data of the client side and the server side. By applying the technical scheme of the embodiment, the corresponding relationship maintained when the client class attribute field name is inconsistent with the server-side interface field name can be reduced, the maintenance cost of research personnel on the server-side interface field can be reduced, and the work efficiency of research and development engineers is improved.
Further, as a refinement and an extension of the foregoing embodiment, in order to fully describe a specific implementation process of the method of the present embodiment, the present embodiment provides a specific method as shown in fig. 2, where the method includes:
step 201, establishing a configuration file of the annotation analysis entity class.
Optionally, step 201 may specifically include: and establishing a configuration file of the Class of the interface type as a configuration file of the annotation analysis entity Class. For example, a Class of an interface type (interface) is established in a program or a custom Software Development Kit (SDK) as a params name. Java file adds the interface method named value () for other calling entity class to use this method to execute program.
Step 202, marking the name of the server-side interface field corresponding to the name of the client-side class attribute field through the annotation format in the configuration file to obtain annotation information.
For example, the client-side class attribute is marked in an "annotation parsing" format (annotation format) and is configured to correspond to the server-side attribute field name, and is used by a simple configuration. If the client-side attribute field name is defined as accountName (hump type), and the server-side interface field name is defined as accountName (underline type), the configuration is performed by the annotation format: @ ParamsName ("account _ name") public account name. This ensures that the client-side defined fields and the server-side defined fields are configured in the same context, so that the relationship of the data hierarchy returned by the server side does not need to be concerned.
Further, in order to meet the update requirement, after obtaining the annotation information by configuration, the method of this embodiment may further include: acquiring the update information of the field name of the server-side interface; and then updating the server-side interface field names in the annotation information corresponding to the client-side class attributes in the configuration file according to the updating information. For example, when the server side needs to modify the name of the interface field for some reasons, only the annotation position of the class attribute field corresponding to the client side needs to be found for modification, the problem of the data hierarchy of the code does not need to be concerned, and the maintenance cost is saved.
And 203, acquiring annotation information corresponding to the class attribute of the client when the attribute field of the client and the attribute field of the server are analyzed or the attribute field is requested.
And 204, acquiring mapping information of the client class attribute field name and the server end interface field name according to the annotation information.
Optionally, step 204 may specifically include: traversing annotation information corresponding to the marked class attribute in the configuration file; if the configuration file has annotation information corresponding to the current class attribute of the client, taking the field name of the current class attribute as a key, taking the annotation information corresponding to the current class attribute as a value, and storing the key value pair; if the annotation information corresponding to the current class attribute does not exist in the configuration file, the field names of the current class attribute are respectively used as keys and values, and key value pair storage is carried out. By means of the key value pair mode, mapping information of the client class attribute field name and the server end interface field name can be accurately obtained according to the annotation information.
Illustratively, the traversing annotation information corresponding to the labeled class attribute in the configuration file may specifically include: and respectively inheriting the basic data class with the data class of the annotation information marked in the configuration file, acquiring all class attributes of the client in the basic data class, and traversing the annotation information corresponding to each class attribute through the field names of the all class attributes.
For example, the data class of the annotation information marked in the configuration file inherits the paramsEntity basic data class, all attributes of the current class are obtained in the data class, corresponding annotation information is traversed through all attribute names, and when the annotation information corresponding to the current class attribute of the client exists in the ParamsName. Java, when there is no annotation information corresponding to the current class attribute of the client, storing the field name of the current class attribute of the client into the key and value fields of the data class of the paramsmmap respectively, thereby realizing storage in a key-value pair manner. Where annotation information is not required, then @ ParamsName (NULL) may be used for tagging out of use.
Step 205, according to the mapping information, executing the program instruction by using the server-side interface field name corresponding to the client-side class attribute field name, so as to perform data processing between the client side and the server side.
Optionally, step 205 may specifically include: inquiring by using the client class attribute field name as a key from the stored key value pair to obtain a corresponding value; and if the obtained value is annotation information, executing the program instruction by utilizing the server-side interface field name corresponding to the client-side attribute field name in the annotation information. For example, when the attribute field is analyzed or requested by a server, the client attribute field name is used as a key to query from the ParamsMap data class respectively, so as to obtain a corresponding value to execute a corresponding program instruction, thereby realizing the real data use of the server and achieving the effect of attribute name conversion, wherein if the value is annotation information, the client attribute field name can be converted into the server interface field name corresponding to the annotation information to realize the execution of program instruction codes, thereby realizing the accurate processing of the data requested by the client and server attribute field.
In order to further illustrate the specific implementation process of the above embodiment, the following application scenarios are given, which are not limited herein:
it is now common for maintenance personnel to maintain some old projects, sometimes with slightly out of specification code, possibly due to historical or developer capability issues. For example, json may need to be deserialized into entities when requesting network data; the field name naming rule in the code does not satisfy the item naming rule (such as hump type). Therefore, at present, the readability of the code needs to be increased and the accuracy of the code needs to be ensured. In order to guarantee the requirements, naming needs to be carried out according to the self item naming rule when declaring the class field, and the name of the server end field is used for analyzing when analyzing the data of the server end interface, which undoubtedly increases the corresponding relation of maintaining the inconsistency of the attribute field of the client end class and the field of the server end interface; in addition, once the name of the server-side interface field is modified, the corresponding relation is also modified, and the problem of maintaining the historical version of the code can occur.
In the related technology, when the field name of the client class attribute is inconsistent with the naming mode of the field name of the server interface, the field name is analyzed at the data analysis position according to the specified field defined by the server interface; when the server side needs to modify the name of the interface field for some reason, the resolution of the field is re-modified according to the modified field defined by the server side interface at the data resolution part. However, in the related technology, the data is analyzed according to the designated fields defined by the server-side interface, and because the data returned by the server side has more hierarchies, the client side also writes the field analysis in multiple hierarchies, so that the codes of the analyzed fields become thick and heavy, and the code readability becomes poor, and the maintenance cost is high. When the server side modifies the interface field, the modified field needs to be found for modification, so that the developer needs to have stronger code familiarity; and aggravate the corresponding relation maintained when the attribute field name of the client end class is inconsistent with the interface field name of the server end; the attribute name conversion between the client and the server cannot be achieved through simple attribute name configuration.
In order to solve the above problem, based on the method of this embodiment, when the field name of the client-side class attribute is not consistent with the naming mode of the server-side interface field name, the class attribute can be marked in an annotation mode, and the marked position, mode and hierarchy are consistent. When the server needs to modify the name of the interface field for some reasons, the annotation position of the field corresponding to the client needs to be found for modification, and the problem of the data hierarchy of the code does not need to be concerned. The corresponding relation maintained when the client class attribute field name is inconsistent with the server end interface field name can be reduced; then, the attribute name conversion between the server side and the server side can be achieved through simple attribute name configuration.
For example, as shown in fig. 3, the client may request data from the server, or parse the server data, etc. by means of an HTTP request or an HTTPs request, etc. When the field name of the client class attribute is inconsistent with the naming mode of the server-side Interface field name, class attribute conversion processing can be performed in an annotation mode, and front-end User Interface (UI) display such as page display, button display, list display and the like can be further achieved.
As shown in fig. 4, first, a Class of an interface type, which is a params name. Java file adds interface method named value () for other calling entity to execute program. The client class attributes are marked through an annotation analysis format (annotation format) and are used for being configured corresponding to the server attribute field names, and the client class attributes are used through simple configuration, for example, the server interface field names corresponding to the server interface field names for configuring the attribute field names of the data for realizing the class A, the server interface field names corresponding to the server interface field names for configuring the attribute field names of the data for realizing the class B, and the like, and the data classes respectively inherit the ParamsEntity basic data classes. When the analytic mode is used, all attributes of the current class are obtained from the data class, and corresponding annotation information is traversed through all attribute names. When annotation information corresponding to the current class attribute of the client exists in the ParamsName.java, the field name of the current class attribute of the client and the corresponding annotation information are respectively stored in the key (key) field and the value (value) field of the ParamsMap data class defined in the ParamsEntity basic data class, and further storage in a key-value pair mode is realized; java, when there is no annotation information corresponding to the current class attribute of the client, storing the field name of the current class attribute of the client into the key and value fields of the data class of the paramsmmap respectively, thereby realizing storage in a key-value pair manner. When the method is used for analyzing the server attribute field or requesting the attribute field, the client class attribute field name is used as a key to query from the ParamsMap data class respectively, and a corresponding value is obtained to execute a corresponding program instruction, so that the real data of the server is used, and the effect of converting the attribute name is achieved.
By applying the technical scheme of the embodiment, the entity type structure field analysis can be automatically migrated, the user defined entity type is simplified, and the configuration of redundant fields is omitted. The method can simplify the field analysis mode of the server and the development and maintenance of the field hierarchical relationship, reduce the maintenance cost of research personnel on the field of the server, and improve the working efficiency of research engineers. And the definition of the context is defined by the annotation definition mode and the client class attribute, so that the corresponding relation maintained when the name of the client class attribute field is inconsistent with the name of the server class field is relieved.
Further, as a specific implementation of the method shown in fig. 1 and fig. 2, the present embodiment provides a data processing apparatus, as shown in fig. 5, the apparatus includes: an acquisition unit 31 and a processing unit 32.
An obtaining unit 31, configured to obtain annotation information corresponding to a class attribute of a client, where the annotation information includes a server-side interface field name configured in an annotation format and corresponding to the class attribute field name;
the obtaining unit 31 is further configured to obtain mapping information between the client-side attribute field name and the server-side interface field name according to the annotation information;
and the processing unit 32 is configured to execute program instructions by using the server-side interface field name corresponding to the client class attribute field name according to the mapping information, so as to perform data processing between the client and the server.
In a specific application scenario, the apparatus further comprises: a configuration unit;
the configuration unit is configured to establish a configuration file of the annotation parsing entity class before the annotation information corresponding to the class attribute of the client is obtained; and marking the name of the server-side interface field corresponding to the name of the client-side attribute field in the configuration file through an annotation format to obtain the annotation information.
In a specific application scenario, the obtaining unit 31 is specifically configured to traverse annotation information corresponding to the class attribute marked in the configuration file; if the configuration file has annotation information corresponding to the current class attribute of the client, taking the field name of the current class attribute as a key, taking the annotation information corresponding to the current class attribute as a value, and storing a key value pair; and if the annotation information corresponding to the current class attribute does not exist in the configuration file, respectively using the field names of the current class attribute as keys and values, and storing the key value pairs.
In a specific application scenario, the processing unit 32 is specifically configured to perform query using the client class attribute field name as a key from a stored key value pair to obtain a corresponding value; and if the obtained value is annotation information, executing a program instruction by using the name of the server-side interface field corresponding to the name of the client-side attribute field in the annotation information.
In a specific application scenario, the configuration unit is specifically configured to inherit the data class of the annotation information marked in the configuration file to a basic data class, acquire all class attributes of the client in the basic data class, and traverse the corresponding annotation information through the field names of all the class attributes.
In a specific application scenario, the configuration unit is further configured to establish a configuration file of a Class of an interface type as a configuration file of an annotation parsing entity Class.
In a specific application scenario, the apparatus further comprises: an updating unit;
the updating unit is configured to execute the server-side interface field name corresponding to the client-side class attribute field name marked in the configuration file through an annotation format, and obtain the updating information of the server-side interface field name after obtaining the annotation information; and updating the server-side interface field names in the annotation information corresponding to the client-side class attributes in the configuration file according to the updating information.
It should be noted that other corresponding descriptions of the functional units related to the data processing apparatus provided in this embodiment may refer to the corresponding descriptions of the methods in fig. 1 and fig. 2, and are not repeated herein.
By applying the technical scheme of the embodiment, the corresponding relationship maintained when the client class attribute field name is inconsistent with the server-side interface field name can be reduced, the maintenance cost of research personnel on the server-side interface field can be reduced, and the work efficiency of research and development engineers is improved.
Fig. 6 is a block diagram of an electronic apparatus shown in the present embodiment. For example, the electronic device may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 6, the electronic device may include one or more of the following components: processing component 41, memory 42, power component 43, multimedia component 44, audio component 45, interface for input/output (I/O) 46, sensor component 47, and communication component 48.
The processing component 41 generally controls the overall operation of the electronic device, such as operations associated with display, telephone calls, data communications, camera operations and recording operations. Processing component 41 may include one or more processors 410 to execute instructions to perform all or a portion of the steps of the information platform selection method described in any of the embodiments. Further, processing component 41 may include one or more modules that facilitate interaction between processing component 41 and other components. For example, the processing component 41 may include a multimedia module to facilitate interaction between the multimedia component 44 and the processing component 41.
The memory 42 is configured to store various types of data to support operations at the electronic device. Examples of such data include instructions for any application or method operating on the electronic device, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 42 may be implemented by any type or combination of volatile or non-volatile memory devices, such as Static Random Access Memory (SRAM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The power supply assembly 43 provides power to the various components of the electronic device. The power supply components 3 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for electronic devices.
The multimedia component 44 includes a screen providing an output interface between the electronic device and the user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 44 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the electronic device is in an operating mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
Audio component 45 is configured to output and/or input audio signals. For example, audio assembly 45 includes a Microphone (MIC) configured to receive external audio signals when the electronic device is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 42 or transmitted via the communication component 48. In some embodiments, audio assembly 45 also includes a speaker for outputting audio signals.
The I/O interface 46 provides an interface between the processing component 41 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 47 includes one or more sensors for providing various aspects of status assessment for the electronic device. For example, the sensor assembly 47 may detect an open/closed state of the electronic device, the relative positioning of the components, such as a display and keypad of the electronic device, the sensor assembly 47 may also detect a change in position of the electronic device or a component of the electronic device, the presence or absence of user contact with the electronic device, orientation or acceleration/deceleration of the electronic device, and a change in temperature of the electronic device. The sensor assembly 47 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 47 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 47 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 48 is configured to facilitate wired or wireless communication between the electronic device and other devices. The electronic device may access a wireless network based on a communication standard, such as WiFi, an operator network (such as 2G, 3G, 4G, or 5G), or a combination thereof. In an exemplary embodiment, the communication component 48 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 48 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the electronic device may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the methods shown in fig. 1-2.
In an exemplary embodiment, a non-transitory computer readable storage medium comprising instructions, such as the memory 42 comprising instructions, executable by the processor 410 of the electronic device to perform the method as shown in fig. 1-2 is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, a computer program product is also provided, which comprises readable program code executable by the processor 410 of the electronic device described above to perform the method as shown in fig. 1 to 2. Alternatively, the program code may be stored in a storage medium of the electronic device, which may be a non-transitory computer-readable storage medium, for example, ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, and the like.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. A data processing method, comprising:
obtaining annotation information corresponding to class attributes of a client, wherein the annotation information comprises server-side interface field names which are configured through an annotation format and correspond to the class attribute field names;
acquiring mapping information of the client class attribute field name and the server end interface field name according to the annotation information;
and executing a program instruction by using the server-side interface field name corresponding to the client-side class attribute field name according to the mapping information so as to process data of the client side and the server side.
2. The method according to claim 1, wherein before the obtaining of the annotation information corresponding to the class attribute of the client, the method further comprises:
establishing a configuration file of the annotation analysis entity class;
and marking the name of the server-side interface field corresponding to the name of the client-side attribute field in the configuration file through an annotation format to obtain the annotation information.
3. The method according to claim 2, wherein the obtaining mapping information between the client class attribute field name and the server interface field name according to the annotation information comprises:
traversing annotation information corresponding to the marked class attribute in the configuration file;
if the configuration file has annotation information corresponding to the current class attribute of the client, taking the field name of the current class attribute as a key, taking the annotation information corresponding to the current class attribute as a value, and storing a key value pair;
and if the annotation information corresponding to the current class attribute does not exist in the configuration file, respectively using the field names of the current class attribute as keys and values, and storing the key value pairs.
4. The method of claim 3, wherein said executing program instructions with said server-side interface field name corresponding to said client class attribute field name according to said mapping information comprises:
querying by using the client class attribute field name as a key from the stored key value pair to obtain a corresponding value;
and if the obtained value is annotation information, executing a program instruction by using the name of the server-side interface field corresponding to the name of the client-side attribute field in the annotation information.
5. The method of claim 3, wherein traversing annotation information corresponding to the labeled class attribute in the configuration file comprises:
and respectively inheriting the data class of the annotation information marked in the configuration file to a basic data class, acquiring all class attributes of the client in the basic data class, and traversing the annotation information corresponding to each class attribute through the field names of all the class attributes.
6. The method of claim 2, wherein the establishing a configuration file for an annotation parsing entity class comprises:
and establishing a configuration file of the Class of the interface type as a configuration file of the annotation analysis entity Class.
7. The method according to claim 2, wherein after the server-side interface field name corresponding to the client-side class attribute field name is marked in the configuration file by an annotation format to obtain the annotation information, the method further comprises:
acquiring the update information of the server-side interface field name;
and updating the server-side interface field name in the annotation information corresponding to the client class attribute in the configuration file according to the updating information.
8. A data processing apparatus, comprising:
the system comprises an acquisition unit, a processing unit and a display unit, wherein the acquisition unit is configured to acquire annotation information corresponding to class attributes of a client, and the annotation information comprises server-side interface field names which are configured through an annotation format and correspond to the class attribute field names;
the obtaining unit is further configured to obtain mapping information between the client class attribute field name and the server end interface field name according to the annotation information;
and the processing unit is configured to execute a program instruction by using the server-side interface field name corresponding to the client-side class attribute field name according to the mapping information so as to perform data processing between the client side and the server side.
9. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the data processing method of any one of claims 1 to 7.
10. A storage medium in which instructions, when executed by a processor of an electronic device, enable the electronic device to perform the data processing method of any one of claims 1 to 7.
CN202210968743.2A 2022-08-12 2022-08-12 Data processing method and device Pending CN115268935A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210968743.2A CN115268935A (en) 2022-08-12 2022-08-12 Data processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210968743.2A CN115268935A (en) 2022-08-12 2022-08-12 Data processing method and device

Publications (1)

Publication Number Publication Date
CN115268935A true CN115268935A (en) 2022-11-01

Family

ID=83750609

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210968743.2A Pending CN115268935A (en) 2022-08-12 2022-08-12 Data processing method and device

Country Status (1)

Country Link
CN (1) CN115268935A (en)

Similar Documents

Publication Publication Date Title
CN107423106B (en) Method and apparatus for supporting multi-frame syntax
CN106547547B (en) data acquisition method and device
CN115062046A (en) Database query method and device, electronic equipment and storage medium
CN107463372B (en) Data-driven page updating method and device
CN115185717A (en) Interface calling method and device, electronic equipment and storage medium
CN110704030A (en) Interface configuration information generation method and device, electronic equipment and storage medium
CN111382161B (en) State data processing method and device, electronic equipment and storage medium
CN112433787A (en) Target object serialization method and device, electronic device and storage medium
CN115391601A (en) Video format detection method, index model construction method and device
CN115268935A (en) Data processing method and device
CN112988822A (en) Data query method, device, equipment, readable storage medium and product
CN114546436A (en) Micro front-end service updating method and device, electronic equipment and storage medium
CN113778398A (en) Code generation method and device, electronic equipment and storage medium
CN114218235A (en) Page text updating method and device, electronic equipment and storage medium
CN109032583B (en) Data interaction method and device
CN112256445A (en) Data processing method, device and equipment based on application program and storage medium
US20220237362A1 (en) Information display method, device, apparatus, medium, and program product for page element
CN110347394B (en) Software code analysis method and device
CN114443161B (en) Application docking method, device, equipment and storage medium
CN112182027B (en) Information query method, device, electronic equipment and storage medium
CN111159148B (en) Configuration information state management method and device, electronic equipment and storage medium
CN111143184B (en) Data processing method, device and system
CN114357052A (en) Heterogeneous database object conversion method and device, electronic equipment and storage medium
CN115794771A (en) Document information generation method, device, equipment and storage medium
CN115905387A (en) Data code information generation method, device, equipment and storage medium

Legal Events

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