CN108170557B - Method and apparatus for outputting information - Google Patents

Method and apparatus for outputting information Download PDF

Info

Publication number
CN108170557B
CN108170557B CN201810068273.8A CN201810068273A CN108170557B CN 108170557 B CN108170557 B CN 108170557B CN 201810068273 A CN201810068273 A CN 201810068273A CN 108170557 B CN108170557 B CN 108170557B
Authority
CN
China
Prior art keywords
data
model
generated
data model
template
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810068273.8A
Other languages
Chinese (zh)
Other versions
CN108170557A (en
Inventor
戴福兴
孙超凡
郭宇霆
刘思音
陈苗
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201810068273.8A priority Critical patent/CN108170557B/en
Publication of CN108170557A publication Critical patent/CN108170557A/en
Application granted granted Critical
Publication of CN108170557B publication Critical patent/CN108170557B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • G06F11/1008Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's in individual solid state devices
    • G06F11/1012Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's in individual solid state devices using codes or arrangements adapted for a specific type of error
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]

Abstract

The embodiment of the application discloses a method and a device for outputting information. One embodiment of the method comprises: providing a model setting interface for a user; receiving the setting of a data model to be generated by a user at a model setting interface, wherein the setting comprises the following steps: setting a template and a file path of a data model to be generated; importing the file data indicated by the file path into a template, and carrying out data verification according to a preset data format in the importing process; and if the data verification fails, outputting prompt information according to the data failed in the verification. According to the embodiment, data verification can be performed in the generation process of the data model, so that the generation error is reduced, and the working efficiency can be improved.

Description

