WO2020143306A9 - Object inter-conversion method and apparatus, storage medium, and server - Google Patents

Object inter-conversion method and apparatus, storage medium, and server Download PDF

Info

Publication number
WO2020143306A9
WO2020143306A9 PCT/CN2019/117597 CN2019117597W WO2020143306A9 WO 2020143306 A9 WO2020143306 A9 WO 2020143306A9 CN 2019117597 W CN2019117597 W CN 2019117597W WO 2020143306 A9 WO2020143306 A9 WO 2020143306A9
Authority
WO
WIPO (PCT)
Prior art keywords
data
attribute
conversion
conversion reference
reference data
Prior art date
Application number
PCT/CN2019/117597
Other languages
French (fr)
Chinese (zh)
Other versions
WO2020143306A1 (en
Inventor
杨祎
钱利辉
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2020143306A1 publication Critical patent/WO2020143306A1/en
Publication of WO2020143306A9 publication Critical patent/WO2020143306A9/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code

Definitions

  • the present invention relates to the technical field of optimization of research and development process and optimization of transaction processing process, in particular to a method, device, storage medium and server for mutual conversion of objects.
  • the attribute data of another data transmission object is updated according to the conversion reference data.
  • the updating the attribute or attribute value of another data transmission object according to the conversion reference data includes:
  • the method includes:
  • the conversion reference data is inconsistent with the updated attribute data of the other data transmission object
  • the conversion reference data is acquired, the reminder information including the conversion reference data is generated, and the reminder is sent to the user information.
  • the acquiring the conversion benchmark data and generating the reminder information including the conversion benchmark data includes:
  • the attribute data includes attribute name and attribute value
  • the conversion reference data is the attribute
  • acquiring the attribute field and generating a reminder information of the attribute conversion failure based on the field
  • the conversion reference data is the attribute value
  • the attribute value and the attribute of the same data transmission object corresponding to the attribute value are acquired, and a reminder message of attribute value assignment failure is generated according to the attribute value and the attribute.
  • the method further includes:
  • a conversion failure log is generated according to the conversion reference data.
  • the method before the acquiring two pre-stored data transmission objects with a mapping relationship and extracting at least one attribute data of the two data transmission objects, the method includes:
  • the attribute data in the preset database is acquired according to a preset time period, and the attribute data of any data transmission object connected to the preset database is updated according to the attribute data in the preset database.
  • the embodiment of the present invention also provides an object mutual conversion device, including:
  • An extraction module configured to obtain two pre-stored data transmission objects with a mapping relationship, and extract at least one attribute data of the two data transmission objects
  • a conversion reference data determining module configured to determine the attribute data of a data transmission object as conversion reference data according to the attribute data in a preset database
  • the update module is used to update the attribute data of another data transmission object according to the conversion reference data.
  • the update module includes:
  • a first comparison unit configured to compare the conversion reference data with the attribute data that has a mapping relationship with the conversion reference data in another data transmission object
  • the calling unit is configured to call the conversion reference data as another data transmission when the conversion reference data is inconsistent with the attribute data in the other data transmission object that has a mapping relationship with the conversion reference data
  • the attribute data of the object, and the attribute data has a mapping relationship with the conversion reference data.
  • the embodiment of the present invention also provides a computer-readable storage medium having computer-readable instructions stored on the computer-readable storage medium.
  • the computer-readable instructions are executed by a processor, the object interaction described in any technical solution is realized. Transfer method.
  • the embodiment of the present invention also provides a server, including:
  • One or more processors are One or more processors;
  • One or more computer-readable instructions wherein the one or more computer-readable instructions are stored in the memory and configured to be executed by the one or more processors, and the one or more computers may
  • the read instruction configuration is used to execute the steps of the object mutual conversion method according to any technical solution.
  • the present invention has the following beneficial effects:
  • An object conversion method provided by an embodiment of the present application includes: obtaining two pre-stored data transmission objects with a mapping relationship, extracting at least one attribute data of the two data transmission objects; according to attribute data in a preset database The attribute data of one data transmission object is determined as conversion reference data; and the attribute data of another data transmission object is updated according to the conversion reference data.
  • the object conversion method provided by the embodiments of this application is mainly applied to the conversion between MAP (objects that map keys to values) and DTO (data transfer objects). Furthermore, this method implements MAP through object conversion classes. The conversion between (the object that maps the key to the value) and the DTO (data transfer object), that is, the conversion between MAP and DTO is mainly realized through the object conversion class.
  • Adding the object conversion class between MAP and DTO can reduce The amount of MAP and DTO conversion code is written, and the maintenance of MAP and DTO can be more convenient, thereby reducing the workload of R&D personnel and maintenance personnel and improving the efficiency of development.
  • the conversion between MAP and DTO is realized through the object conversion class , While reducing the amount of code for MAP and DTO conversion, it also makes the entire program simpler, avoids occupying more stack memory, and also improves the conversion efficiency between MAP and DTO.
  • An object mutual conversion method provided by an embodiment of the present application, said obtaining two pre-stored data transmission objects with a mapping relationship, and extracting at least one attribute data of the two data transmission objects includes: according to a preset time period Acquire the attribute data in the preset database, and update the attribute data of any data transmission object connected to the preset database according to the attribute data in the preset database.
  • the attribute data in the preset database is acquired according to the preset time period, which can ensure the timeliness of the data and make the data relatively new.
  • the attribute data of the MAP connected to the DTO can be converted, updated, or modified based on the data maintained by the DTO, so that all the MAP call points connected to the DTO can be unified, and the call points basically provide the MAP format.
  • a MAP that has a mapping relationship with a DTO may be used in multiple places, so it can ensure that the calling point remains uniform.
  • FIG. 1 is a schematic flowchart of an implementation manner in a typical embodiment of the object mutual conversion method of the present invention
  • Fig. 2 is a schematic structural diagram of a typical embodiment of an object mutual conversion device of the present invention.
  • FIG. 3 is a schematic structural diagram of an embodiment of the server of the present invention.
  • the method for mutual conversion of objects provided by the embodiments of the present application, in one of the implementation manners, as shown in FIG. 1, includes: S100, S200, and S300.
  • S100 Obtain two pre-stored data transmission objects with a mapping relationship, and extract at least one attribute data of the two data transmission objects;
  • S200 Determine the attribute data of a data transmission object as conversion reference data according to attribute data in a preset database
  • the object conversion method provided by the embodiments of this application is mainly applied to the conversion between MAP (objects that map keys to values) and DTO (data transfer objects). Furthermore, this method implements MAP through object conversion classes.
  • the conversion between (the object that maps the key to the value) and the DTO (data transfer object), that is, the conversion between MAP and DTO is mainly realized through the object conversion class. Adding the object conversion class between MAP and DTO can reduce The amount of MAP and DTO conversion code is written, and the maintenance of MAP and DTO can be more convenient, thereby reducing the workload of R&D personnel and maintenance personnel and improving the efficiency of development.
  • the conversion between MAP and DTO is realized through the object conversion class , While reducing the amount of code for MAP and DTO conversion, it also makes the entire program simpler, avoids occupying more stack memory, and also improves the conversion efficiency between MAP and DTO.
  • the object conversion method firstly obtains a data transfer object with a mapping relationship, such as the aforementioned MAP and DTO with a mapping relationship, where the MAP object usually includes a key (key One or both of) and value (value), the key can include multiple fields, and the value can also include multiple values, and correspond to the fields in the key.
  • the mapping relationship between MAP and DTO is DTO attribute mapping To the KEY of MAP, the value of MAP is mapped to the attribute value of DTO. Therefore, in order to update the data, based on the mapping relationship between MAP and DTO, extract the attribute data of DTO and MAP.
  • the attribute data includes one or two of attributes and attribute values, such as the key and key of the aforementioned MAP. value and the attributes and attribute values of the DTO.
  • the conversion reference data is determined according to the attribute data in the preset database.
  • the conversion reference data can be any one or two of the attributes and attribute values in DTO or MAP, or MAP and Each DTO includes a new attribute data, and the latest attribute data is determined as the conversion benchmark data.
  • the preset database can be connected with DTO and/or MAP.
  • the preset database When the preset database is only connected to any of DTO and MAP
  • the data in the data transmission object connected to the preset database is used as the conversion reference data.
  • the attribute data of another data transmission object is updated with the conversion reference data. For example, when the attribute in the DTO is the latest data, the MAP key is updated with the attribute data in the DTO, or when When the value in the MAP is the latest attribute data, the attribute value of the DTO is updated with the value of the MAP.
  • the updating the attribute or attribute value of another data transmission object according to the conversion reference data includes:
  • an object conversion method requires a new determination of whether the attribute data of another data transmission object is the latest attribute data in the process of updating attribute data, so as to avoid consistency between the two At the same time, the attribute data is also updated to reduce stack memory usage and energy consumption. Therefore, when the conversion reference data is determined, the conversion reference data is compared with the attribute data in another data transmission object. Since the conversion reference data is the attribute data of a data transmission object, the attribute data is updated and the data transmission The attribute data of another data transmission object whose object has a mapping relationship. In combination with the foregoing, the mapping relationship between data transmission objects is actually the mapping relationship between attribute data.
  • what is updated based on the conversion reference data is the attribute data of another data transmission object that has a mapping relationship with the conversion reference data.
  • comparing compare the conversion reference data with the attribute data of another data transmission object, and the two data have a mapping relationship.
  • the attribute data of the other data transmission object can be updated according to the conversion reference data.
  • the method of first comparison and then update can avoid invalid updates.
  • the method includes:
  • the conversion reference data is inconsistent with the updated attribute data of the other data transmission object
  • the conversion reference data is acquired, the reminder information including the conversion reference data is generated, and the reminder is sent to the user information.
  • the conversion benchmark data needs to be obtained in order to generate the reminder information including the conversion benchmark data. That is, the reminder information includes the conversion reference data.
  • the data transmission object including the conversion reference data and the detailed information of another data transmission object that has a mapping relationship with the data transmission object can also be obtained for the convenience of R&D personnel or The maintenance personnel can find the corresponding data transmission object by express, find the reason for the unsuccessful data conversion and solve it.
  • the acquiring the conversion benchmark data and generating the reminder information including the conversion benchmark data includes:
  • the attribute data includes attribute name and attribute value
  • the conversion reference data is the attribute
  • acquiring the attribute field and generating a reminder information of the attribute conversion failure based on the field
  • the conversion reference data is the attribute value
  • the attribute value and the attribute of the same data transmission object corresponding to the attribute value are acquired, and a reminder message of attribute value assignment failure is generated according to the attribute value and the attribute.
  • the attribute data includes the attribute name (that is, the attribute in the preceding text) and the attribute value.
  • the conversion reference data is the attribute name
  • the reminder information of the attribute conversion failure is generated based on the field.
  • the reminder message template can be preset.
  • Reminder message template such as fieldName + "Conversion failed", fieldName is the corresponding attribute name
  • the reminder message can also be set as "stock customer field” + fieldName + "Conversion failed”, where the stock customer field is the information of the related customer; in another case, when the attribute data of MAP is converted to the attribute data of DTO, a reminder information template such as key + "Method Assignment” + value + “Failure”, through the foregoing process, you can know the specific data information of the conversion failure in more detail, so that the developer or maintainer can solve the cause of the conversion failure in a targeted manner.
  • the method further includes:
  • a conversion failure log is generated according to the conversion reference data.
  • the conversion benchmark data after the conversion benchmark data is obtained, it is convenient to maintain the data in the later period to avoid the same problems in the later period. If the conversion failure log is generated based on the conversion benchmark data, the log can be monitored. When it comes to the log of the conversion failure, the aforementioned reminder information can be sent to the user, or the log can be sorted and classified.
  • the method before the acquiring two pre-stored data transmission objects with a mapping relationship and extracting at least one attribute data of the two data transmission objects, the method includes:
  • the attribute data in the preset database is acquired according to a preset time period, and the attribute data of any data transmission object connected to the preset database is updated according to the attribute data in the preset database.
  • the preset database is acquired according to a preset time period.
  • the time period can be in units of hours, days, months, etc.
  • the attribute data of the data transmission object can be updated immediately, and the data can be updated.
  • the maintenance of the transmission object in particular, when the data transmission object is a DTO, the following maintenance can be performed on the DTO: adding fields to the database, changing field types, etc., and modifying the display layer format.
  • the attribute data of the MAP connected to the DTO can be converted, updated, or modified based on the data after the DTO maintenance, so as to make All MAP call points connected with DTO remain unified.
  • the basic MAP format provided by the call point is the MAP format.
  • the MAP that has a mapping relationship with a DTO may be used in multiple places, so it can ensure that the call points remain unified. For example, in combination with the foregoing description, all call points need to obtain the applno output parameter in the MAP.
  • the applno output parameter can be realized through the tool method of DTO conversion to MAP.
  • the code does not involve the hard-coded "applyNo" key value. That is, only by modifying the attribute applyNo in the DTO to applNo, the calling point can obtain the applno output parameter in the MAP.
  • the embodiment of the present invention also provides an object mutual conversion device.
  • it includes: an extraction module 100, a conversion reference data determination module 200, and an update module 300:
  • the extraction module 100 is configured to obtain two pre-stored data transmission objects with a mapping relationship, and extract at least one attribute data of the two data transmission objects;
  • the conversion reference data determining module 200 is configured to determine the attribute data of a data transmission object as conversion reference data according to the attribute data in a preset database;
  • the update module 300 is used to update the attribute data of another data transmission object according to the conversion reference data.
  • an object mutual conversion device provided in an embodiment of the present invention further includes: a first comparison unit 310, configured to compare the conversion reference data with another object in the data transmission object.
  • the conversion reference data has the attribute data that has a mapping relationship; the calling unit 320 is used for when the conversion reference data is inconsistent with the attribute data that has a mapping relationship with the conversion reference data in another data transmission object , Calling the conversion reference data as attribute data of another data transmission object, and the attribute data has a mapping relationship with the conversion reference data.
  • the comparison module 410 is used to compare the converted reference data with the updated attribute data of the another data transmission object; the sending module 420 is used to compare the conversion reference data with the updated other attribute data; When the attribute data of the data transmission object is inconsistent, the conversion reference data is obtained, the reminder information including the conversion reference data is generated, and the reminder information is sent to the user.
  • the first reminder information generating unit 421 is configured to obtain the attribute field when the conversion reference data is the attribute, and generate reminder information indicating that the attribute conversion fails based on the field; the second reminder information generating unit 421 uses When the conversion reference data is the attribute value, the attribute value and the attribute of the same data transmission object corresponding to the attribute value are acquired, and a reminder message of attribute value assignment failure is generated according to the attribute value and the attribute .
  • the log generating unit 423 is configured to generate a conversion failure log according to the conversion reference data.
  • the obtaining module 101 is configured to obtain the attribute data in the preset database according to a preset time period, and update any of the data connected to the preset database according to the attribute data in the preset database The attribute data of the transfer object.
  • An object mutual conversion apparatus provided in an embodiment of the present invention can implement the foregoing embodiment of the object mutual conversion method.
  • An embodiment of the present invention provides a computer-readable storage medium having computer-readable instructions stored on the computer-readable storage medium, wherein the computer-readable storage medium may be a non-volatile readable storage medium.
  • the readable instructions are executed by the processor, the method for mutual conversion of objects described in any one of the technical solutions is implemented.
  • the computer-readable storage medium includes but is not limited to any type of disk (including floppy disk, hard disk, optical disk, CD-ROM, and magneto-optical disk), ROM (Read-Only Memory, read-only memory), RAM (Random AcceSS Memory, random memory), EPROM (EraSable Programmable Read-Only Memory, erasable programmable read-only memory), EEPROM (Electrically EraSable Programmable Read-Only Memory, electrically erasable programmable read-only memory), flash memory, magnetic card or optical card.
  • a storage device includes any medium that stores or transmits information in a readable form by a device (for example, a computer, a mobile phone), and may be a read-only memory, a magnetic disk, or an optical disk.
  • An embodiment of the present invention provides a computer-readable storage medium that can implement the above-mentioned object conversion method.
  • the object conversion class between data transmission objects with a mapping relationship is used to implement data transmission objects. Attribute data conversion, by integrating the code of the conversion process into this class, and combining the mapping relationship and reflection mechanism to achieve attribute data determination and conversion, reducing the amount of code writing for data conversion between data transmission objects, thereby reducing the work of developers
  • it also facilitates the maintenance of data transmission objects in the later period, which makes the logic of the code clearer, and also facilitates the maintenance of MAP data of other call points connected with DTO, so that MAP data can be unified with DTO data;
  • the method for mutual conversion of objects provided in the example includes: obtaining two pre-stored data transmission objects with a mapping relationship, extracting at least one attribute data of the two data transmission objects; and converting one of the data according to the attribute data in the preset database The attribute data of the transmission object is determined to be conversion reference data;
  • the object conversion method provided by the embodiments of this application is mainly applied to the conversion between MAP (objects that map keys to values) and DTO (data transfer objects). Furthermore, this method implements MAP through object conversion classes.
  • the conversion between (the object that maps the key to the value) and the DTO (data transfer object), that is, the conversion between MAP and DTO is mainly realized through the object conversion class. Adding the object conversion class between MAP and DTO can reduce The amount of MAP and DTO conversion code is written, and the maintenance of MAP and DTO can be more convenient, thereby reducing the workload of R&D personnel and maintenance personnel and improving the efficiency of development.
  • the object conversion method provided by the embodiments of the present application firstly obtains a data transfer object with a mapping relationship, such as the aforementioned MAP and DTO with a mapping relationship, where the MAP object usually includes a key (key One or both of) and value (value), the key can include multiple fields, and the value can also include multiple values, and correspond to the fields in the key.
  • a mapping relationship such as the aforementioned MAP and DTO with a mapping relationship
  • the MAP object usually includes a key (key One or both of) and value (value)
  • the key can include multiple fields
  • the value can also include multiple values, and correspond to the fields in the key.
  • the mapping relationship between MAP and DTO is DTO attribute mapping To the KEY of MAP, the value of MAP is mapped to the attribute value of DTO. Therefore, in order to update the data, based on the mapping relationship between MAP and DTO, extract the attribute data of DTO and MAP.
  • the attribute data includes one or two of attributes and attribute values, such as the key and key of the aforementioned MAP. value and the attributes and attribute values of the DTO.
  • the conversion reference data is determined according to the attribute data in the preset database.
  • the conversion reference data can be any one or two of the attributes and attribute values in DTO or MAP, or MAP and Each DTO includes a new attribute data, and the latest attribute data is determined as the conversion benchmark data.
  • the preset database can be connected with DTO and/or MAP. When the preset database is only connected to any of DTO and MAP When a connection is made, since the data of DTO and MAP are updated based on the data in the database, the data in the data transmission object connected to the preset database is used as the conversion reference data. After the conversion reference data is determined, the attribute data of another data transmission object is updated with the conversion reference data. For example, when the attribute in the DTO is the latest data, the MAP key is updated with the attribute data in the DTO, or when When the value in the MAP is the latest attribute data, the attribute value of the DTO is updated with the value of the MAP.
  • the present invention also provides a server.
  • the server processor 503, memory 505, input unit 507, display unit 509 and other devices are used to store computer-readable instructions 501 and various functional modules, and the processor 503 runs the computer-readable instructions 501 stored in the memory 505 to execute various functional applications and data processing of the device.
  • the memory 505 may be an internal memory or an external memory, or include both internal memory and external memory.
  • the internal memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), flash memory, or random access memory.
  • ROM read only memory
  • PROM programmable ROM
  • EPROM electrically programmable ROM
  • EEPROM electrically erasable programmable ROM
  • flash memory or random access memory.
  • External storage can include hard disks, floppy disks, ZIP disks, U disks, tapes, etc.
  • the memory disclosed in the present invention includes but is not limited to these types of memory.
  • the memory 505 disclosed in the present invention is only an example and not a limitation.
  • the input unit 507 is used to receive signal input, as well as personal information and related physical condition information input by the user.
  • the input unit 507 may include a touch panel and other input devices.
  • the touch panel can collect customer touch operations on or near it (for example, customers use fingers, stylus and other suitable objects or accessories to operate on the touch panel or near the touch panel), and according to the preset
  • the program drives the corresponding connection device; other input devices may include, but are not limited to, one or more of a physical keyboard, function keys (such as playback control buttons, switch buttons, etc.), trackball, mouse, and joystick.
  • the display unit 509 can be used to display information input by the customer or information provided to the customer and various menus of the computer device.
  • the display unit 509 can take the form of a liquid crystal display, an organic light emitting diode, or the like.
  • the processor 503 is the control center of the computer equipment. It uses various interfaces and lines to connect the various parts of the entire computer. By running or executing the software programs and/or modules stored in the memory 503, and calling the data stored in the memory, execute Various functions and processing data.
  • the one or more processors 503 shown in FIG. 3 can execute and realize the function of the extraction module 100 shown in FIG. 2, the function of the conversion reference data determination module 200, the function of the update module 300, and the function of the first comparison unit 310. Function, function of calling unit 320, function of comparison module 410, function of sending module 420, function of first reminder information generating unit 421, function of second reminder information generating unit 421, function of log generating unit 423, acquisition module 101 Function.
  • the server includes one or more processors 503, one or more memories 505, and one or more computer-readable instructions 501, wherein the one or more computer-readable instructions 501 are It is stored in the memory 505 and configured to be executed by the one or more processors 503, and the one or more computer-readable instructions 301 are configured to execute the object mutual conversion method described in the above embodiments.
  • the embodiment of the present invention provides a server that can implement the embodiment of the above object mutual conversion method.
  • the attribute data conversion between the data transmission objects is realized through the object mutual conversion class between the data transmission objects with the mapping relationship.
  • a method for mutual conversion of objects includes: obtaining two pre-stored data transmission objects with a mapping relationship, extracting at least one attribute data of the two data transmission objects; according to attribute data in a preset database, all data transmission objects The attribute data is determined to be conversion reference data; the attribute data of another
  • the object conversion method provided by the embodiments of this application is mainly applied to the conversion between MAP (objects that map keys to values) and DTO (data transfer objects). Furthermore, this method implements MAP through object conversion classes.
  • the conversion between (the object that maps the key to the value) and the DTO (data transfer object), that is, the conversion between MAP and DTO is mainly realized through the object conversion class. Adding the object conversion class between MAP and DTO can reduce The amount of MAP and DTO conversion code is written, and the maintenance of MAP and DTO can be more convenient, thereby reducing the workload of R&D personnel and maintenance personnel and improving the efficiency of development.
  • the object conversion method provided by the embodiments of the present application firstly obtains a data transfer object with a mapping relationship, such as the aforementioned MAP and DTO with a mapping relationship, where the MAP object usually includes a key (key One or both of) and value (value), the key can include multiple fields, and the value can also include multiple values, and correspond to the fields in the key.
  • a mapping relationship such as the aforementioned MAP and DTO with a mapping relationship
  • the MAP object usually includes a key (key One or both of) and value (value)
  • the key can include multiple fields
  • the value can also include multiple values, and correspond to the fields in the key.
  • the mapping relationship between MAP and DTO is DTO attribute mapping To the KEY of MAP, the value of MAP is mapped to the attribute value of DTO. Therefore, in order to update the data, based on the mapping relationship between MAP and DTO, extract the attribute data of DTO and MAP.
  • the attribute data includes one or two of attributes and attribute values, such as the key and key of the aforementioned MAP. value and the attributes and attribute values of the DTO.
  • the conversion reference data is determined according to the attribute data in the preset database.
  • the conversion reference data can be any one or two of the attributes and attribute values in DTO or MAP, or MAP and Each DTO includes a new attribute data, and the latest attribute data is determined as the conversion benchmark data.
  • the preset database can be connected with DTO and/or MAP. When the preset database is only connected to any of DTO and MAP When a connection is made, since the data of DTO and MAP are updated based on the data in the database, the data in the data transmission object connected to the preset database is used as the conversion reference data. After the conversion reference data is determined, the attribute data of another data transmission object is updated with the conversion reference data. For example, when the attribute in the DTO is the latest data, the MAP key is updated with the attribute data in the DTO, or when When the value in the MAP is the latest attribute data, the attribute value of the DTO is updated with the value of the MAP.
  • the server provided in the embodiment of the present invention can implement the embodiment of the object mutual conversion method provided above.

