CN108491448B - Data pushing method and device - Google Patents

Data pushing method and device Download PDF

Info

Publication number
CN108491448B
CN108491448B CN201810156753.XA CN201810156753A CN108491448B CN 108491448 B CN108491448 B CN 108491448B CN 201810156753 A CN201810156753 A CN 201810156753A CN 108491448 B CN108491448 B CN 108491448B
Authority
CN
China
Prior art keywords
data
file
pushed
configuration file
pushing
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
CN201810156753.XA
Other languages
Chinese (zh)
Other versions
CN108491448A (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 Tianyuan Innovation Technology Co ltd
Original Assignee
Beijing Tianyuan Innovation 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 Tianyuan Innovation Technology Co ltd filed Critical Beijing Tianyuan Innovation Technology Co ltd
Priority to CN201810156753.XA priority Critical patent/CN108491448B/en
Publication of CN108491448A publication Critical patent/CN108491448A/en
Application granted granted Critical
Publication of CN108491448B publication Critical patent/CN108491448B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/55Push-based network services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/30Profiles

Abstract

The invention provides a method and a device for data push.A first configuration file is updated according to a data push request of a user terminal, and the first configuration file comprises a code for generating a data file; generating a data file to be pushed locally according to the first configuration file; updating a second configuration file according to the data pushing request, wherein the second configuration file comprises codes used for transmitting the data file; pushing the data file to be pushed to the user terminal according to the second configuration file; therefore, during the data pushing process, the first configuration file program and the pushing program do not need to be rewritten, the workload of data management personnel is reduced, and human resources are saved.

Description

Data pushing method and device
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method and an apparatus for pushing data.
Background
Some data management systems, such as mobile network management systems, often store various data as data sources for user terminals, and due to the large amount of stored data, the data are usually stored in the form of databases.
After the user terminal sends a data use request to the data management system, the data management system cannot directly push data in the database to the user terminal, but needs to extract data required by the user terminal from the database to generate a corresponding data file, and then pushes the data file to the user terminal.
Because different user terminals have different requirements on data and the addresses of the user terminals are different, at present, a method for realizing the above process is to develop a set of program according to the content of a request to complete the generation and pushing tasks of data files when receiving a data use request of the user terminal, and the above method increases the workload of data managers.
Disclosure of Invention
In order to overcome the above problems or at least partially solve the above problems, the present invention provides a method and apparatus for pushing data.
According to an aspect of the present invention, there is provided a data pushing method, including: updating a first configuration file according to a data push request of a user terminal, wherein the first configuration file comprises a code for generating a data file; generating a data file to be pushed locally according to the first configuration file; updating a second configuration file according to the data pushing request, wherein the second configuration file comprises codes used for transmitting the data file; and pushing the data file to be pushed to the user terminal according to the second configuration file.
The updating of the first configuration file according to the data push request of the user terminal includes: analyzing the content of the data to be pushed according to the data pushing request; determining a query condition according to the content of the data to be pushed, wherein the query condition comprises a keyword of the data to be pushed and storage position information in a local data source; and updating the first configuration file according to the query condition.
Wherein, updating the second configuration file according to the data pushing request comprises: analyzing address information of the user terminal according to the data pushing request, wherein the address information of the user terminal comprises an IP (Internet protocol), a port, a user name and a password of the user terminal and a first storage directory of a data file to be pushed in the user terminal; and updating the second configuration file according to the address information.
The method for locally generating the data file to be pushed according to the first configuration file comprises the following steps: determining the storage format of the data to be pushed and the type of the data file to be pushed according to the content of the data to be pushed; determining a second storage directory of the data file to be pushed locally according to the type of the data file to be pushed; creating a blank file in the second storage directory according to the storage format of the data to be pushed, and determining the file name of the blank file according to the content of the data to be pushed, wherein the blank file is a file to be written with the data to be pushed; and searching data to be pushed in a local data source according to the query condition, and writing the data to be pushed into a blank file to generate a data file to be pushed.
Wherein, according to the second configuration file, pushing the data file to be pushed to the user terminal includes: acquiring a data file to be pushed which is locally stored; and pushing the data file to be pushed to the first storage directory according to the address information.
After updating the second configuration file according to the data push request, the method further includes: determining data pushing time according to the data pushing request; correspondingly, the locally generating a data file to be pushed according to the first configuration file includes: and at the data pushing moment, generating a data file to be pushed locally according to the first configuration file.
After writing the data to be pushed into the blank file, the method further comprises the following steps: and adding the time when the data to be pushed is written into the blank file into the file name of the blank file to be used as the file name of the data file to be pushed.
In another aspect of the present invention, an apparatus for pushing data is provided, including: at least one processor; and at least one memory communicatively coupled to the processor, wherein: the memory stores program instructions executable by the processor, which invokes the program instructions to perform the methods described above.
In yet another aspect of the invention, a computer program product is provided, the computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, cause the computer to perform the method described above.
In yet another aspect of the present invention, a non-transitory computer-readable storage medium is provided, which stores a computer program that causes a computer to perform the above-described method.
The invention provides a method and a device for data push, which update a first configuration file according to a data push request of a user terminal and update a second configuration file according to the data push request; generating a data file to be pushed locally according to the first configuration file; pushing the data file to be pushed to the user terminal according to the second configuration file; therefore, during the data pushing process, the first configuration file program and the pushing program do not need to be rewritten, the workload of data management personnel is reduced, and human resources are saved.
Drawings
In order to more clearly illustrate the technical solutions of the present invention or the prior art, the drawings needed for the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
Fig. 1 is a flowchart of a data pushing method according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In an embodiment of the present invention, referring to fig. 1, a method for pushing data is provided, including: s11, updating a first configuration file according to the data push request of the user terminal, wherein the first configuration file comprises a code for generating a data file; s12, generating a data file to be pushed locally according to the first configuration file; s13, updating a second configuration file according to the data pushing request, wherein the second configuration file comprises codes used for transmitting the data file; and S14, pushing the data file to be pushed to the user terminal according to the second configuration file.
Specifically, the data management system generally uses a database to store data as a data source, for example, an oracle database, where the data stored in the database has a certain format and is stored in a certain logical structure. On one hand, the data required by the user terminal, the logical structure between the data is different from the logical structure stored in the database, and the data in the database cannot be directly transmitted to the user terminal, and on the other hand, the user terminal may have special requirements on the storage mode of the data due to the difference of the data application environments, so that the data in the database in the data management system can be transmitted to the user terminal after special processing, for example, the data in the database is extracted and stored in a data file with a special format.
The extraction of data from the database and the generation of a corresponding number of data files may be implemented by means of a programming language (code), for example JAVA; the function of data file generation can be realized by writing a corresponding configuration file and a script starting program. In this embodiment, for the first configuration file, the code included in the generated data file is updated according to the data push request of the user terminal, so as to avoid repeated writing of the code in the first configuration file. Similarly, the second configuration file is updated according to the data push request of the user terminal, so as to save workload. And then generating a data file to be pushed locally according to the first configuration file, and pushing the data file to be pushed to the user terminal according to the second configuration file.
The embodiment updates a first configuration file by a data push request according to a user terminal, wherein the first configuration file comprises a code for generating a data file; generating a data file to be pushed locally according to the first configuration file; updating a second configuration file according to the data pushing request, wherein the second configuration file comprises codes used for transmitting the data file; pushing the data file to be pushed to the user terminal according to the second configuration file; therefore, during the data pushing process, the first configuration file program and the pushing program do not need to be rewritten, the workload of data management personnel is reduced, and human resources are saved.
Based on the above embodiment, updating the first configuration file according to the data push request of the user terminal includes: analyzing the content of the data to be pushed according to the data pushing request; determining a query condition according to the content of the data to be pushed, wherein the query condition comprises a keyword of the data to be pushed and storage position information in a local data source; and updating the first configuration file according to the query condition.
Specifically, in general, data sources in a data management system are stored in the form of a database, and the database has a data management function, such as a data query function; meanwhile, the data push request generally contains content information of the required data, and according to the content information, query conditions for searching the database for the content, such as keywords of the data to be pushed and storage location information in a local data source, can be deduced, and the first configuration file is updated by using the query conditions.
Based on the above embodiment, updating the second configuration file according to the data push request includes: analyzing address information of the user terminal according to the data pushing request, wherein the address information of the user terminal comprises an IP (Internet protocol), a port, a user name and a password of the user terminal and a first storage directory of a data file to be pushed in the user terminal; and updating the second configuration file according to the address information.
Specifically, if the data push request is sent by the user terminal, the address for sending the data push request can be analyzed; or the data push request may further include address information provided by the user terminal, and the address information may be directly extracted according to the content of the data request, where the address information includes an IP, a port, a user name, a password, and a specific directory for storing data files. And updating the second configuration file according to the address information.
Based on the above embodiment, locally generating a data file to be pushed according to a first configuration file includes: determining the storage format of the data to be pushed and the type of the data file to be pushed according to the content of the data to be pushed; determining a second storage directory of the data file to be pushed locally according to the type of the data file to be pushed; creating a blank file in the second storage directory according to the storage format of the data to be pushed, and determining the file name of the blank file according to the content of the data to be pushed, wherein the blank file is a file to be written with the data to be pushed; and searching data to be pushed in a local data source according to the query condition, and writing the data to be pushed into a blank file to generate a data file to be pushed.
Specifically, in order to facilitate management of the generated data files, the data management system stores the generated data files into a specified directory, and the types of the data files stored in one directory are the same, so that the data files can be conveniently searched when being pushed. In the process of generating the data file, firstly, judging the type of the data file to be generated according to the content information of the data to be pushed of the user terminal, determining the storage directory of the data file to be generated, and then creating a blank file under the directory, wherein the file name of the blank file is determined by the content of the data to be pushed, for example, the content of the data to be pushed is the configuration information of a computer, and the blank file can be named as computer configuration; the blank file can store data to be pushed, namely the blank file meets the requirement on a storage format; and then searching data to be pushed in a local data source according to the query conditions, writing the queried data into a blank file, and generating a data file, wherein specific data writing can write the data into the blank file column by column, a column header is the attribute of the data, and the content is the corresponding data queried in the database.
Based on the above embodiment, pushing the data file to be pushed to the user terminal according to the second configuration file includes: acquiring a data file to be pushed which is locally stored; and pushing the data file to be pushed to the first storage directory according to the address information.
Specifically, the data file to be pushed is acquired according to the local storage directory, and then the data file is sent to the address in the updated second configuration file to complete the pushing of the data, for example, the data file is directly sent to the storage directory specified by the user terminal.
Based on the above embodiment, after updating the second configuration file according to the data push request, the method further includes: determining data pushing time according to the data pushing request; correspondingly, the locally generating a data file to be pushed according to the first configuration file includes: and at the data pushing moment, generating a data file to be pushed locally according to the first configuration file.
In particular, some user terminals also require a specific time for data pushing, even a time period for data pushing, for example, require data to be pushed at a specific time every day or every week; the timing task can be set according to the pushing request of the user, for example, the timing task is set through Quartz, and as the data in the database is updated in real time, the corresponding data file can be generated and pushed at the moment when the user terminal requests to push the data, and the requirement of data real-time property can be met.
Based on the above embodiment, after writing the data to be pushed into the blank file, the method further includes: and adding the time when the data to be pushed is written into the blank file into the file name of the blank file to be used as the file name of the data file to be pushed.
Specifically, for some user terminals that need to push data according to a time period, because the file names of the generated data files are determined by the content of the data to be transmitted, the data files generated at different times may appear, and the content is the same, for example, the content generated at different times is all data files configured by a computer, which may cause the file names to be the same, and the file names to be configured by the computer, which is not favorable for local management and use of the user terminal.
As another embodiment of the present invention, an apparatus for pushing data is provided, including: at least one processor; and at least one memory communicatively coupled to the processor, wherein: the memory stores program instructions executable by the processor, and the processor calls the program instructions to execute the methods provided by the method embodiments, for example, the method includes: updating a first configuration file according to a data push request of a user terminal, wherein the first configuration file comprises a code for generating a data file; generating a data file to be pushed locally according to the first configuration file; updating a second configuration file according to the data pushing request, wherein the second configuration file comprises codes used for transmitting the data file; and pushing the data file to be pushed to the user terminal according to the second configuration file.
As yet another embodiment of the present invention, there is provided a computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions which, when executed by a computer, enable the computer to perform the methods provided by the above-described method embodiments, for example, including: updating a first configuration file according to a data push request of a user terminal, wherein the first configuration file comprises a code for generating a data file; generating a data file to be pushed locally according to the first configuration file; updating a second configuration file according to the data pushing request, wherein the second configuration file comprises codes used for transmitting the data file; and pushing the data file to be pushed to the user terminal according to the second configuration file.
As yet another embodiment of the present invention, there is provided a non-transitory computer-readable storage medium storing a computer program that causes a computer to perform the methods provided by the above-described method embodiments, including, for example: updating a first configuration file according to a data push request of a user terminal, wherein the first configuration file comprises a code for generating a data file; generating a data file to be pushed locally according to the first configuration file; updating a second configuration file according to the data pushing request, wherein the second configuration file comprises codes used for transmitting the data file; and pushing the data file to be pushed to the user terminal according to the second configuration file.
Those of ordinary skill in the art will understand that: all or part of the steps for implementing the method embodiments may be implemented by hardware related to computer program instructions, where the computer program may be stored in a computer readable storage medium, and when executed, the computer program performs the steps including the method embodiments; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, the description is as follows: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (7)

1. A method of data push, comprising:
updating a first configuration file according to a data push request of a user terminal, wherein the first configuration file comprises a code for generating a data file;
generating a data file to be pushed locally according to the first configuration file;
updating a second configuration file according to the data push request, wherein the second configuration file comprises codes used for transmitting data files;
pushing the data file to be pushed to the user terminal according to the second configuration file;
the updating the first configuration file according to the data push request of the user terminal comprises:
analyzing the content of the data to be pushed according to the data pushing request;
determining a query condition according to the content of the data to be pushed, wherein the query condition comprises a keyword of the data to be pushed and storage position information in a local data source;
updating the first configuration file according to the query condition;
the updating the second configuration file according to the data pushing request comprises:
analyzing the address information of the user terminal according to the data pushing request, wherein the address information of the user terminal comprises an IP (Internet protocol), a port, a user name and a password of the user terminal and a first storage directory of the data file to be pushed in the user terminal;
and updating the second configuration file according to the address information.
2. The method according to claim 1, wherein the locally generating a data file to be pushed according to the first configuration file comprises:
determining the storage format of the data to be pushed and the type of the data file to be pushed according to the content of the data to be pushed;
determining a second storage directory of the data file to be pushed locally according to the type of the data file to be pushed;
creating a blank file in the second storage directory according to the storage format of the data to be pushed, and determining the file name of the blank file according to the content of the data to be pushed, wherein the blank file is a file to be written in the data to be pushed;
and searching the data to be pushed in a local data source according to the query condition, and writing the data to be pushed into the blank file to generate the data file to be pushed.
3. The method according to claim 2, wherein the pushing the data file to be pushed to the user terminal according to the second configuration file comprises:
acquiring the data file to be pushed stored locally;
and pushing the data file to be pushed to the first storage directory according to the address information.
4. The method of claim 1, wherein after updating the second configuration file according to the data push request, further comprising:
determining data pushing time according to the data pushing request;
correspondingly, the locally generating a data file to be pushed according to the first configuration file includes:
and at the data pushing moment, generating a data file to be pushed locally according to the first configuration file.
5. The method of claim 2, wherein after writing the data to be pushed to the blank file, further comprising:
and adding the time when the data to be pushed is written into the blank file into the file name of the blank file to be used as the file name of the data file to be pushed.
6. An apparatus for pushing data, comprising:
at least one processor; and at least one memory communicatively coupled to the processor, wherein:
the memory stores program instructions executable by the processor, the processor calling the program instructions to perform the method of any of claims 1 to 5.
7. A non-transitory computer-readable storage medium storing a computer program that causes a computer to perform the method according to any one of claims 1 to 5.
CN201810156753.XA 2018-02-24 2018-02-24 Data pushing method and device Active CN108491448B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810156753.XA CN108491448B (en) 2018-02-24 2018-02-24 Data pushing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810156753.XA CN108491448B (en) 2018-02-24 2018-02-24 Data pushing method and device

Publications (2)

Publication Number Publication Date
CN108491448A CN108491448A (en) 2018-09-04
CN108491448B true CN108491448B (en) 2021-06-04

Family

ID=63340627

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810156753.XA Active CN108491448B (en) 2018-02-24 2018-02-24 Data pushing method and device

Country Status (1)

Country Link
CN (1) CN108491448B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109271563A (en) * 2018-10-15 2019-01-25 北京奇艺世纪科技有限公司 A kind of data-pushing control method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101674318A (en) * 2008-09-11 2010-03-17 北大方正集团有限公司 Method for pushing data to mobile equipment at regular time
CN103997410A (en) * 2014-05-23 2014-08-20 北京鸿达以太文化发展有限公司 Mobile-terminal-oriented multimedia data virtual live telecast system and method
CN105426516A (en) * 2015-11-30 2016-03-23 广东电网有限责任公司电力科学研究院 Power system data query method and system
CN107341033A (en) * 2017-06-30 2017-11-10 百度在线网络技术(北京)有限公司 A kind of data statistical approach, device, electronic equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101674318A (en) * 2008-09-11 2010-03-17 北大方正集团有限公司 Method for pushing data to mobile equipment at regular time
CN103997410A (en) * 2014-05-23 2014-08-20 北京鸿达以太文化发展有限公司 Mobile-terminal-oriented multimedia data virtual live telecast system and method
CN105426516A (en) * 2015-11-30 2016-03-23 广东电网有限责任公司电力科学研究院 Power system data query method and system
CN107341033A (en) * 2017-06-30 2017-11-10 百度在线网络技术(北京)有限公司 A kind of data statistical approach, device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN108491448A (en) 2018-09-04

Similar Documents

Publication Publication Date Title
CN110908997B (en) Data blood relationship construction method and device, server and readable storage medium
CN108228814B (en) Data synchronization method and device
CN108846753B (en) Method and apparatus for processing data
CN111367925A (en) Data dynamic real-time updating method, device and storage medium
CN111046041B (en) Data processing method and device, storage medium and processor
CN111460241B (en) Data query method and device, electronic equipment and storage medium
CN107844488B (en) Data query method and device
CN105677536A (en) Implementing method for task messages and task system for implementing task messages
US10311082B2 (en) Synchronization of offline instances
CN107341217B (en) Data acquisition method and equipment
CN108491448B (en) Data pushing method and device
CN111241189A (en) Method and device for synchronizing data
CN109391658B (en) Account data synchronization method and equipment, storage medium and terminal thereof
CN108959294B (en) Method and device for accessing search engine
CN112434037A (en) Data processing method, processing device, data processing apparatus, and storage medium
CN113645260A (en) Service retry method, device, storage medium and electronic equipment
US20170139758A1 (en) Nondeterministic Operation Execution Environment Utilizing Resource Registry
CN113986942B (en) Message queue management method and device based on man-machine conversation
CN111753141A (en) Data management method and related equipment
CN114819631A (en) Multitask visualization method and device, computer equipment and storage medium
CN111538651A (en) Interface testing method, device, server and storage medium
US20200133792A1 (en) Method, apparatus, and computer program product for managing virtual machine
US9069751B1 (en) Systems and methods for managing document pedigrees
US20240053981A1 (en) Methods for automated configuration management in platform-as-a-service environments and devices thereof
CN113420037B (en) Asset data real-time changing method and device

Legal Events

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