Method and apparatus for outputting information
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to the technical field of information processing, and particularly relates to a method and a device for outputting information.
Background
The Data Model (Data Model) is usually an abstraction of Data features, which is a pedagogical form framework for database management. I.e. a formal framework in database systems to provide a means of information presentation and manipulation. The data model may generally include a structural portion of the database data, an operational portion of the database data, and constraints of the database data.
Conventional data models are typically created by a developer writing a template of the model via a text editor and then using a command line tool to create the data model.
Disclosure of Invention
The embodiment of the application provides a method and a device for outputting information.
In a first aspect, an embodiment of the present application provides a method for outputting information, including: providing a model setting interface for a user; receiving the setting of a data model to be generated by a user at a model setting interface, wherein the setting comprises the following steps: setting a template and a file path of a data model to be generated; importing the file data indicated by the file path into a template, and carrying out data verification according to a preset data format in the importing process; and if the data verification fails, outputting prompt information according to the data failed in the verification.
In some embodiments, the method further comprises: and if the data passes the verification, generating a data model and outputting the data model.
In some embodiments, generating the data model if the data check passes, and outputting the data model comprises: if the data passes the verification, further determining whether the same data structure part exists in the generated data model and the data model to be generated; generating and outputting a data model in response to the determination result being non-existent; and in response to the determination result being that the data structure part exists, merging the same data structure part, and generating and outputting a data model according to the merged data structure part.
In some embodiments, generating the data model and outputting the data model comprises: and generating preview information of the data model, and sending the preview information to the terminal.
In some embodiments, setting further comprises setting a programming language of the data model to be generated, wherein the programming language comprises Java and/or Objective-C.
In some embodiments, the method further comprises: sending a data acquisition request to a remote server according to a Uniform Resource Locator (URL) input by a user; and generating a corresponding template according to the data acquired by the data acquisition request.
In some embodiments, the method further comprises: acquiring transmission data on a target port, wherein the transmission data comprises request information and feedback information corresponding to the request information; intercepting feedback information sent by first target equipment in transmission data, and sending pre-generated feedback data to second target equipment, wherein the second target equipment is equipment for sending request information corresponding to the intercepted feedback information.
In a second aspect, an embodiment of the present application provides an apparatus for outputting information, including: an interface providing unit configured to provide a model setting interface to a user; the receiving unit is configured to receive, at a model setting interface, a setting of a data model to be generated by a user, where the setting includes: setting a template and a file path of a data model to be generated; the import unit is configured to import the file data indicated by the file path into the template and perform data verification according to a preset data format in the import process; and the prompting unit is configured to output prompting information according to the data failed in verification if the data fails in verification.
In some embodiments, the apparatus further comprises: and the generating unit is configured to generate the data model and output the data model if the data check passes.
In some embodiments, the generating unit comprises: the determining subunit is configured to, if the data verification passes, further determine whether a data structure part identical to that in the data model to be generated exists in the generated data model; a first generation subunit configured to generate and output a data model in response to the determination result being non-existent; and the second generation subunit is configured to, in response to the determination result being that the data model exists, combine the same data structure parts, and generate and output the data model according to the combined data structure parts.
In some embodiments, the generating unit is further configured to: and generating preview information of the data model, and sending the preview information to the terminal.
In some embodiments, setting further comprises setting a programming language of the data model to be generated, wherein the programming language comprises Java and/or Objective-C.
In some embodiments, the apparatus further comprises: the sending unit is configured to send a data acquisition request to a remote server according to a Uniform Resource Locator (URL) input by a user; and the template generating unit is configured to generate a corresponding template according to the data acquired by the data acquisition request.
In some embodiments, the apparatus further comprises: the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is configured to acquire transmission data on a target port, and the transmission data comprises request information and feedback information corresponding to the request information; the intercepting unit is configured to intercept feedback information sent by first target equipment in transmission data and send pre-generated feedback data to second target equipment, wherein the second target equipment is equipment for sending request information corresponding to the intercepted feedback information.
In a third aspect, an embodiment of the present application provides an electronic device, including: one or more processors; storage means for storing one or more programs which, when executed by one or more processors, cause the one or more processors to carry out a method as described in any of the embodiments of the first aspect above.
In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the method described in any one of the embodiments of the first aspect.
According to the method and the device for outputting the information, the model setting interface is provided for the user, so that the setting of the data model to be generated by the user can be received on the model setting interface. The setting may include setting a template of the data model to be generated and a file path. And then, importing the file data indicated by the file path into the set template, and in the importing process, performing data verification according to a preset data format. Therefore, if the data verification fails, prompt information can be output according to the data failed in verification. The user can modify the corresponding data according to the prompt message, thereby being beneficial to reducing the occurrence of the error of the data model generation and improving the working efficiency.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram to which the present application may be applied;
FIG. 2 is a flow diagram of one embodiment of a method for outputting information, according to the present application;
FIG. 3 is a schematic diagram of an application scenario of a method for outputting information according to the present application;
FIG. 4 is a schematic block diagram of one embodiment of an apparatus for outputting information in accordance with the present application;
FIG. 5 is a schematic block diagram of a computer system suitable for use in implementing an electronic device of an embodiment of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 shows an exemplary system architecture 100 to which the method for outputting information or the apparatus for outputting information of the present application may be applied.
As shown in fig. 1, the system architecture 100 may include terminals 101, 102, 103, a network 104, a server 105, and a database server 106. Network 104 is the medium used to provide communication links between terminals 101, 102, 103, server 105 and database server 106. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user 110 may use the terminals 101, 102, 103 to interact with the server 105, the database server 106 via the network 104, to receive or send messages, etc. The terminals 101, 102, 103 may have various client applications installed thereon, such as a data model generation application, a shopping application, a web browser application, an instant messenger application, and the like.
The terminals 101, 102, 103 may be various electronic devices having a display screen including, but not limited to, smart phones, tablet computers, e-book readers, laptop portable computers, desktop computers, and the like.
Database server 106 may be a server that provides various services, such as a database server 106 on which file data needed to generate a data model may be stored.
The server 105 may also be a server providing various services, such as a background server providing support for various applications displayed on the terminals 101, 102, 103. The background server may import the file data indicated by the file path set by the user 110 into the set template according to the received setting of the data model to be generated by the user 110. And may perform verification analysis on the data in the import process, and may transmit an analysis result (e.g., prompt information indicating that the verification failed) to the terminal 101, 102, 103. In this way, the user 110 can modify the corresponding data by using the information displayed by the terminals 101, 102, 103, thereby improving the working efficiency.
It should be noted that the method for outputting information provided in the embodiment of the present application is generally performed by the server 105, and accordingly, the apparatus for outputting information is generally disposed in the server 105.
It is noted that when server 105 has the functionality of database server 106, system architecture 100 may not provide database server 106.
It should be understood that the number of terminals, networks, servers and database servers in fig. 1 is merely illustrative. There may be any number of terminals, networks, servers, and database servers, as desired for implementation.
With continued reference to FIG. 2, a flow 200 of one embodiment of a method for outputting information in accordance with the present application is shown. The method for outputting information may include the steps of:
step 201, providing a model setting interface for a user.
In the present embodiment, the electronic device (e.g., the server 105 shown in fig. 1) on which the method for outputting information operates may transmit information to terminals (e.g., the terminals 101, 102, 103 shown in fig. 1) used by the user through a wired connection manner or a wireless connection manner, thereby providing a model setting interface to the user.
In this embodiment, the model setting interface may be an interface for setting parameters of the data model to be generated. Such as the settings of the templates and data content of the data model to be generated. The data model to be generated here may include a hierarchical model, a mesh model, a relational model, and the like. And the template may be a template in which data is stored and which has a certain data structure form. For example, the template may be a graph, a function, etc. It should be noted that the format of the model setting interface is not limited in this application, and may be any format that can be recognized and displayed by the terminal, such as a web page or a window.
Step 202, receiving the setting of the data model to be generated by the user in the model setting interface.
In this embodiment, the electronic device may receive the user's settings for the data model to be generated through the model setting interface provided to the user in step 201. Wherein the setting may include: and setting a template and a file path of the data model to be generated.
In this embodiment, a user may set the data model to be generated in a model setting interface in a variety of ways. For example, the user may set the file path in the corresponding setting area by manually inputting, selecting, pasting, and the like. At the same time, the model setup interface may present all of the created stored templates to the user. In this way, the user can set the template by clicking to select, drag, input the identifier (such as name and number) of the template, and the like. The manner of presentation is not limited in this application.
It will be appreciated that the file data indicated by the template and file path may be stored locally on the electronic device or may be stored on a database server (e.g., database server 106 shown in FIG. 1). The template herein may be created in a variety of ways. For example, the template may be obtained from an existing template database, or may be written by a user using a tool such as a text editor.
In some optional implementations of the embodiment, to further facilitate the user operation, the electronic device may further generate the template by using data returned by the remote server to expand the application range of the method. Specifically, the electronic device may send a data acquisition request to the remote server according to a URL (Uniform Resource Locator) input by the user. Thereafter, the electronic device may generate a corresponding template according to the data acquired by the data acquisition request (i.e., the data corresponding to the data acquisition request returned by the remote server). It should be noted that, the manner in which the user inputs the URL to the electronic device is not limited in the present application.
Further, after acquiring the data, the electronic device performs recursive analysis on the data. First, it can be determined whether the data conforms to a preset data type (set according to actual conditions). If the data conforms to the preset data type, the electronic device may set the data type of the data to a default value (i.e., default to the preset data type). If the data does not conform to the predetermined data type, the electronic device may set the data type (e.g., string type, integer type, floating point type, etc.) of the data. The electronic device may then generate a corresponding template from the data.
In addition, in order to facilitate user operation and improve the working efficiency, the electronic equipment can also receive the checking and editing operation of the user on the template through a model setting interface. That is, user viewing and editing operations of the template may be received at the model setup interface. In this way, the user can view and edit the specific content of each template, thereby facilitating the rapid creation of the templates.
Optionally, the electronic device may further receive, through the model setting interface, a setting of a programming language of the data model to be generated by the user. The programming language may include Java (an object-oriented programming language that can write cross-platform application software) and/or Objective-C (an object-oriented programming language that extends the C language). It will be appreciated that the Objective-C programming language may be widely used to write iOS operating systems, iOS applications, mac OS X operating systems, and applications on Mac OS X. This helps to improve the flexibility of the method and to expand the application range of the method and data model.
Step 203, importing the file data indicated by the file path into a template, and performing data verification according to a preset data format in the importing process.
In this embodiment, according to the setting of the data model to be generated by the user received in step 202, the electronic device may import the file data indicated by the file path in the model setting interface into the template set in the model setting interface. And in the importing process, the electronic equipment can perform data verification according to a preset data format. The preset data format can be set according to actual conditions.
The data verification can be the verification of the file data, namely, the verification of whether the file data conforms to a preset data format or not; the template data can also be checked, that is, whether the grammar, logic and the like in the writing program of the template accord with the preset data format or not can be checked. For example, the file data and the template data in the import process may be checked according to the requirement of the data format of JSON (JavaScript Object notification, lightweight data interchange format based on JavaScript language). It should be noted that the preset data format should be related to the template set as described above.
And step 204, if the data verification fails, outputting prompt information according to the data failed in the verification.
In this embodiment, if a data verification failure occurs during the importing process in step 203, the electronic device may generate a prompt message according to the data with the verification failure, and may output the prompt message. The prompt information may be information for indicating that the data check fails. For example, the reminder information may include at least one of: the specific content, location of the data that failed the verification, the reason for the verification failure, etc.
The output here may be (but is not limited to) a terminal sent to be used by the user. Therefore, the user can modify the data which fails to be verified according to the prompt message. That is, by performing data verification during import and sending a prompt in the event of verification failure, this can help in the quick location of problems. Namely, the user can quickly determine the location of the problem, thereby improving the efficiency of solving the problem.
In some application scenarios, the output here may also be that the electronic device stores the reminder information. For example, the electronic device may store the prompt information in a locally specified folder, or may send the prompt information to the database server for storage. Furthermore, the electronic equipment can also generate a report according to the prompt message. Therefore, the user can conveniently inquire the prompt information. Meanwhile, stored prompt information or generated reports and the like can be used as reference data of a user, so that the same or similar problems in subsequent work are reduced or avoided.
In some optional implementation manners of this embodiment, if the data check is passed in step 203, that is, the file data and the template data both conform to the preset data format, the electronic device may generate a data model, that is, a template after the file data is imported. And the electronic device can output the data model. The output here may also include at least one of: stored locally, stored in a database server or other device, transmitted to a terminal, etc.
Optionally, if the data check passes, the electronic device may further determine whether the same data structure part exists in the generated data model and the data model to be generated. If the determination result is that the data model does not exist, that is, the data model which is generated already does not have the same data structure part as the data model to be generated, the electronic device may generate and output the data model. If the determination result is that the data structure part exists, that is, the data structure part exists in the generated data model and the data structure part exists in the data model to be generated, the electronic device may merge the same data structure parts. And a data model can be generated and output according to the combined data structure part.
For example, the electronic device may merge portions of the same data structure in each data model (including generated and to-be-generated data models) to generate a new type. The generated new type may then be used to replace the same data structure portion described above in the generated data model. Meanwhile, the new type generated and other parts in the data model to be generated (i.e. except the same data structure part) can be utilized to generate and output the corresponding data model. This reduces or avoids data redundancy, thereby reducing the amount of memory space occupied by the electronic device.
Further, before generating the data model, the electronic device may also generate preview information of the data model for describing information of the data model to be generated set by the user. Meanwhile, the electronic device may transmit the generated preview information to a terminal used by the user. Therefore, the user can know the specific situation of the data model to be generated set by the user through the preview information presented by the terminal.
If the preview information meets the requirements of the user, the user can further send an operation instruction (such as clicking a preset physical or virtual key) for instructing to generate the data model through the terminal. In this way, after receiving the operation instruction, the electronic device can generate and output the data model corresponding to the preview information. If the user needs to adjust the data model to be generated, the setting of the data model to be generated can be readjusted on the model setting interface. In this way, the electronic device can update the preview information according to the user's setting. Therefore, the user can conveniently and visually know the data model to be generated, unnecessary data models can be reduced or avoided, and the occupation of the storage space of the electronic equipment can be further reduced.
In addition, the electronic device can also acquire transmission data on the target port. The transmission data may include request information and feedback information corresponding to the request information. The destination port may be, but is not limited to, a port on an electronic device for transferring data. Then, the electronic device may intercept feedback information sent by the first target device in the transmission data. For example, the electronic device may determine which feedback information is sent by the first target device according to the host address in the feedback information. For another example, the electronic device may intercept the feedback information sent by the first target device according to a port number (e.g., the target port is only used for communication with the first target device). Thereafter, the electronic device may send the pre-generated feedback data to the second target device. And the second target equipment is equipment for sending request information corresponding to the intercepted feedback information.
For example, device a sends request information to device B through port C, and device B sends feedback information to device a through port C. At this time, the electronic device intercepts the feedback information transmitted in the port C (target port) (i.e., the device B is the first target device), and sends the pre-generated feedback data (i.e., dummy data) to the device a (i.e., the second target device).
Here, the target port, the first target device, the second target device, and the feedback data generated in advance may also be set according to actual situations. It can be understood that the test can be conveniently carried out by developers through intercepting the transmission data of the target port. For example, a developer may use the preview information or the data model generated in the above embodiment as the feedback data generated in advance, so as to test the design program of the method in the above embodiment. And for different pre-generated feedback data, the display effect of the terminal for displaying the feedback data is different, so that the display design of the terminal can be tested. That is, both front-end and back-end developers can use the method in the application, so that communication required by the developers due to unclear data can be reduced, and the working efficiency can be improved.
The method for outputting information provided by this embodiment may receive, in the model setting interface, the setting of the data model to be generated by the user by providing the model setting interface to the user. The setting may include setting a template of the data model to be generated and a file path. And then, importing the file data indicated by the file path into the set template, and in the importing process, performing data verification according to a preset data format. Therefore, if the data verification fails, prompt information can be output according to the data failed in verification. The user can modify the corresponding data according to the prompt message, thereby being beneficial to reducing the occurrence of data model generation errors and improving the working efficiency.
Further, please refer to fig. 3, fig. 3 illustrates an exemplary application scenario of the method for outputting information according to the embodiment of the present application.
As shown in fig. 3, a method 300 for outputting information operates in an electronic device 320, and may include:
first, a model setup interface 301 is provided to the user;
thereafter, settings of the data model to be generated by the user may be received at the model setting interface 301, where the settings may include: setting a template 302 and a file path 303 of a data model to be generated;
then, the file data 304 indicated by the file path 303 may be imported into the template 302, and during the importing process, data verification 305 may be performed according to a preset data format;
finally, if the data verification fails, prompt information 306 may be output according to the data that failed verification.
It should be understood that the method for outputting information shown in fig. 3 is only an exemplary application scenario of the method for generating a data model and does not represent a limitation of the present application. For example, if the data check in fig. 3 passes, the data model 307 may be further generated in the public and the data model 307 may be output. The method for outputting the information provided in the application scenario can facilitate the user to modify the problems occurring in the generation process, thereby improving the working efficiency.
With further reference to fig. 4, the present application provides one embodiment of an apparatus for outputting information as an implementation of the methods shown in the above figures. The embodiment of the device corresponds to the embodiment of the method shown in fig. 2, and the device can be applied to various electronic devices.
As shown in fig. 4, the apparatus 400 for outputting information of the present embodiment may include: an interface providing unit 401 configured to provide a model setting interface to a user; a receiving unit 402, configured to receive, at a model setting interface, a setting of a data model to be generated by a user, where the setting includes: setting a template and a file path of a data model to be generated; an importing unit 403, configured to import the file data indicated by the file path into a template, and perform data verification according to a preset data format during the importing process; and the prompt unit 404 is configured to, if the data verification fails, output prompt information according to the data failed in the verification.
In this embodiment, specific implementation manners and beneficial effects of the interface providing unit 401, the receiving unit 402, the importing unit 403, and the prompting unit 404 may respectively refer to the relevant descriptions of step 201, step 202, step 203, and step 204 in the embodiment shown in fig. 2, and are not described herein again.
In some optional implementations of this embodiment, the apparatus 400 may further include: and a generating unit (not shown in the figure) configured to generate the data model and output the data model if the data check passes.
Further, the generating unit may include: the determining subunit is configured to, if the data verification passes, further determine whether a data structure part identical to that in the data model to be generated exists in the generated data model; a first generation subunit configured to generate and output a data model in response to the determination result being non-existent; and the second generation subunit is configured to, in response to the determination result being that the data model exists, combine the same data structure parts, and generate and output the data model according to the combined data structure parts.
Optionally, the generating unit may be further configured to: and generating preview information of the data model, and sending the preview information to the terminal.
In some embodiments, setting may also include setting a programming language of the data model to be generated, where the programming language may include Java and/or Objective-C.
In some optional implementations of this embodiment, the apparatus 400 may further include: a sending unit (not shown in the figure) configured to send a data acquisition request to a remote server according to a URL uniform resource locator input by a user; and a template generating unit (not shown in the figure) configured to generate a corresponding template according to the data acquired by the data acquisition request.
Optionally, the apparatus 400 may further include: an obtaining unit (not shown in the figure) configured to obtain transmission data on a target port, where the transmission data includes request information and feedback information corresponding to the request information; and an intercepting unit (not shown in the figure) configured to intercept feedback information sent by the first target device in the transmission data, and send pre-generated feedback data to a second target device, where the second target device is a device that sends request information corresponding to the intercepted feedback information.
Referring now to FIG. 5, shown is a block diagram of a computer system 500 suitable for use in implementing the electronic device of an embodiment of the present application. The electronic device shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 5, the computer system 500 includes a Central Processing Unit (CPU) 501 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 502 or a program loaded from a storage section 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data necessary for the operation of the system 500 are also stored. The CPU 501, ROM 502, and RAM 503 are connected to each other via a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
The following components are connected to the I/O interface 505: an input portion 506 including a touch screen, a keyboard, a mouse, and the like; an output portion 507 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 508 including a hard disk and the like; and a communication section 509 including a network interface card such as a LAN card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet. The driver 510 is also connected to the I/O interface 505 as necessary. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as necessary, so that a computer program read out therefrom is mounted into the storage section 508 as necessary.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer-readable medium, the computer program comprising program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 509, and/or installed from the removable medium 511. The computer program performs the above-described functions defined in the method of the present application when executed by the Central Processing Unit (CPU) 501. It should be noted that the computer readable medium of the present application can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes an interface providing unit, a receiving unit, an importing unit, and a prompting unit. Where the names of these elements do not in some cases constitute a limitation on the elements themselves, for example, the interface providing element may also be described as an "element providing a model setting interface to a user".
As another aspect, the present application also provides a computer-readable medium, which may be contained in the electronic device described in the above embodiments; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: providing a model setting interface for a user; receiving the setting of a data model to be generated by a user at a model setting interface, wherein the setting comprises the following steps: setting a template and a file path of a data model to be generated; importing the file data indicated by the file path into a template, and carrying out data verification according to a preset data format in the importing process; and if the data verification fails, outputting prompt information according to the data failed in the verification.
The foregoing description is only exemplary of the preferred embodiments of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (12)