Abstract

An object inter-conversion method, comprising: obtaining two pre-stored data transmission objects having a mapping relation, and extracting at least one piece of attribute data of the two data transmission objects (S100); determining attribute data of one data transmission object as conversion reference data according to attribute data in a preset database (S200); and updating attribute data of the other data transmission object according to the conversion reference data (S300). The method is mainly applied to conversion between an MAP and a DTO. The writing amount of MAP and DTO conversion codes is reduced; moreover, the maintenance of the MAP and the DTO is more convenient, so that the workload of research and development personnel and maintenance personnel is reduced, the development efficiency is improved, the whole program is simpler, the occupation of more stack memories is avoided, and the conversion efficiency between the MAP and the DTO is also improved.

Description

对象互转方法、装置及存储介质、服务器 Object mutual conversion method, device, storage medium and server To
本申请要求于2019年01月08日提交中国专利局、申请号为201910015170.X、发明名称为“发票开具方法、装置、设备及计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office, the application number is 201910015170.X, and the invention title is "Invoice Issuing Method, Apparatus, Equipment, and Computer-readable Storage Medium" on January 8, 2019. All of them The content is incorporated in the application by reference.
技术领域Technical field
本发明涉及研发过程优化、事务处理过程优化技术领域,具体涉及一种对象互转方法、装置及存储介质、服务器。The present invention relates to the technical field of optimization of research and development process and optimization of transaction processing process, in particular to a method, device, storage medium and server for mutual conversion of objects.
背景技术Background technique
随着宽带无线接入技术和移动终端技术的飞速发展,越来越多的人们开始使用智能手机和平板电脑来方便快捷的使用移动互联网服务。移动应用的开发过程中网络编程应用的越来越多,数据的应用在开发过程中越来越重要。现大部分代码采用MAP指定的KEY与DTO属性值进行对应处理,该方式代码重迭繁杂、维护不方便,一旦DTO或者MAP中的某KEY名称修改,涉及到调用处均需要进行修改,降低的程序开发的效率。另外,当DTO或者MAP中的某KEY名称修改且没有及时发现时,则会导致数据的调用失败,为了实现数据的调用,常规情况下,会引入新的DTO与MAP对应,然而该方法会导致整个程序冗余,占用更多的栈内存。With the rapid development of broadband wireless access technology and mobile terminal technology, more and more people are beginning to use smart phones and tablet computers to conveniently and quickly use mobile Internet services. In the development process of mobile applications, there are more and more network programming applications, and the application of data becomes more and more important in the development process. Most codes now use the KEY and DTO attribute values specified by MAP for corresponding processing. The code overlaps and is complicated and inconvenient to maintain. Once the DTO or a KEY name in the MAP is modified, the calling place needs to be modified. The efficiency of program development. In addition, when a KEY name in a DTO or MAP is modified and not discovered in time, it will cause the data call to fail. In order to achieve the data call, under normal circumstances, a new DTO corresponding to the MAP will be introduced, but this method will cause The entire program is redundant and takes up more stack memory.
发明内容Summary of the invention
为克服以上技术问题,特别是MAP指定的KEY与DTO属性值进行对应导致代码重叠繁杂、维护不方便的问题,特提出以下技术方案:In order to overcome the above technical problems, especially the correspondence between the KEY specified by MAP and the attribute value of DTO, which leads to complicated code overlap and inconvenient maintenance, the following technical solutions are proposed:
本发明实施例提供的一种对象互转方法,包括:An object mutual conversion method provided by an embodiment of the present invention includes:
获取预存的具有映射关系的两数据传输对象,提取两所述数据传输对象的至少一个属性数据;Acquiring two pre-stored data transmission objects with a mapping relationship, and extracting at least one attribute data of the two data transmission objects;
依据预设数据库中的属性数据将一所述数据传输对象的所述属性数据确定为转换基准数据;Determining the attribute data of a data transmission object as conversion reference data according to the attribute data in the preset database;
依据所述转换基准数据更新另一所述数据传输对象的属性数据。The attribute data of another data transmission object is updated according to the conversion reference data.
可选地,所述依据所述转换基准数据更新另一所述数据传输对象的属性或属性值,包括:Optionally, the updating the attribute or attribute value of another data transmission object according to the conversion reference data includes:
对比所述转换基准数据和另一所述数据传输对象中与所述转换基准数据具有映射关系的所述属性数据;Comparing the conversion reference data with the attribute data that has a mapping relationship with the conversion reference data in another data transmission object;
当所述转换基准数据和另一所述数据传输对象中与所述转换基准数据具有映射关系的所述属性数据不一致时,调用所述转换基准数据作为另一所述数据传输对象的属性数据,且该属性数据与所述转换基准数据具有映射关系。When the conversion reference data is inconsistent with the attribute data that has a mapping relationship with the conversion reference data in another data transmission object, calling the conversion reference data as the attribute data of the other data transmission object, And the attribute data has a mapping relationship with the conversion reference data.
可选地,所述依据所述转换基准数据更新另一所述数据传输对象的属性或属性值之后,包括:Optionally, after updating the attribute or attribute value of another data transmission object according to the conversion reference data, the method includes:
对比所述转换基准数据和更新后的所述另一所述数据传输对象的所属性数据;Comparing the conversion reference data with the updated attribute data of the another data transmission object;
当所述转换基准数据和更新后的所述另一所述数据传输对象的所属性数据不一致时,获取所述转换基准数据,生成包括所述转换基准数据的提醒信息,向用户发送所述提醒信息。When the conversion reference data is inconsistent with the updated attribute data of the other data transmission object, the conversion reference data is acquired, the reminder information including the conversion reference data is generated, and the reminder is sent to the user information.
可选地,所述获取所述转换基准数据,生成包括所述转换基准数据的提醒信息,包括:Optionally, the acquiring the conversion benchmark data and generating the reminder information including the conversion benchmark data includes:
所述属性数据包括属性名称和属性值;The attribute data includes attribute name and attribute value;
当所述转换基准数据为所述属性时,获取所述属性的字段,基于所述字段生成属性转换失败的提醒信息;When the conversion reference data is the attribute, acquiring the attribute field, and generating a reminder information of the attribute conversion failure based on the field;
当所述转换基准数据为所述属性值时,获取所述属性值、所述属性值对应的同一数据传输对象的属性,依据所述属性值和所述属性生成属性值赋值失败的提醒信息。When the conversion reference data is the attribute value, the attribute value and the attribute of the same data transmission object corresponding to the attribute value are acquired, and a reminder message of attribute value assignment failure is generated according to the attribute value and the attribute.
可选地,所述当所述转换基准数据和更新后的所述另一所述数据传输对象的所属性数据不一致时,获取所述转换基准数据之后,还包括:Optionally, when the conversion reference data is inconsistent with the updated attribute data of the another data transmission object, after obtaining the conversion reference data, the method further includes:
依据所述转换基准数据生成转换失败日志。A conversion failure log is generated according to the conversion reference data.
可选地,所述获取预存的具有映射关系的两数据传输对象,提取两所述数据传输对象的至少一个属性数据之前,包括:Optionally, before the acquiring two pre-stored data transmission objects with a mapping relationship and extracting at least one attribute data of the two data transmission objects, the method includes:
按照预设时间周期获取所述预设数据库中的所述属性数据,依据所述预设数据库中的所述属性数据更新与所述预设数据库连接的任一所述数据传输对象的属性数据。The attribute data in the preset database is acquired according to a preset time period, and the attribute data of any data transmission object connected to the preset database is updated according to the attribute data in the preset database.
本发明实施例还提供了一种对象互转装置,包括:The embodiment of the present invention also provides an object mutual conversion device, including:
提取模块,用于获取预存的具有映射关系的两数据传输对象,提取两所述数据传输对象的至少一个属性数据;An extraction module, configured to obtain two pre-stored data transmission objects with a mapping relationship, and extract at least one attribute data of the two data transmission objects;
转换基准数据确定模块,用于依据预设数据库中的属性数据将一所述数据传输对象的所述属性数据确定为转换基准数据;A conversion reference data determining module, configured to determine the attribute data of a data transmission object as conversion reference data according to the attribute data in a preset database;
更新模块,用于依据所述转换基准数据更新另一所述数据传输对象的属性数据。The update module is used to update the attribute data of another data transmission object according to the conversion reference data.
可选地,所述更新模块包括:Optionally, the update module includes:
第一对比单元,用于对比所述转换基准数据和另一所述数据传输对象中与所述转换基准数据具有映射关系的所述属性数据;A first comparison unit, configured to compare the conversion reference data with the attribute data that has a mapping relationship with the conversion reference data in another data transmission object;
调用单元,用于当所述转换基准数据和另一所述数据传输对象中与所述转换基准数据具有映射关系的所述属性数据不一致时,调用所述转换基准数据作为另一所述数据传输对象的属性数据,且该属性数据与所述转换基准数据具有映射关系。The calling unit is configured to call the conversion reference data as another data transmission when the conversion reference data is inconsistent with the attribute data in the other data transmission object that has a mapping relationship with the conversion reference data The attribute data of the object, and the attribute data has a mapping relationship with the conversion reference data.
本发明实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机可读指令,该计算机可读指令被处理器执行时实现任一技术方案所述的对象互转方法。The embodiment of the present invention also provides a computer-readable storage medium having computer-readable instructions stored on the computer-readable storage medium. When the computer-readable instructions are executed by a processor, the object interaction described in any technical solution is realized. Transfer method.
本发明实施例还提供了一种服务器,包括:The embodiment of the present invention also provides a server, including:
一个或多个处理器;One or more processors;
存储器;Memory
一个或多个计算机可读指令,其中所述一个或多个计算机可读指令被存储在所述存储器中并被配置为由所述一个或多个处理器执行,所述一个或多个计算机可读指令配置用于执行根据任一技术方案所述的对象互转方法的步骤。One or more computer-readable instructions, wherein the one or more computer-readable instructions are stored in the memory and configured to be executed by the one or more processors, and the one or more computers may The read instruction configuration is used to execute the steps of the object mutual conversion method according to any technical solution.
本发明与现有技术相比,具有以下有益效果:Compared with the prior art, the present invention has the following beneficial effects:
1、本申请实施例提供的一种对象互转方法,包括:获取预存的具有映射关系的两数据传输对象,提取两所述数据传输对象的至少一个属性数据;依据预设数据库中的属性数据将一所述数据传输对象的所述属性数据确定为转换基准数据;依据所述转换基准数据更新另一所述数据传输对象的属性数据。本申请实施例提供的一种对象互转方法主要应用于MAP(将键映射到值的对象)与DTO(数据传输对象)之间的转换,更进一步地,该方法通过对象互转类实现MAP(将键映射到值的对象)与DTO(数据传输对象)之间的转换,即MAP与DTO的转换主要通过该对象互转类实现,在MAP和DTO之间增加该对象互转类可以减少MAP和DTO转换代码的编写量,同时可以MAP和DTO的维护更为方便,进而降低研发人员和维护人员的工作量,提高开发的效率,同时由于通过该对象互转类实现MAP和DTO的转换,在减少MAP和DTO转换的代码量时,还使得整个程序更为简单,避免占用更多的栈内存,也提高了MAP和DTO之间的转换效率。1. An object conversion method provided by an embodiment of the present application includes: obtaining two pre-stored data transmission objects with a mapping relationship, extracting at least one attribute data of the two data transmission objects; according to attribute data in a preset database The attribute data of one data transmission object is determined as conversion reference data; and the attribute data of another data transmission object is updated according to the conversion reference data. The object conversion method provided by the embodiments of this application is mainly applied to the conversion between MAP (objects that map keys to values) and DTO (data transfer objects). Furthermore, this method implements MAP through object conversion classes. The conversion between (the object that maps the key to the value) and the DTO (data transfer object), that is, the conversion between MAP and DTO is mainly realized through the object conversion class. Adding the object conversion class between MAP and DTO can reduce The amount of MAP and DTO conversion code is written, and the maintenance of MAP and DTO can be more convenient, thereby reducing the workload of R&D personnel and maintenance personnel and improving the efficiency of development. At the same time, the conversion between MAP and DTO is realized through the object conversion class , While reducing the amount of code for MAP and DTO conversion, it also makes the entire program simpler, avoids occupying more stack memory, and also improves the conversion efficiency between MAP and DTO.
2、本申请实施例提供的一种对象互转方法,所述获取预存的具有映射关系的两数据传输对象,提取两所述数据传输对象的至少一个属性数据之前,包括:按照预设时间周期获取所述预设数据库中的所述属性数据,依据所述预设数据库中的所述属性数据更新与所述预设数据库连接的任一所述数据传输对象的属性数据。通过该修改,在本申请提供的实施例中,按照预设时间周期获取所述预设数据库中的属性数据,可以保证数据的时效性,使得数据较新,在对DTO进行属性数据的维护之后,则可以基于DTO维护后的数据对与DTO连接的MAP的属性数据进行转换、更新或者修改等,进而可以使得与DTO连接的所有MAP调用点保持统一,其中调用点提供的基本为MAP格式,与一个DTO具有映射关系的MAP可能被多个地方使用,因此可以保证调用点保持统一。2. An object mutual conversion method provided by an embodiment of the present application, said obtaining two pre-stored data transmission objects with a mapping relationship, and extracting at least one attribute data of the two data transmission objects includes: according to a preset time period Acquire the attribute data in the preset database, and update the attribute data of any data transmission object connected to the preset database according to the attribute data in the preset database. With this modification, in the embodiment provided in this application, the attribute data in the preset database is acquired according to the preset time period, which can ensure the timeliness of the data and make the data relatively new. After the maintenance of the attribute data of the DTO , The attribute data of the MAP connected to the DTO can be converted, updated, or modified based on the data maintained by the DTO, so that all the MAP call points connected to the DTO can be unified, and the call points basically provide the MAP format. A MAP that has a mapping relationship with a DTO may be used in multiple places, so it can ensure that the calling point remains uniform.
本发明附加的方面和优点将在下面的描述中部分给出,这些将从下面的描述中变得明显,或通过本发明的实践了解到。The additional aspects and advantages of the present invention will be partly given in the following description, which will become obvious from the following description, or be understood through the practice of the present invention.
附图说明Description of the drawings
本发明上述的和/或附加的方面和优点从下面结合附图对实施例的描述中将变得明显和容易理解,其中:The above and/or additional aspects and advantages of the present invention will become obvious and easy to understand from the following description of the embodiments in conjunction with the accompanying drawings, in which:
图1为本发明对象互转方法的典型实施例中一种实施方式的流程示意图;FIG. 1 is a schematic flowchart of an implementation manner in a typical embodiment of the object mutual conversion method of the present invention;
图2为本发明对象互转装置的典型实施例的结构示意图;Fig. 2 is a schematic structural diagram of a typical embodiment of an object mutual conversion device of the present invention;
图3为本发明服务器的一实施例结构示意图。Figure 3 is a schematic structural diagram of an embodiment of the server of the present invention.
具体实施方式detailed description
下面详细描述本发明的实施例,所述实施例的示例在附图中示出,其中自始至终相同或类似的标号表示相同或类似的元件或具有相同或类似功能的元件。下面通过参考附图描述的实施例是示例性的,仅用于解释本发明,而不能解释为对本发明的限制。The embodiments of the present invention are described in detail below. Examples of the embodiments are shown in the accompanying drawings, in which the same or similar reference numerals indicate the same or similar elements or elements with the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary, and are only used to explain the present invention, and cannot be construed as limiting the present invention.
本技术领域技术人员可以理解,除非特意声明,这里使用的单数形式“一”、“一个”、“所述”和“该”也可包括复数形式。应该进一步理解的是,本发明的说明书中使用的措辞“包括”是指存在所述特征、整数、步骤、操作,但是并不排除存在或添加一个或多个其他特征、整数、步骤、操作。Those skilled in the art can understand that, unless specifically stated, the singular forms "a", "an", "said" and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present invention refers to the presence of the described features, integers, steps, and operations, but does not exclude the presence or addition of one or more other features, integers, steps, and operations.
本技术领域技术人员可以理解,除非另外定义,这里使用的所有术语(包括技术术语和科学术语),具有与本发明所属领域中的普通技术人员的一般理解相同的意义。还应该理解的是,诸如通用字典中定义的那些术语,应该被理解为具有与现有技术的上下文中的意义一致的意义,并且除非像这里一样被特定定义,否则不会用理想化或过于正式的含义来解释。Those skilled in the art can understand that, unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meanings as commonly understood by those of ordinary skill in the art to which the present invention belongs. It should also be understood that terms such as those defined in general dictionaries should be understood to have a meaning consistent with the meaning in the context of the prior art, and unless specifically defined as here, they will not be idealized or overly Explain the formal meaning.
本领域技术人员应当理解,本发明所称的“应用”、“计算机可读指令”、 “应用软件”以及类似表述的概念,是业内技术人员所公知的相同概念,是指由一系列计算机指令及相关数据资源有机构造的适于电子运行的计算机软件。除非特别指定,这种命名本身不受编程语言种类、级别,也不受其赖以运行的操作系统或平台所限制。理所当然地,此类概念也不受任何形式的终端所限制。Those skilled in the art should understand that the “application”, “computer-readable instructions”, The concepts of "application software" and similar expressions are the same concepts known to those skilled in the industry, and refer to computer software suitable for electronic operation that is organically constructed by a series of computer instructions and related data resources. Unless specifically specified, this naming itself is not restricted by the type and level of programming language, nor the operating system or platform on which it runs. Of course, such concepts are not restricted by any form of terminal.
本申请实施例提供的一种对象互转方法,在其中一种实施方式中,如图1所示,包括:S100、S200、S300。The method for mutual conversion of objects provided by the embodiments of the present application, in one of the implementation manners, as shown in FIG. 1, includes: S100, S200, and S300.
S100:获取预存的具有映射关系的两数据传输对象,提取两所述数据传输对象的至少一个属性数据;S100: Obtain two pre-stored data transmission objects with a mapping relationship, and extract at least one attribute data of the two data transmission objects;
S200:依据预设数据库中的属性数据将一所述数据传输对象的所述属性数据确定为转换基准数据;S200: Determine the attribute data of a data transmission object as conversion reference data according to attribute data in a preset database;
S300:依据所述转换基准数据更新另一所述数据传输对象的属性数据。S300: Update the attribute data of another data transmission object according to the conversion reference data.
本申请实施例提供的一种对象互转方法主要应用于MAP(将键映射到值的对象)与DTO(数据传输对象)之间的转换,更进一步地,该方法通过对象互转类实现MAP(将键映射到值的对象)与DTO(数据传输对象)之间的转换,即MAP与DTO的转换主要通过该对象互转类实现,在MAP和DTO之间增加该对象互转类可以减少MAP和DTO转换代码的编写量,同时可以MAP和DTO的维护更为方便,进而降低研发人员和维护人员的工作量,提高开发的效率,同时由于通过该对象互转类实现MAP和DTO的转换,在减少MAP和DTO转换的代码量时,还使得整个程序更为简单,避免占用更多的栈内存,也提高了MAP和DTO之间的转换效率。The object conversion method provided by the embodiments of this application is mainly applied to the conversion between MAP (objects that map keys to values) and DTO (data transfer objects). Furthermore, this method implements MAP through object conversion classes. The conversion between (the object that maps the key to the value) and the DTO (data transfer object), that is, the conversion between MAP and DTO is mainly realized through the object conversion class. Adding the object conversion class between MAP and DTO can reduce The amount of MAP and DTO conversion code is written, and the maintenance of MAP and DTO can be more convenient, thereby reducing the workload of R&D personnel and maintenance personnel and improving the efficiency of development. At the same time, the conversion between MAP and DTO is realized through the object conversion class , While reducing the amount of code for MAP and DTO conversion, it also makes the entire program simpler, avoids occupying more stack memory, and also improves the conversion efficiency between MAP and DTO.
为了实现前述的有益效果,本申请实施例提供的对象互转方法,首先是获取具有映射关系的量数据传输对象,如前述的具有映射关系的MAP和DTO,其中,MAP对象通常包括key(键)和value(值)中的一种或者两种,key中可以包括多个字段,value也可以包括多个值,且与key中的字段对应,MAP与DTO之间的映射关系为DTO属性映射到MAP的KEY,MAP的value映射到DTO的属性值。因此,为了实现数据的更新,基于MAP和DTO之间的映射关系,提取DTO和MAP的属性数据,相应的,属性数据包括属性、属性值中的一种或者两种,如前述MAP的key和value以及DTO的属性和属性值。为了确定DTO和MAP中的最新属性数据,则依据预设数据库中的属性数据确定转换基准数据,其中转换基准数据可以为DTO或者MAP中的属性和属性值中任意一个或者两个,或者MAP和DTO中各包括一个新的属性数据,将最新的属性数据确定为转换基准数据,更进一步地,该预设数据库可以与DTO和/或MAP连接,当预设数据库中仅与DTO和MAP中任意一个连接时,由于DTO和MAP的数据均是基于数据库中数据进行更新,则以与预设数据库连接的数据传输对象中的数据作为转换基准数据。在确定了转换基准数据之后,则以该转换基准数据更新另一数据传输对象的属性数据,例如,当DTO中的属性为最新数据时,则以DTO中的属性数据更新MAP的key,或者当MAP中的value为最新的属性数据时,则以MAP的value更新DTO的属性值。In order to achieve the aforementioned beneficial effects, the object conversion method provided by the embodiments of the present application firstly obtains a data transfer object with a mapping relationship, such as the aforementioned MAP and DTO with a mapping relationship, where the MAP object usually includes a key (key One or both of) and value (value), the key can include multiple fields, and the value can also include multiple values, and correspond to the fields in the key. The mapping relationship between MAP and DTO is DTO attribute mapping To the KEY of MAP, the value of MAP is mapped to the attribute value of DTO. Therefore, in order to update the data, based on the mapping relationship between MAP and DTO, extract the attribute data of DTO and MAP. Correspondingly, the attribute data includes one or two of attributes and attribute values, such as the key and key of the aforementioned MAP. value and the attributes and attribute values of the DTO. In order to determine the latest attribute data in DTO and MAP, the conversion reference data is determined according to the attribute data in the preset database. The conversion reference data can be any one or two of the attributes and attribute values in DTO or MAP, or MAP and Each DTO includes a new attribute data, and the latest attribute data is determined as the conversion benchmark data. Furthermore, the preset database can be connected with DTO and/or MAP. When the preset database is only connected to any of DTO and MAP When a connection is made, since the data of DTO and MAP are updated based on the data in the database, the data in the data transmission object connected to the preset database is used as the conversion reference data. After the conversion reference data is determined, the attribute data of another data transmission object is updated with the conversion reference data. For example, when the attribute in the DTO is the latest data, the MAP key is updated with the attribute data in the DTO, or when When the value in the MAP is the latest attribute data, the attribute value of the DTO is updated with the value of the MAP.
可选地,所述依据所述转换基准数据更新另一所述数据传输对象的属性或属性值,包括:Optionally, the updating the attribute or attribute value of another data transmission object according to the conversion reference data includes:
对比所述转换基准数据和另一所述数据传输对象中与所述转换基准数据具有映射关系的所述属性数据;Comparing the conversion reference data with the attribute data that has a mapping relationship with the conversion reference data in another data transmission object;
当所述转换基准数据和另一所述数据传输对象中与所述转换基准数据具有映射关系的所述属性数据不一致时,调用所述转换基准数据作为另一所述数据传输对象的属性数据,且该属性数据与所述转换基准数据具有映射关系。When the conversion reference data is inconsistent with the attribute data that has a mapping relationship with the conversion reference data in another data transmission object, calling the conversion reference data as the attribute data of the other data transmission object, And the attribute data has a mapping relationship with the conversion reference data.
结合前述说明,本申请实施例提供的一种对象互转方法,在进行属性数据更新的过程中,需要新确定另一所述数据传输对象的属性数据是否为最新的属性数据,避免两者一致时,还进行属性数据的更新,以降低栈内存的占用以及能源的消耗。因此在确定了转换基准数据时,将转换基准数据和另一所述数据传输对象中属性数据进行对比,由于转换基准数据为一个数据传输对象的属性数据,进而依据该属性数据更新与该数据传输对象具有映射关系的另一数据传输对象的属性数据。结合前述可知,数据传输对象之间的映射关系实际是属性数据之间的映射关系,因此,基于转换基准数据更新的是与该转换基准数据具有映射关系的另一数据传输对象的属性数据,进而在对比时,将转换基准数据与另一数据传输对象的属性数据进行对比,且两数据具有映射关系,在两数据不一致时,则可以依据转换基准数据更新另一数据传输对象的属性数据,通过先对比再更新的方法,可以避免无效的更新。In combination with the foregoing description, an object conversion method provided by the embodiment of the present application requires a new determination of whether the attribute data of another data transmission object is the latest attribute data in the process of updating attribute data, so as to avoid consistency between the two At the same time, the attribute data is also updated to reduce stack memory usage and energy consumption. Therefore, when the conversion reference data is determined, the conversion reference data is compared with the attribute data in another data transmission object. Since the conversion reference data is the attribute data of a data transmission object, the attribute data is updated and the data transmission The attribute data of another data transmission object whose object has a mapping relationship. In combination with the foregoing, the mapping relationship between data transmission objects is actually the mapping relationship between attribute data. Therefore, what is updated based on the conversion reference data is the attribute data of another data transmission object that has a mapping relationship with the conversion reference data. When comparing, compare the conversion reference data with the attribute data of another data transmission object, and the two data have a mapping relationship. When the two data are inconsistent, the attribute data of the other data transmission object can be updated according to the conversion reference data. The method of first comparison and then update can avoid invalid updates.
可选地,所述依据所述转换基准数据更新另一所述数据传输对象的属性或属性值之后,包括:Optionally, after updating the attribute or attribute value of another data transmission object according to the conversion reference data, the method includes:
对比所述转换基准数据和更新后的所述另一所述数据传输对象的所属性数据;Comparing the conversion reference data with the updated attribute data of the another data transmission object;
当所述转换基准数据和更新后的所述另一所述数据传输对象的所属性数据不一致时,获取所述转换基准数据,生成包括所述转换基准数据的提醒信息,向用户发送所述提醒信息。When the conversion reference data is inconsistent with the updated attribute data of the other data transmission object, the conversion reference data is acquired, the reminder information including the conversion reference data is generated, and the reminder is sent to the user information.
结合前文说明,在基于转换基准数据更新另一所述数据传输对象的所述属性数据之后,为了能够确定属性数据更新成功,还需要对比转换基准数据和更新后的另一所述数据传输对象的属性数据。当两者不一致时,为了使得研发人员或者维护人员能够及时地对该状况作出响应,则向对应的用户发送提醒信息,其中,需要获取转换基准数据,以便于生成包括转换基准数据的提醒信息,即提醒信息中包括了转换基准数据,更进一步地,还可以获取包括该转换基准数据的数据传输对象以及与该数据传输对象具有映射关系的另一数据传输对象的详细信息,以便于研发人员或者维护人员能够快递地查找到对应的数据传输对象,找到数据转换不成功的原因并进行解决。In combination with the foregoing description, after updating the attribute data of another data transmission object based on the conversion reference data, in order to be able to determine that the attribute data update is successful, it is also necessary to compare the conversion reference data with the updated data transmission object’s Attribute data. When the two are inconsistent, in order to enable the R&D personnel or maintenance personnel to respond to the situation in a timely manner, a reminder message is sent to the corresponding user. Among them, the conversion benchmark data needs to be obtained in order to generate the reminder information including the conversion benchmark data. That is, the reminder information includes the conversion reference data. Furthermore, the data transmission object including the conversion reference data and the detailed information of another data transmission object that has a mapping relationship with the data transmission object can also be obtained for the convenience of R&D personnel or The maintenance personnel can find the corresponding data transmission object by express, find the reason for the unsuccessful data conversion and solve it.
可选地,所述获取所述转换基准数据,生成包括所述转换基准数据的提醒信息,包括:Optionally, the acquiring the conversion benchmark data and generating the reminder information including the conversion benchmark data includes:
所述属性数据包括属性名称和属性值;The attribute data includes attribute name and attribute value;
当所述转换基准数据为所述属性时,获取所述属性的字段,基于所述字段生成属性转换失败的提醒信息;When the conversion reference data is the attribute, acquiring the attribute field, and generating a reminder information of the attribute conversion failure based on the field;
当所述转换基准数据为所述属性值时,获取所述属性值、所述属性值对应的同一数据传输对象的属性,依据所述属性值和所述属性生成属性值赋值失败的提醒信息。When the conversion reference data is the attribute value, the attribute value and the attribute of the same data transmission object corresponding to the attribute value are acquired, and a reminder message of attribute value assignment failure is generated according to the attribute value and the attribute.
如前述,属性数据包括属性名称(也即前文中的属性)和属性值,当转换基准数据为所述属性名称时,为了使得研发人员或者维护人员能够更为快速地确定转换失败的原因和节点,则获取属性名称的字段,基于该字段生成属性转换失败的提醒信息,在本申请提供的实施例中,可以预设置提醒信息的模板,当将DTO的属性数据转换为MAP的属性数据时,提醒信息模板如fieldName + "转换失败 ",fieldName为对应的属性名称,当该数据传输对象为用于对应行业相关用户的数据传输时,该提醒信息还可以设置为"存量客户字段" + fieldName + "转换失败 ",其中存量客户字段为相关客户的信息;在另一种情况中,当将MAP的属性数据转换为DTO的属性数据时,提醒信息模板如key + "方法赋值" + value + "失败",通过前述过程可以更为具体的知道具体转换失败的数据信息,进而使得开发人员或者维护人员针对性的解决转换失败的原因。As mentioned above, the attribute data includes the attribute name (that is, the attribute in the preceding text) and the attribute value. When the conversion reference data is the attribute name, in order to enable R&D personnel or maintenance personnel to more quickly determine the reason and node of the conversion failure , The field of the attribute name is obtained, and the reminder information of the attribute conversion failure is generated based on the field. In the embodiment provided in this application, the reminder message template can be preset. When the attribute data of DTO is converted to the attribute data of MAP, Reminder message template such as fieldName + "Conversion failed", fieldName is the corresponding attribute name, when the data transmission object is used for data transmission of the corresponding industry-related users, the reminder message can also be set as "stock customer field" + fieldName + "Conversion failed", where the stock customer field is the information of the related customer; in another case, when the attribute data of MAP is converted to the attribute data of DTO, a reminder information template such as key + "Method Assignment" + value + "Failure", through the foregoing process, you can know the specific data information of the conversion failure in more detail, so that the developer or maintainer can solve the cause of the conversion failure in a targeted manner.
可选地,所述当所述转换基准数据和更新后的所述另一所述数据传输对象的所属性数据不一致时,获取所述转换基准数据之后,还包括:Optionally, when the conversion reference data is inconsistent with the updated attribute data of the another data transmission object, after obtaining the conversion reference data, the method further includes:
依据所述转换基准数据生成转换失败日志。A conversion failure log is generated according to the conversion reference data.
在本申请提供的实施例中,在获取到转换基准数据之后,在方便后期进行数据的维护,避免后期产生相同的问题,依据转换基准数据生成转换失败日志,则可以对日志进行监控,在监控到转换失败的日志时,则可以向用户发送前述的提醒信息,或者将该日志进行整理归类。In the embodiment provided in this application, after the conversion benchmark data is obtained, it is convenient to maintain the data in the later period to avoid the same problems in the later period. If the conversion failure log is generated based on the conversion benchmark data, the log can be monitored. When it comes to the log of the conversion failure, the aforementioned reminder information can be sent to the user, or the log can be sorted and classified.
可选地,所述获取预存的具有映射关系的两数据传输对象,提取两所述数据传输对象的至少一个属性数据之前,包括:Optionally, before the acquiring two pre-stored data transmission objects with a mapping relationship and extracting at least one attribute data of the two data transmission objects, the method includes:
按照预设时间周期获取所述预设数据库中的所述属性数据,依据所述预设数据库中的所述属性数据更新与所述预设数据库连接的任一所述数据传输对象的属性数据。The attribute data in the preset database is acquired according to a preset time period, and the attribute data of any data transmission object connected to the preset database is updated according to the attribute data in the preset database.
在本申请提供的一种实施方式中,为了得到较新的转换基准数据,以便于后期能够更具该数据进行其他数据传输对象的属性数据的更新,按照预设时间周期获取所述预设数据库中的属性数据,其中时间周期可以为小时、天、月等为单位,更进一步,还可以在数据库中的属性数据发生变化之后,则立刻进行数据传输对象属性数据的更新,进而可以实现对数据传输对象的维护,特别地,在数据传输对象为DTO时,可对DTO做如下的维护:数据库增加字段,字段类型的改变等,展示层格式修改等情况。通过该修改,在本申请提供的实施例中,仅对DTO进行前述的维护之后,则可以基于DTO维护后的数据对与DTO连接的MAP的属性数据进行转换、更新或者修改等,进而可以使得与DTO连接的所有MAP调用点保持统一,其中调用点提供的基本为MAP格式,与一个DTO具有映射关系的MAP可能被多个地方使用,因此可以保证调用点保持统一。例如,结合前述说明,所有调用点需要获取MAP中的applno出参,通过本申请实施例提供的对象互转方法集成的对象转换类,就可以通过DTO转换为MAP的工具方法实现applno出参,代码不涉及写死的”applyNo”key值。即仅将将DTO中的属性applyNo修改为applNo就可以实现调用点获取MAP中的applno出参。In an implementation manner provided by this application, in order to obtain newer conversion benchmark data so that the attribute data of other data transmission objects can be updated with this data later, the preset database is acquired according to a preset time period. In the attribute data, the time period can be in units of hours, days, months, etc. Furthermore, after the attribute data in the database changes, the attribute data of the data transmission object can be updated immediately, and the data can be updated The maintenance of the transmission object, in particular, when the data transmission object is a DTO, the following maintenance can be performed on the DTO: adding fields to the database, changing field types, etc., and modifying the display layer format. Through this modification, in the embodiment provided in this application, after only the aforementioned maintenance is performed on the DTO, the attribute data of the MAP connected to the DTO can be converted, updated, or modified based on the data after the DTO maintenance, so as to make All MAP call points connected with DTO remain unified. The basic MAP format provided by the call point is the MAP format. The MAP that has a mapping relationship with a DTO may be used in multiple places, so it can ensure that the call points remain unified. For example, in combination with the foregoing description, all call points need to obtain the applno output parameter in the MAP. Through the object conversion class integrated with the object conversion method provided in the embodiment of this application, the applno output parameter can be realized through the tool method of DTO conversion to MAP. The code does not involve the hard-coded "applyNo" key value. That is, only by modifying the attribute applyNo in the DTO to applNo, the calling point can obtain the applno output parameter in the MAP.
本发明实施例还提供了一种对象互转装置,在其中一种实施方式中,如图2所示,包括:提取模块100、转换基准数据确定模块200、更新模块300:The embodiment of the present invention also provides an object mutual conversion device. In one of the implementations, as shown in FIG. 2, it includes: an extraction module 100, a conversion reference data determination module 200, and an update module 300:
提取模块100,用于获取预存的具有映射关系的两数据传输对象,提取两所述数据传输对象的至少一个属性数据;The extraction module 100 is configured to obtain two pre-stored data transmission objects with a mapping relationship, and extract at least one attribute data of the two data transmission objects;
转换基准数据确定模块200,用于依据预设数据库中的属性数据将一所述数据传输对象的所述属性数据确定为转换基准数据;The conversion reference data determining module 200 is configured to determine the attribute data of a data transmission object as conversion reference data according to the attribute data in a preset database;
更新模块300,用于依据所述转换基准数据更新另一所述数据传输对象的属性数据。The update module 300 is used to update the attribute data of another data transmission object according to the conversion reference data.
进一步地,如图2所示,本发明实施例中提供的一种对象互转装置还包括:第一对比单元310,用于对比所述转换基准数据和另一所述数据传输对象中与所述转换基准数据具有映射关系的所述属性数据;调用单元320,用于当所述转换基准数据和另一所述数据传输对象中与所述转换基准数据具有映射关系的所述属性数据不一致时,调用所述转换基准数据作为另一所述数据传输对象的属性数据,且该属性数据与所述转换基准数据具有映射关系。对比模块410,用于对比所述转换基准数据和更新后的所述另一所述数据传输对象的所属性数据;发送模块420,用于当所述转换基准数据和更新后的所述另一所述数据传输对象的所属性数据不一致时,获取所述转换基准数据,生成包括所述转换基准数据的提醒信息,向用户发送所述提醒信息。第一提醒信息生成单元421,用于当所述转换基准数据为所述属性时,获取所述属性的字段,基于所述字段生成属性转换失败的提醒信息;第二提醒信息生成单元421,用于当所述转换基准数据为所述属性值时,获取所述属性值、所述属性值对应的同一数据传输对象的属性,依据所述属性值和所述属性生成属性值赋值失败的提醒信息。日志生成单元423,用于依据所述转换基准数据生成转换失败日志。获取模块101,用于按照预设时间周期获取所述预设数据库中的所述属性数据,依据所述预设数据库中的所述属性数据更新与所述预设数据库连接的任一所述数据传输对象的属性数据。Further, as shown in FIG. 2, an object mutual conversion device provided in an embodiment of the present invention further includes: a first comparison unit 310, configured to compare the conversion reference data with another object in the data transmission object. The conversion reference data has the attribute data that has a mapping relationship; the calling unit 320 is used for when the conversion reference data is inconsistent with the attribute data that has a mapping relationship with the conversion reference data in another data transmission object , Calling the conversion reference data as attribute data of another data transmission object, and the attribute data has a mapping relationship with the conversion reference data. The comparison module 410 is used to compare the converted reference data with the updated attribute data of the another data transmission object; the sending module 420 is used to compare the conversion reference data with the updated other attribute data; When the attribute data of the data transmission object is inconsistent, the conversion reference data is obtained, the reminder information including the conversion reference data is generated, and the reminder information is sent to the user. The first reminder information generating unit 421 is configured to obtain the attribute field when the conversion reference data is the attribute, and generate reminder information indicating that the attribute conversion fails based on the field; the second reminder information generating unit 421 uses When the conversion reference data is the attribute value, the attribute value and the attribute of the same data transmission object corresponding to the attribute value are acquired, and a reminder message of attribute value assignment failure is generated according to the attribute value and the attribute . The log generating unit 423 is configured to generate a conversion failure log according to the conversion reference data. The obtaining module 101 is configured to obtain the attribute data in the preset database according to a preset time period, and update any of the data connected to the preset database according to the attribute data in the preset database The attribute data of the transfer object.
本发明实施例提供的一种对象互转装置可以实现上述对象互转方法的实施例,具体功能实现请参见方法实施例中的说明,在此不再赘述。 An object mutual conversion apparatus provided in an embodiment of the present invention can implement the foregoing embodiment of the object mutual conversion method. For specific functional realization, please refer to the description in the method embodiment, which will not be repeated here.
本发明实施例提供的一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机可读指令,其中所述计算机可读存储介质可以为非易失性可读存储介质,该计算机可读指令被处理器执行时实现任一项技术方案所述的对象互转方法。其中,所述计算机可读存储介质包括但不限于任何类型的盘(包括软盘、硬盘、光盘、CD-ROM、和磁光盘)、ROM(Read-Only Memory,只读存储器)、RAM(Random AcceSS Memory,随即存储器)、EPROM(EraSable Programmable Read-Only Memory,可擦写可编程只读存储器)、EEPROM(Electrically EraSable Programmable Read-Only Memory,电可擦可编程只读存储器)、闪存、磁性卡片或光线卡片。也就是,存储设备包括由设备(例如,计算机、手机)以能够读的形式存储或传输信息的任何介质,可以是只读存储器,磁盘或光盘等。An embodiment of the present invention provides a computer-readable storage medium having computer-readable instructions stored on the computer-readable storage medium, wherein the computer-readable storage medium may be a non-volatile readable storage medium. When the readable instructions are executed by the processor, the method for mutual conversion of objects described in any one of the technical solutions is implemented. Wherein, the computer-readable storage medium includes but is not limited to any type of disk (including floppy disk, hard disk, optical disk, CD-ROM, and magneto-optical disk), ROM (Read-Only Memory, read-only memory), RAM (Random AcceSS Memory, random memory), EPROM (EraSable Programmable Read-Only Memory, erasable programmable read-only memory), EEPROM (Electrically EraSable Programmable Read-Only Memory, electrically erasable programmable read-only memory), flash memory, magnetic card or optical card. That is, a storage device includes any medium that stores or transmits information in a readable form by a device (for example, a computer, a mobile phone), and may be a read-only memory, a magnetic disk, or an optical disk.
本发明实施例提供的一种计算机可读存储介质,可实现上述对象互转方法的实施例,在本申请中通过具有映射关系的数据传输对象之间的对象互转类实现数据传输对象之间的属性数据转换,通过将转换过程的代码集成到该类中,并结合映射关系以及反射机制实现属性数据确定以及转换,减少数据传输对象之间数据转换的代码编写量,进而降低开发人员的工作量,同时也便于后期对数据传输对象的维护,使得代码的逻辑也更为清晰,也方便对于与DTO连接的其他调用点的MAP数据维护,使得MAP数据能与DTO数据保持统一;本申请实施例提供的一种对象互转方法,包括:获取预存的具有映射关系的两数据传输对象,提取两所述数据传输对象的至少一个属性数据;依据预设数据库中的属性数据将一所述数据传输对象的所述属性数据确定为转换基准数据;依据所述转换基准数据更新另一所述数据传输对象的属性数据。本申请实施例提供的一种对象互转方法主要应用于MAP(将键映射到值的对象)与DTO(数据传输对象)之间的转换,更进一步地,该方法通过对象互转类实现MAP(将键映射到值的对象)与DTO(数据传输对象)之间的转换,即MAP与DTO的转换主要通过该对象互转类实现,在MAP和DTO之间增加该对象互转类可以减少MAP和DTO转换代码的编写量,同时可以MAP和DTO的维护更为方便,进而降低研发人员和维护人员的工作量,提高开发的效率,同时由于通过该对象互转类实现MAP和DTO的转换,在减少MAP和DTO转换的代码量时,还使得整个程序更为简单,避免占用更多的栈内存,也提高了MAP和DTO之间的转换效率。为了实现前述的有益效果,本申请实施例提供的对象互转方法,首先是获取具有映射关系的量数据传输对象,如前述的具有映射关系的MAP和DTO,其中,MAP对象通常包括key(键)和value(值)中的一种或者两种,key中可以包括多个字段,value也可以包括多个值,且与key中的字段对应,MAP与DTO之间的映射关系为DTO属性映射到MAP的KEY,MAP的value映射到DTO的属性值。因此,为了实现数据的更新,基于MAP和DTO之间的映射关系,提取DTO和MAP的属性数据,相应的,属性数据包括属性、属性值中的一种或者两种,如前述MAP的key和value以及DTO的属性和属性值。为了确定DTO和MAP中的最新属性数据,则依据预设数据库中的属性数据确定转换基准数据,其中转换基准数据可以为DTO或者MAP中的属性和属性值中任意一个或者两个,或者MAP和DTO中各包括一个新的属性数据,将最新的属性数据确定为转换基准数据,更进一步地,该预设数据库可以与DTO和/或MAP连接,当预设数据库中仅与DTO和MAP中任意一个连接时,由于DTO和MAP的数据均是基于数据库中数据进行更新,则以与预设数据库连接的数据传输对象中的数据作为转换基准数据。在确定了转换基准数据之后,则以该转换基准数据更新另一数据传输对象的属性数据,例如,当DTO中的属性为最新数据时,则以DTO中的属性数据更新MAP的key,或者当MAP中的value为最新的属性数据时,则以MAP的value更新DTO的属性值。An embodiment of the present invention provides a computer-readable storage medium that can implement the above-mentioned object conversion method. In this application, the object conversion class between data transmission objects with a mapping relationship is used to implement data transmission objects. Attribute data conversion, by integrating the code of the conversion process into this class, and combining the mapping relationship and reflection mechanism to achieve attribute data determination and conversion, reducing the amount of code writing for data conversion between data transmission objects, thereby reducing the work of developers At the same time, it also facilitates the maintenance of data transmission objects in the later period, which makes the logic of the code clearer, and also facilitates the maintenance of MAP data of other call points connected with DTO, so that MAP data can be unified with DTO data; this application is implemented The method for mutual conversion of objects provided in the example includes: obtaining two pre-stored data transmission objects with a mapping relationship, extracting at least one attribute data of the two data transmission objects; and converting one of the data according to the attribute data in the preset database The attribute data of the transmission object is determined to be conversion reference data; the attribute data of another data transmission object is updated according to the conversion reference data. The object conversion method provided by the embodiments of this application is mainly applied to the conversion between MAP (objects that map keys to values) and DTO (data transfer objects). Furthermore, this method implements MAP through object conversion classes. The conversion between (the object that maps the key to the value) and the DTO (data transfer object), that is, the conversion between MAP and DTO is mainly realized through the object conversion class. Adding the object conversion class between MAP and DTO can reduce The amount of MAP and DTO conversion code is written, and the maintenance of MAP and DTO can be more convenient, thereby reducing the workload of R&D personnel and maintenance personnel and improving the efficiency of development. At the same time, the conversion between MAP and DTO is realized through the object conversion class , While reducing the amount of code for MAP and DTO conversion, it also makes the entire program simpler, avoids occupying more stack memory, and also improves the conversion efficiency between MAP and DTO. In order to achieve the aforementioned beneficial effects, the object conversion method provided by the embodiments of the present application firstly obtains a data transfer object with a mapping relationship, such as the aforementioned MAP and DTO with a mapping relationship, where the MAP object usually includes a key (key One or both of) and value (value), the key can include multiple fields, and the value can also include multiple values, and correspond to the fields in the key. The mapping relationship between MAP and DTO is DTO attribute mapping To the KEY of MAP, the value of MAP is mapped to the attribute value of DTO. Therefore, in order to update the data, based on the mapping relationship between MAP and DTO, extract the attribute data of DTO and MAP. Correspondingly, the attribute data includes one or two of attributes and attribute values, such as the key and key of the aforementioned MAP. value and the attributes and attribute values of the DTO. In order to determine the latest attribute data in DTO and MAP, the conversion reference data is determined according to the attribute data in the preset database. The conversion reference data can be any one or two of the attributes and attribute values in DTO or MAP, or MAP and Each DTO includes a new attribute data, and the latest attribute data is determined as the conversion benchmark data. Furthermore, the preset database can be connected with DTO and/or MAP. When the preset database is only connected to any of DTO and MAP When a connection is made, since the data of DTO and MAP are updated based on the data in the database, the data in the data transmission object connected to the preset database is used as the conversion reference data. After the conversion reference data is determined, the attribute data of another data transmission object is updated with the conversion reference data. For example, when the attribute in the DTO is the latest data, the MAP key is updated with the attribute data in the DTO, or when When the value in the MAP is the latest attribute data, the attribute value of the DTO is updated with the value of the MAP.
此外,在又一种实施例中,本发明还提供一种服务器,如图3所示,所述服务器处理器503、存储器505、输入单元507以及显示单元509等器件。本领域技术人员可以理解,图3示出的结构器件并不构成对所有服务器的限定,可以包括比图示更多或更少的部件,或者组合某些部件。存储器505可用于存储计算机可读指令501以及各功能模块,处理器503运行存储在存储器505的计算机可读指令501,从而执行设备的各种功能应用以及数据处理。存储器505可以是内存储器或外存储器,或者包括内存储器和外存储器两者。内存储器可以包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦写可编程ROM(EEPROM)、快闪存储器、或者随机存储器。外存储器可以包括硬盘、软盘、ZIP盘、U盘、磁带等。本发明所公开的存储器包括但不限于这些类型的存储器。本发明所公开的存储器505只作为例子而非作为限定。In addition, in another embodiment, the present invention also provides a server. As shown in FIG. 3, the server processor 503, memory 505, input unit 507, display unit 509 and other devices. Those skilled in the art can understand that the structural components shown in FIG. 3 do not constitute a limitation on all servers, and may include more or less components than those shown in the figure, or combine certain components. The memory 505 may be used to store computer-readable instructions 501 and various functional modules, and the processor 503 runs the computer-readable instructions 501 stored in the memory 505 to execute various functional applications and data processing of the device. The memory 505 may be an internal memory or an external memory, or include both internal memory and external memory. The internal memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), flash memory, or random access memory. External storage can include hard disks, floppy disks, ZIP disks, U disks, tapes, etc. The memory disclosed in the present invention includes but is not limited to these types of memory. The memory 505 disclosed in the present invention is only an example and not a limitation.
输入单元507用于接收信号的输入,以及用户输入的个人信息和相关的身体状况信息。输入单元507可包括触控面板以及其它输入设备。触控面板可收集客户在其上或附近的触摸操作(比如客户使用手指、触笔等任何适合的物体或附件在触控面板上或在触控面板附近的操作),并根据预先设定的程序驱动相应的连接装置;其它输入设备可以包括但不限于物理键盘、功能键(比如播放控制按键、开关按键等)、轨迹球、鼠标、操作杆等中的一种或多种。显示单元509可用于显示客户输入的信息或提供给客户的信息以及计算机设备的各种菜单。显示单元509可采用液晶显示器、有机发光二极管等形式。处理器503是计算机设备的控制中心,利用各种接口和线路连接整个电脑的各个部分,通过运行或执行存储在存储器503内的软件程序和/或模块,以及调用存储在存储器内的数据,执行各种功能和处理数据。图3中所示的一个或多个处理器503能够执行、实现图2中所示的提取模块100的功能、转换基准数据确定模块200的功能、更新模块300的功能、第一对比单元310的功能、调用单元320的功能、对比模块410的功能、发送模块420的功能、第一提醒信息生成单元421的功能、第二提醒信息生成单元421的功能、日志生成单元423的功能、获取模块101的功能。The input unit 507 is used to receive signal input, as well as personal information and related physical condition information input by the user. The input unit 507 may include a touch panel and other input devices. The touch panel can collect customer touch operations on or near it (for example, customers use fingers, stylus and other suitable objects or accessories to operate on the touch panel or near the touch panel), and according to the preset The program drives the corresponding connection device; other input devices may include, but are not limited to, one or more of a physical keyboard, function keys (such as playback control buttons, switch buttons, etc.), trackball, mouse, and joystick. The display unit 509 can be used to display information input by the customer or information provided to the customer and various menus of the computer device. The display unit 509 can take the form of a liquid crystal display, an organic light emitting diode, or the like. The processor 503 is the control center of the computer equipment. It uses various interfaces and lines to connect the various parts of the entire computer. By running or executing the software programs and/or modules stored in the memory 503, and calling the data stored in the memory, execute Various functions and processing data. The one or more processors 503 shown in FIG. 3 can execute and realize the function of the extraction module 100 shown in FIG. 2, the function of the conversion reference data determination module 200, the function of the update module 300, and the function of the first comparison unit 310. Function, function of calling unit 320, function of comparison module 410, function of sending module 420, function of first reminder information generating unit 421, function of second reminder information generating unit 421, function of log generating unit 423, acquisition module 101 Function.
在一种实施方式中,所述服务器包括一个或多个处理器503,以及一个或多个存储器505,一个或多个计算机可读指令501,其中所述一个或多个计算机可读指令501被存储在存储器505中并被配置为由所述一个或多个处理器503执行,所述一个或多个计算机可读指令301配置用于执行以上实施例所述的对象互转方法。In one embodiment, the server includes one or more processors 503, one or more memories 505, and one or more computer-readable instructions 501, wherein the one or more computer-readable instructions 501 are It is stored in the memory 505 and configured to be executed by the one or more processors 503, and the one or more computer-readable instructions 301 are configured to execute the object mutual conversion method described in the above embodiments.
本发明实施例提供的一种服务器,可实现上述对象互转方法的实施例,在本申请中通过具有映射关系的数据传输对象之间的对象互转类实现数据传输对象之间的属性数据转换,通过将转换过程的代码集成到该类中,并结合映射关系以及反射机制实现属性数据确定以及转换,减少数据传输对象之间数据转换的代码编写量,进而降低开发人员的工作量,同时也便于后期对数据传输对象的维护,使得代码的逻辑也更为清晰,也方便对于与DTO连接的其他调用点的MAP数据维护,使得MAP数据能与DTO数据保持统一;本申请实施例提供的一种对象互转方法,包括:获取预存的具有映射关系的两数据传输对象,提取两所述数据传输对象的至少一个属性数据;依据预设数据库中的属性数据将一所述数据传输对象的所述属性数据确定为转换基准数据;依据所述转换基准数据更新另一所述数据传输对象的属性数据。本申请实施例提供的一种对象互转方法主要应用于MAP(将键映射到值的对象)与DTO(数据传输对象)之间的转换,更进一步地,该方法通过对象互转类实现MAP(将键映射到值的对象)与DTO(数据传输对象)之间的转换,即MAP与DTO的转换主要通过该对象互转类实现,在MAP和DTO之间增加该对象互转类可以减少MAP和DTO转换代码的编写量,同时可以MAP和DTO的维护更为方便,进而降低研发人员和维护人员的工作量,提高开发的效率,同时由于通过该对象互转类实现MAP和DTO的转换,在减少MAP和DTO转换的代码量时,还使得整个程序更为简单,避免占用更多的栈内存,也提高了MAP和DTO之间的转换效率。为了实现前述的有益效果,本申请实施例提供的对象互转方法,首先是获取具有映射关系的量数据传输对象,如前述的具有映射关系的MAP和DTO,其中,MAP对象通常包括key(键)和value(值)中的一种或者两种,key中可以包括多个字段,value也可以包括多个值,且与key中的字段对应,MAP与DTO之间的映射关系为DTO属性映射到MAP的KEY,MAP的value映射到DTO的属性值。因此,为了实现数据的更新,基于MAP和DTO之间的映射关系,提取DTO和MAP的属性数据,相应的,属性数据包括属性、属性值中的一种或者两种,如前述MAP的key和value以及DTO的属性和属性值。为了确定DTO和MAP中的最新属性数据,则依据预设数据库中的属性数据确定转换基准数据,其中转换基准数据可以为DTO或者MAP中的属性和属性值中任意一个或者两个,或者MAP和DTO中各包括一个新的属性数据,将最新的属性数据确定为转换基准数据,更进一步地,该预设数据库可以与DTO和/或MAP连接,当预设数据库中仅与DTO和MAP中任意一个连接时,由于DTO和MAP的数据均是基于数据库中数据进行更新,则以与预设数据库连接的数据传输对象中的数据作为转换基准数据。在确定了转换基准数据之后,则以该转换基准数据更新另一数据传输对象的属性数据,例如,当DTO中的属性为最新数据时,则以DTO中的属性数据更新MAP的key,或者当MAP中的value为最新的属性数据时,则以MAP的value更新DTO的属性值。The embodiment of the present invention provides a server that can implement the embodiment of the above object mutual conversion method. In this application, the attribute data conversion between the data transmission objects is realized through the object mutual conversion class between the data transmission objects with the mapping relationship. , By integrating the code of the conversion process into this class, and combining the mapping relationship and reflection mechanism to realize the determination and conversion of attribute data, reducing the amount of code writing for data conversion between data transmission objects, thereby reducing the workload of developers, and also It is convenient to maintain the data transmission object in the later period, so that the logic of the code is clearer, and it is also convenient to maintain the MAP data of other call points connected to the DTO, so that the MAP data can be unified with the DTO data; the one provided in the embodiment of this application A method for mutual conversion of objects includes: obtaining two pre-stored data transmission objects with a mapping relationship, extracting at least one attribute data of the two data transmission objects; according to attribute data in a preset database, all data transmission objects The attribute data is determined to be conversion reference data; the attribute data of another data transmission object is updated according to the conversion reference data. The object conversion method provided by the embodiments of this application is mainly applied to the conversion between MAP (objects that map keys to values) and DTO (data transfer objects). Furthermore, this method implements MAP through object conversion classes. The conversion between (the object that maps the key to the value) and the DTO (data transfer object), that is, the conversion between MAP and DTO is mainly realized through the object conversion class. Adding the object conversion class between MAP and DTO can reduce The amount of MAP and DTO conversion code is written, and the maintenance of MAP and DTO can be more convenient, thereby reducing the workload of R&D personnel and maintenance personnel and improving the efficiency of development. At the same time, the conversion between MAP and DTO is realized through the object conversion class , While reducing the amount of code for MAP and DTO conversion, it also makes the entire program simpler, avoids occupying more stack memory, and also improves the conversion efficiency between MAP and DTO. In order to achieve the aforementioned beneficial effects, the object conversion method provided by the embodiments of the present application firstly obtains a data transfer object with a mapping relationship, such as the aforementioned MAP and DTO with a mapping relationship, where the MAP object usually includes a key (key One or both of) and value (value), the key can include multiple fields, and the value can also include multiple values, and correspond to the fields in the key. The mapping relationship between MAP and DTO is DTO attribute mapping To the KEY of MAP, the value of MAP is mapped to the attribute value of DTO. Therefore, in order to update the data, based on the mapping relationship between MAP and DTO, extract the attribute data of DTO and MAP. Correspondingly, the attribute data includes one or two of attributes and attribute values, such as the key and key of the aforementioned MAP. value and the attributes and attribute values of the DTO. In order to determine the latest attribute data in DTO and MAP, the conversion reference data is determined according to the attribute data in the preset database. The conversion reference data can be any one or two of the attributes and attribute values in DTO or MAP, or MAP and Each DTO includes a new attribute data, and the latest attribute data is determined as the conversion benchmark data. Furthermore, the preset database can be connected with DTO and/or MAP. When the preset database is only connected to any of DTO and MAP When a connection is made, since the data of DTO and MAP are updated based on the data in the database, the data in the data transmission object connected to the preset database is used as the conversion reference data. After the conversion reference data is determined, the attribute data of another data transmission object is updated with the conversion reference data. For example, when the attribute in the DTO is the latest data, the MAP key is updated with the attribute data in the DTO, or when When the value in the MAP is the latest attribute data, the attribute value of the DTO is updated with the value of the MAP.
本发明实施例提供的服务器可以实现上述提供的对象互转方法的实施例,具体功能实现请参见方法实施例中的说明,在此不再赘述。The server provided in the embodiment of the present invention can implement the embodiment of the object mutual conversion method provided above. For specific function implementation, please refer to the description in the method embodiment, which will not be repeated here.
以上所述仅是本发明的部分实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。The above are only part of the embodiments of the present invention. It should be pointed out that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and modifications can be made, and these improvements and modifications are also It should be regarded as the protection scope of the present invention.

Claims (20)

  1. 一种对象互转方法,其中,包括: An object conversion method, which includes:
    获取预存的具有映射关系的两数据传输对象,提取两所述数据传输对象的至少一个属性数据;Acquiring two pre-stored data transmission objects with a mapping relationship, and extracting at least one attribute data of the two data transmission objects;
    依据预设数据库中的属性数据将一所述数据传输对象的所述属性数据确定为转换基准数据;Determining the attribute data of a data transmission object as conversion reference data according to the attribute data in the preset database;
    依据所述转换基准数据更新另一所述数据传输对象的属性数据;Update the attribute data of another data transmission object according to the conversion reference data;
    其中,对比所述转换基准数据和另一所述数据传输对象中与所述转换基准数据具有映射关系的所述属性数据;Wherein, comparing the conversion reference data with the attribute data in another data transmission object that has a mapping relationship with the conversion reference data;
    当所述转换基准数据和另一所述数据传输对象中与所述转换基准数据具有映射关系的所述属性数据不一致时,调用所述转换基准数据作为另一所述数据传输对象的属性数据,且该属性数据与所述转换基准数据具有映射关系。When the conversion reference data is inconsistent with the attribute data that has a mapping relationship with the conversion reference data in another data transmission object, calling the conversion reference data as the attribute data of the other data transmission object, And the attribute data has a mapping relationship with the conversion reference data.
  2. 根据权利要求1所述的对象互转方法,其中,所述数据传输对象包括DTO和/或MAP,所述属性数据包括MAP的key和/或value、DTO的属性和/或属性值。The method for object mutual conversion according to claim 1, wherein the data transmission object includes a DTO and/or MAP, and the attribute data includes a key and/or value of the MAP, and an attribute and/or attribute value of the DTO.
  3. 根据权利要求1所述的对象互转方法,其中,所述依据所述转换基准数据更新另一所述数据传输对象的属性或属性值之后,包括:The method for object mutual conversion according to claim 1, wherein after the updating the attribute or attribute value of another data transmission object according to the conversion reference data, the method comprises:
    对比所述转换基准数据和更新后的所述另一所述数据传输对象的所属性数据;Comparing the conversion reference data with the updated attribute data of the another data transmission object;
    当所述转换基准数据和更新后的所述另一所述数据传输对象的所属性数据不一致时,获取所述转换基准数据,生成包括所述转换基准数据的提醒信息,向用户发送所述提醒信息。When the conversion reference data is inconsistent with the updated attribute data of the other data transmission object, the conversion reference data is acquired, the reminder information including the conversion reference data is generated, and the reminder is sent to the user information.
  4. 根据权利要求3所述的对象互转方法,其中,所述获取所述转换基准数据,生成包括所述转换基准数据的提醒信息,包括:The method for object mutual conversion according to claim 3, wherein said obtaining said conversion reference data and generating reminder information including said conversion reference data comprises:
    所述属性数据包括属性名称和属性值;The attribute data includes attribute name and attribute value;
    当所述转换基准数据为所述属性时,获取所述属性的字段,基于所述字段生成属性转换失败的提醒信息;When the conversion reference data is the attribute, acquiring the attribute field, and generating a reminder information of the attribute conversion failure based on the field;
    当所述转换基准数据为所述属性值时,获取所述属性值、所述属性值对应的同一数据传输对象的属性,依据所述属性值和所述属性生成属性值赋值失败的提醒信息。When the conversion reference data is the attribute value, the attribute value and the attribute of the same data transmission object corresponding to the attribute value are acquired, and a reminder message of attribute value assignment failure is generated according to the attribute value and the attribute.
  5. 根据权利要求3所述的对象互转方法,其中,所述当所述转换基准数据和更新后的所述另一所述数据传输对象的所属性数据不一致时,获取所述转换基准数据之后,还包括:4. The method of object mutual conversion according to claim 3, wherein, when the conversion reference data is inconsistent with the updated attribute data of the another data transmission object, after obtaining the conversion reference data, Also includes:
    依据所述转换基准数据生成转换失败日志。A conversion failure log is generated according to the conversion reference data.
  6. 根据权利要求1所述的对象互转方法,其中,所述获取预存的具有映射关系的两数据传输对象,提取两所述数据传输对象的至少一个属性数据之前,包括:The method for object mutual conversion according to claim 1, wherein, before said acquiring two pre-stored data transmission objects with a mapping relationship and extracting at least one attribute data of the two data transmission objects, it comprises:
    按照预设时间周期获取所述预设数据库中的所述属性数据,依据所述预设数据库中的所述属性数据更新与所述预设数据库连接的任一所述数据传输对象的属性数据。The attribute data in the preset database is acquired according to a preset time period, and the attribute data of any data transmission object connected to the preset database is updated according to the attribute data in the preset database.
  7. 一种对象互转装置,其中,包括:An object mutual conversion device, which includes:
    提取模块,用于获取预存的具有映射关系的两数据传输对象,提取两所述数据传输对象的至少一个属性数据;An extraction module, configured to obtain two pre-stored data transmission objects with a mapping relationship, and extract at least one attribute data of the two data transmission objects;
    转换基准数据确定模块,用于依据预设数据库中的属性数据将一所述数据传输对象的所述属性数据确定为转换基准数据;A conversion reference data determining module, configured to determine the attribute data of a data transmission object as conversion reference data according to the attribute data in a preset database;
    更新模块,用于依据所述转换基准数据更新另一所述数据传输对象的属性数据。The update module is used to update the attribute data of another data transmission object according to the conversion reference data.
  8. 根据权利要求7所述的对象互转装置,其中,所述更新模块包括:8. The object mutual conversion device according to claim 7, wherein the update module comprises:
    第一对比单元,用于对比所述转换基准数据和另一所述数据传输对象中与所述转换基准数据具有映射关系的所述属性数据;A first comparison unit, configured to compare the conversion reference data with the attribute data that has a mapping relationship with the conversion reference data in another data transmission object;
    调用单元,用于当所述转换基准数据和另一所述数据传输对象中与所述转换基准数据具有映射关系的所述属性数据不一致时,调用所述转换基准数据作为另一所述数据传输对象的属性数据,且该属性数据与所述转换基准数据具有映射关系。The calling unit is configured to call the conversion reference data as another data transmission when the conversion reference data is inconsistent with the attribute data in the other data transmission object that has a mapping relationship with the conversion reference data The attribute data of the object, and the attribute data has a mapping relationship with the conversion reference data.
  9. 如权利要求7所述的对象互转装置,其中,包括:8. The object mutual conversion device of claim 7, wherein it comprises:
    对比模块,用于对比所述转换基准数据和更新后的所述另一所述数据传输对象的所属性数据;A comparison module for comparing the conversion reference data with the updated attribute data of the another data transmission object;
    发送模块,用于当所述转换基准数据和更新后的所述另一所述数据传输对象的所属性数据不一致时,获取所述转换基准数据,生成包括所述转换基准数据的提醒信息,向用户发送所述提醒信息。The sending module is used to obtain the conversion reference data when the conversion reference data is inconsistent with the updated attribute data of the another data transmission object, generate reminder information including the conversion reference data, and send The user sends the reminder information.
  10. 如权利要求9所述的对象互转装置,其中,所述发送模块包括:8. The object mutual conversion device according to claim 9, wherein the sending module comprises:
    第一提醒信息生成单元,用于当所述转换基准数据为所述属性时,获取所述属性的字段,基于所述字段生成属性转换失败的提醒信息;The first reminder information generating unit is configured to obtain a field of the attribute when the conversion reference data is the attribute, and generate reminder information that the attribute conversion fails based on the field;
    第二提醒信息生成单元,用于当所述转换基准数据为所述属性值时,获取所述属性值、所述属性值对应的同一数据传输对象的属性,依据所述属性值和所述属性生成属性值赋值失败的提醒信息。The second reminder information generating unit is configured to obtain the attribute value and the attribute of the same data transmission object corresponding to the attribute value when the conversion reference data is the attribute value, according to the attribute value and the attribute value Generate a reminder message that the attribute value assignment failed.
  11. 如权利要求9所述的对象互转装置,其中,包括:The device for transferring objects according to claim 9, which comprises:
    日志生成单元,用于依据所述转换基准数据生成转换失败日志。The log generating unit is configured to generate a conversion failure log according to the conversion benchmark data.
  12. 如权利要求7所述的对象互转装置,其中,包括:8. The object mutual conversion device of claim 7, wherein it comprises:
    获取模块,用于按照预设时间周期获取所述预设数据库中的所述属性数据,依据所述预设数据库中的所述属性数据更新与所述预设数据库连接的任一所述数据传输对象的属性数据。The obtaining module is configured to obtain the attribute data in the preset database according to a preset time period, and update any of the data transmissions connected to the preset database according to the attribute data in the preset database The attribute data of the object.
  13. 一种服务器,其中,包括:A server, which includes:
    一个或多个处理器;One or more processors;
    存储器;Memory
    一个或多个计算机可读指令,其中所述一个或多个计算机可读指令被存储在所述存储器中并被配置为由所述一个或多个处理器执行,所述一个或多个计算机可读指令配置用于执行以下步骤:One or more computer-readable instructions, wherein the one or more computer-readable instructions are stored in the memory and configured to be executed by the one or more processors, and the one or more computers may The read command configuration is used to perform the following steps:
    获取预存的具有映射关系的两数据传输对象,提取两所述数据传输对象的至少一个属性数据;Acquiring two pre-stored data transmission objects with a mapping relationship, and extracting at least one attribute data of the two data transmission objects;
    依据预设数据库中的属性数据将一所述数据传输对象的所述属性数据确定为转换基准数据;Determining the attribute data of a data transmission object as conversion reference data according to the attribute data in the preset database;
    依据所述转换基准数据更新另一所述数据传输对象的属性数据;Update the attribute data of another data transmission object according to the conversion reference data;
    其中,对比所述转换基准数据和另一所述数据传输对象中与所述转换基准数据具有映射关系的所述属性数据;Wherein, comparing the conversion reference data with the attribute data in another data transmission object that has a mapping relationship with the conversion reference data;
    当所述转换基准数据和另一所述数据传输对象中与所述转换基准数据具有映射关系的所述属性数据不一致时,调用所述转换基准数据作为另一所述数据传输对象的属性数据,且该属性数据与所述转换基准数据具有映射关系。When the conversion reference data is inconsistent with the attribute data that has a mapping relationship with the conversion reference data in another data transmission object, calling the conversion reference data as the attribute data of the other data transmission object, And the attribute data has a mapping relationship with the conversion reference data.
  14. 如权利要求13所述的服务器,其中,所述数据传输对象包括DTO和/或MAP,所述属性数据包括MAP的key和/或value、DTO的属性和/或属性值。The server according to claim 13, wherein the data transmission object includes a DTO and/or MAP, and the attribute data includes a key and/or value of the MAP, and an attribute and/or attribute value of the DTO.
  15. 如权利要求13所述的服务器,其中,所述依据所述转换基准数据更新另一所述数据传输对象的属性或属性值之后,包括:The server according to claim 13, wherein after the updating the attribute or attribute value of another data transmission object according to the conversion reference data, the method comprises:
    对比所述转换基准数据和更新后的所述另一所述数据传输对象的所属性数据;Comparing the conversion reference data with the updated attribute data of the another data transmission object;
    当所述转换基准数据和更新后的所述另一所述数据传输对象的所属性数据不一致时,获取所述转换基准数据,生成包括所述转换基准数据的提醒信息,向用户发送所述提醒信息。When the conversion reference data is inconsistent with the updated attribute data of the other data transmission object, the conversion reference data is acquired, the reminder information including the conversion reference data is generated, and the reminder is sent to the user information.
  16. 如权利要求15所述的服务器,其中,所述获取所述转换基准数据,生成包括所述转换基准数据的提醒信息,包括:The server according to claim 15, wherein said acquiring said conversion reference data and generating reminder information including said conversion reference data comprises:
    所述属性数据包括属性名称和属性值;The attribute data includes attribute name and attribute value;
    当所述转换基准数据为所述属性时,获取所述属性的字段,基于所述字段生成属性转换失败的提醒信息;When the conversion reference data is the attribute, acquiring the attribute field, and generating a reminder information of the attribute conversion failure based on the field;
    当所述转换基准数据为所述属性值时,获取所述属性值、所述属性值对应的同一数据传输对象的属性,依据所述属性值和所述属性生成属性值赋值失败的提醒信息。When the conversion reference data is the attribute value, the attribute value and the attribute of the same data transmission object corresponding to the attribute value are acquired, and a reminder message of attribute value assignment failure is generated according to the attribute value and the attribute.
  17. 如权利要求15所述的服务器,其中,所述当所述转换基准数据和更新后的所述另一所述数据传输对象的所属性数据不一致时,获取所述转换基准数据之后,还包括:15. The server according to claim 15, wherein, when the conversion reference data is inconsistent with the updated attribute data of the other data transmission object, after obtaining the conversion reference data, the method further comprises:
    依据所述转换基准数据生成转换失败日志。A conversion failure log is generated according to the conversion reference data.
  18. 如权利要求13所述的服务器,其中,所述获取预存的具有映射关系的两数据传输对象,提取两所述数据传输对象的至少一个属性数据之前,包括:The server according to claim 13, wherein, before said acquiring two pre-stored data transmission objects with a mapping relationship and extracting at least one attribute data of the two data transmission objects, the method comprises:
    按照预设时间周期获取所述预设数据库中的所述属性数据,依据所述预设数据库中的所述属性数据更新与所述预设数据库连接的任一所述数据传输对象的属性数据。The attribute data in the preset database is acquired according to a preset time period, and the attribute data of any data transmission object connected to the preset database is updated according to the attribute data in the preset database.
  19. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有计算机可读指令,其中所述计算机可读指令被处理器执行时,实现如下步骤:A computer-readable storage medium, characterized in that computer-readable instructions are stored on the computer-readable storage medium, and when the computer-readable instructions are executed by a processor, the following steps are implemented:
    获取预存的具有映射关系的两数据传输对象,提取两所述数据传输对象的至少一个属性数据;Acquiring two pre-stored data transmission objects with a mapping relationship, and extracting at least one attribute data of the two data transmission objects;
    依据预设数据库中的属性数据将一所述数据传输对象的所述属性数据确定为转换基准数据;Determining the attribute data of a data transmission object as conversion reference data according to the attribute data in the preset database;
    依据所述转换基准数据更新另一所述数据传输对象的属性数据;Update the attribute data of another data transmission object according to the conversion reference data;
    其中,对比所述转换基准数据和另一所述数据传输对象中与所述转换基准数据具有映射关系的所述属性数据;Wherein, comparing the conversion reference data with the attribute data in another data transmission object that has a mapping relationship with the conversion reference data;
    当所述转换基准数据和另一所述数据传输对象中与所述转换基准数据具有映射关系的所述属性数据不一致时,调用所述转换基准数据作为另一所述数据传输对象的属性数据,且该属性数据与所述转换基准数据具有映射关系。When the conversion reference data is inconsistent with the attribute data that has a mapping relationship with the conversion reference data in another data transmission object, calling the conversion reference data as the attribute data of the other data transmission object, And the attribute data has a mapping relationship with the conversion reference data.
  20. 如权利要求19所述的计算机可读存储介质,其中,所述数据传输对象包括DTO和/或MAP,所述属性数据包括MAP的key和/或value、DTO的属性和/或属性值。 18. The computer-readable storage medium according to claim 19, wherein the data transmission object includes DTO and/or MAP, and the attribute data includes a key and/or value of the MAP, and an attribute and/or attribute value of the DTO. To