1. A method for outputting information, comprising:
providing a model setting interface for a user;
receiving the setting of a data model to be generated by a user at the model setting interface, wherein the setting comprises the following steps: setting a template and a file path of the data model to be generated, wherein the template is a template which has data stored therein and has a certain data structure form;
wherein the generating of the template comprises: sending a data acquisition request to a remote server according to a Uniform Resource Locator (URL) input by a user; judging whether the data acquired through the data acquisition request conforms to a preset data type, and if not, resetting the data type of the acquired data; generating a corresponding template according to the final data type of the acquired data;
importing the file data indicated by the file path into the template, and performing data verification according to a preset data format in the importing process;
if the data verification fails, outputting prompt information according to the data failed in the verification;
if the data passes the verification, generating a data model and outputting the data model;
if the data passes the verification, generating a data model, and outputting the data model comprises:
if the data passes the data verification, further determining whether a data structure part which is the same as that of the data model to be generated exists in the generated data model; in response to the determination result that the data model exists, combining the same data structure parts to generate a new type, replacing the same parts before combination in the generated data model with the new type, and generating and outputting a corresponding data model by using the new type and the data model to be generated except the same data structure parts;
wherein, the data verification is performed according to a preset data format in the importing process, and the method comprises the following steps:
and checking whether syntax and logic in the compiling program of the template accord with the preset data format or not, wherein the preset data format is a data format corresponding to the template.
2. The method of claim 1, further comprising:
and responding to the data structure part which is the same as the data structure part which does not exist in the generated data model and the data model to be generated, and generating and outputting the data model.
3. The method of claim 1, wherein the generating a data model and outputting the data model comprises:
and generating preview information of the data model, and sending the preview information to the terminal.
4. The method of claim 1, wherein the setting further comprises setting a programming language of the data model to be generated, wherein the programming language comprises Java and/or Objective-C.
5. The method according to one of claims 1-4, wherein the method further comprises:
acquiring transmission data on a target port, wherein the transmission data comprises request information and feedback information corresponding to the request information;
intercepting feedback information sent by first target equipment in the transmission data, and sending pre-generated feedback data to second target equipment, wherein the second target equipment is equipment for sending request information corresponding to the intercepted feedback information.
6. An apparatus for outputting information, comprising:
an interface providing unit configured to provide a model setting interface to a user;
the receiving unit is configured to receive, at the model setting interface, a setting of a data model to be generated by a user, where the setting includes: setting a template and a file path of the data model to be generated, wherein the template is a template which has data stored therein and has a certain data structure form;
the import unit is configured to import the file data indicated by the file path into the template, and perform data verification according to a preset data format in the import process;
the prompting unit is configured to output prompting information according to the data failed in verification if the data verification fails;
the generating unit is configured to generate a data model and output the data model if the data check passes;
the generation unit includes: the determining subunit is configured to, if the data verification passes, further determine whether a data structure part identical to the data structure part in the to-be-generated data model exists in the generated data model;
the second generation subunit is configured to, in response to the determination result that the data model exists, combine the same data structure parts to generate a new type, replace the same parts before combination in the generated data model with the new type, and generate and output a corresponding data model by using the new type and the data model to be generated except the same data structure parts;
the sending unit is configured to send a data acquisition request to a remote server according to a Uniform Resource Locator (URL) input by a user;
the template generation unit is configured to judge whether the data acquired through the data acquisition request conforms to a preset data type, and if not, reset the data type of the acquired data; generating a corresponding template according to the final data type of the acquired data;
the import unit is further configured to: and checking whether grammar and logic in the compiling program of the template accord with the preset data format, wherein the preset data format is a data format corresponding to the template.
7. The apparatus of claim 6, wherein the generating unit further comprises:
and the first generation subunit is used for responding to the data structure part which is not the same as the data structure part in the generated data model and the data model to be generated, and generating and outputting the data model.
8. The apparatus of claim 6, wherein the generating unit is further configured to:
and generating preview information of the data model, and sending the preview information to the terminal.
9. The apparatus of claim 6, wherein the setting further comprises setting a programming language of the data model to be generated, wherein the programming language comprises Java and/or Objective-C.
10. The apparatus according to one of claims 6-9, wherein the apparatus further comprises:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is configured to acquire transmission data on a target port, and the transmission data comprises request information and feedback information corresponding to the request information;
and the intercepting unit is configured to intercept feedback information sent by first target equipment in the transmission data and send pre-generated feedback data to second target equipment, wherein the second target equipment is equipment for sending request information corresponding to the intercepted feedback information.
11. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-5.
12. A computer-readable storage medium, on which a computer program is stored, wherein the computer program, when being executed by a processor, carries out the method according to any one of claims 1-5.
CN201810068273.8A 2018-01-24 2018-01-24 Method and apparatus for outputting information Active CN108170557B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810068273.8A CN108170557B (en) 2018-01-24 2018-01-24 Method and apparatus for outputting information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810068273.8A CN108170557B (en) 2018-01-24 2018-01-24 Method and apparatus for outputting information