PCT/CN2019/117597 2019-01-08 2019-11-12 Object inter-conversion method and apparatus, storage medium, and server WO2020143306A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910015170.XA CN109901822B (en) 2019-01-08 2019-01-08 Object conversion method and device, storage medium and server
CN201910015170.X 2019-01-08

Publications (2)

Publication Number Publication Date
WO2020143306A1 WO2020143306A1 (en) 2020-07-16
WO2020143306A9 true WO2020143306A9 (en) 2020-08-27

Family

ID=66943697

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/117597 WO2020143306A1 (en) 2019-01-08 2019-11-12 Object inter-conversion method and apparatus, storage medium, and server

Country Status (2)

Country Link
CN (1) CN109901822B (en)
WO (1) WO2020143306A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109901822B (en) * 2019-01-08 2022-08-12 平安科技(深圳)有限公司 Object conversion method and device, storage medium and server
CN113110847B (en) * 2021-04-29 2024-02-13 杭州以诺行汽车科技股份有限公司 Conversion processing method and system for program codes

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10698751B2 (en) * 2014-11-04 2020-06-30 Micro Focus Llc Web services generation based on client-side code
CN104731911A (en) * 2015-03-24 2015-06-24 浪潮集团有限公司 Dynamic mapping and conversion method of data table and entity class
CN105607906B (en) * 2015-12-18 2019-03-22 苏州奖多多科技有限公司 A kind of service implementation method, device and electronic equipment
CN106933554A (en) * 2015-12-30 2017-07-07 北京国双科技有限公司 Class conversion method and device
CN106775696A (en) * 2016-12-08 2017-05-31 蓝信工场(北京)科技有限公司 Data processing method and device
CN108200111B (en) * 2016-12-08 2021-01-05 中国移动通信集团山西有限公司 Resource configuration information updating method and device and resource interface equipment
CN107506474B (en) * 2017-09-05 2020-10-20 荷花科技(北京)有限公司 Database operation method and device based on object mapping
CN107766039B (en) * 2017-10-30 2020-04-10 中国平安财产保险股份有限公司 Method, server and storage medium for accessing attribute value from Java object
CN108388423A (en) * 2018-02-26 2018-08-10 中车青岛四方机车车辆股份有限公司 A kind of IOS data objects conversion method and device
CN109901822B (en) * 2019-01-08 2022-08-12 平安科技(深圳)有限公司 Object conversion method and device, storage medium and server