Publications (2)

Publication Number Publication Date
CN108170557A CN108170557A (en) 2018-06-15
CN108170557B true CN108170557B (en) 2022-11-25

Family

ID=62515298

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810068273.8A Active CN108170557B (en) 2018-01-24 2018-01-24 Method and apparatus for outputting information

Country Status (1)

Country Link
CN (1) CN108170557B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114461302A (en) * 2022-02-09 2022-05-10 北京理房通支付科技有限公司 Parameter checking method, checking template generating method and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105630916A (en) * 2015-12-21 2016-06-01 浙江工业大学 Method for extracting and organizing unstructured sheet document data under big data environment
WO2017215650A1 (en) * 2016-06-17 2017-12-21 北京奇虎科技有限公司 Automatic login method and device for micro-game client, program, and medium

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8423962B2 (en) * 2009-10-08 2013-04-16 International Business Machines Corporation Automated test execution plan generation
US9069830B2 (en) * 2011-03-29 2015-06-30 International Business Machines Corporation Retrieving data objects
US8782081B2 (en) * 2011-05-11 2014-07-15 Google Inc. Query template definition and transformation
CN102968306B (en) * 2012-11-29 2016-01-20 广东全通教育股份有限公司 A kind of code automatic generation method based on data model driving and system
CN104361221B (en) * 2014-10-31 2017-07-14 沈阳锐易特软件技术有限公司 Medical data acquisition system and method based on heterogeneous system data mapping template
CN106909566A (en) * 2015-12-23 2017-06-30 阿里巴巴集团控股有限公司 A kind of Data Modeling Method and equipment
CN105677346A (en) * 2016-01-04 2016-06-15 浪潮软件集团有限公司 Dynamic expansion method of web interface and server
CN106777970B (en) * 2016-12-15 2018-12-07 北京锐软科技股份有限公司 A kind of integrated system and method for medical information system data template
CN106844643A (en) * 2017-01-13 2017-06-13 王洋 A kind of Database Dynamic generation method based on template engine
CN107357942A (en) * 2017-09-04 2017-11-17 山东达创网络科技股份有限公司 A kind of source code auxiliary Core Generator and its generation method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105630916A (en) * 2015-12-21 2016-06-01 浙江工业大学 Method for extracting and organizing unstructured sheet document data under big data environment
WO2017215650A1 (en) * 2016-06-17 2017-12-21 北京奇虎科技有限公司 Automatic login method and device for micro-game client, program, and medium

Also Published As

Publication number Publication date
CN108170557A (en) 2018-06-15

Similar Documents

Publication Publication Date Title
US10705942B1 (en) Simulated testing of API
US9767008B2 (en) Automatic test case generation
CN109684188B (en) Test method and device
CN107643984B (en) Method and apparatus for outputting information
CN110780874B (en) Method and device for generating information
CN110959165A (en) Techniques for automatically verifying functionality of offers in a cloud service broker system
CN112631590B (en) Component library generation method, device, electronic equipment and computer readable medium
US20150143267A1 (en) SYSTEM AND METHOD FOR DEVELOPING A RULE-BASED EVENT-DRIVEN MULTI-LAYERED FRONTEND FOR BUSINESS SERVICES AND RENDERING THE GUIs ON MULTIPLE CLIENT DEVICES
US11245601B2 (en) Automated integrated test system and method thereof
US20180275957A1 (en) Assistive technology for code generation using voice and virtual reality
CN112988588B (en) Client software debugging method and device, storage medium and electronic equipment
CN108170557B (en) Method and apparatus for outputting information
CN113721910A (en) Interface code generation method and device, electronic equipment and computer readable medium
CN112631588A (en) File generation method and device, electronic equipment and computer readable medium
CN112486482A (en) Page display method and device
CN114428601A (en) Visual manuscript checking method and device
CN113656041A (en) Data processing method, device, equipment and storage medium
CN113312900A (en) Data verification method and device
CN109889402B (en) Method and apparatus for generating information
CN113885841A (en) Script generation method and device, electronic equipment and readable medium
CN114428925A (en) Page rendering method and device, electronic equipment and computer readable medium
CN113448578A (en) Page data processing method, processing system, electronic device and readable storage medium
CN113485927A (en) Test data generation method, device, equipment and storage medium
CN113378346A (en) Method and device for model simulation
CN113360365A (en) Flow testing method and flow testing system

Legal Events

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