Also Published As

Publication number Publication date
CN109901822B (en) 2022-08-12
CN109901822A (en) 2019-06-18
WO2020143306A1 (en) 2020-07-16

Similar Documents

Publication Publication Date Title
WO2020258656A1 (en) Code segment generation method and apparatus, storage medium and computer device
WO2018103315A1 (en) Monitoring data processing method, apparatus, server and storage equipment
US20040243663A1 (en) Event heap: a coordination infrastructure for dynamic heterogeneous application interactions in ubiquitous computing environments
WO2020215681A1 (en) Indication information generation method and apparatus, terminal, and storage medium
WO2020000632A1 (en) Invoice issuing method, apparatus and device, and computer-readable storage medium
WO2020258657A1 (en) Abnormality detection method and apparatus, computer device and storage medium
WO2020253135A1 (en) Automated analysis method and device, user equipment, and storage medium
WO2020143306A9 (en) Object inter-conversion method and apparatus, storage medium, and server
WO2020233060A1 (en) Event notification method and apparatus, event notification server, and storage medium
WO2020087981A1 (en) Method and apparatus for generating risk control audit model, device and readable storage medium
WO2019109957A1 (en) Esb-based service providing method, apparatus and device, and readable storage medium
WO2020147385A1 (en) Data entry method and apparatus, terminal and computer-readable storage medium
WO2012169775A2 (en) System and method for providing an open api-based content service interface
WO2017140080A1 (en) Addressing communication method and apparatus based on media access control address
WO2017181786A1 (en) Data analysis processing method, apparatus, computer device, and storage medium
WO2018004020A1 (en) Device and method for verifying matching of simultaneous edits for markup language-based document
WO2016086558A1 (en) Smart terminal information display method and smart terminal
WO2012163216A1 (en) Method and apparatus for controlling input of mobile terminal for java program
WO2017131354A2 (en) Apparatus and method for managing history information in an electronic device
WO2020215680A1 (en) Method and apparatus for automatically generating pojo class, and storage medium and computer device
EP2686981A2 (en) Method and system for managing contact information in a universal plug and play home network environment
WO2014089965A1 (en) Method and mobile terminal for displaying dlna equipment
WO2019000962A1 (en) Revenue calculation method and device, and computer readable storage medium
WO2016195220A1 (en) Sns platform-based work management system
WO2014044131A1 (en) Contact person backup method, device and storage medium for mobile terminal

Legal Events

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

Ref document number: 19909119

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19909119

Country of ref document: EP

Kind code of ref document: A1