CN115237446A - File data updating method and device, equipment, medium and product thereof - Google Patents

File data updating method and device, equipment, medium and product thereof Download PDF

Info

Publication number
CN115237446A
CN115237446A CN202210918216.0A CN202210918216A CN115237446A CN 115237446 A CN115237446 A CN 115237446A CN 202210918216 A CN202210918216 A CN 202210918216A CN 115237446 A CN115237446 A CN 115237446A
Authority
CN
China
Prior art keywords
file
data
text
text data
split
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210918216.0A
Other languages
Chinese (zh)
Inventor
尹亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Huanju Shidai Information Technology Co Ltd
Original Assignee
Guangzhou Huanju Shidai Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Huanju Shidai Information Technology Co Ltd filed Critical Guangzhou Huanju Shidai Information Technology Co Ltd
Priority to CN202210918216.0A priority Critical patent/CN115237446A/en
Publication of CN115237446A publication Critical patent/CN115237446A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Landscapes

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

Abstract

The application discloses a file data updating method, a device, equipment, a medium and a product thereof, wherein the method comprises the following steps: monitoring text data stored in a plurality of split files corresponding to a source text file, responding to a data updating event acting on any split file, and correspondingly storing a file serial number of the split file and updated text data into an updating queue; acquiring a file serial number output by the updating queue and updating text data thereof, and replacing original text data corresponding to the file serial number in a split copy data table with the updating text data; and merging all the text data in the split copy data table to generate a new text file, and matching a class object corresponding to each text data in the text file according to a class object matching rule. The method and the device can split the large file acting on the class object into the plurality of subfiles for monitoring and updating, ensure the data consistency of the data of the file in the updating process, and efficiently match the corresponding data for the various objects after the updating process.

Description

File data updating method and device, equipment, medium and product thereof
Technical Field
The present application relates to the field of data processing, and in particular, to a file data updating method, and further, to a corresponding apparatus, device, non-volatile storage medium, and computer program product of the method.
Background
In the existing program system, file data referenced by each program item needs to be monitored, and after the file data is updated, the updated data is imported into a class object in the program item, which is used for referencing the data currently, so as to ensure timeliness of the data referenced by the class object, but in the existing file data monitoring mode, the class object is imported after only splitting the file data monitored to be updated, which consumes a large amount of computing resources, and for deleting the updated file data, the currently deleted file data needs to be compared one by one until the deleted data is determined, and then the data is deleted from the class object referencing the deleted data, so that time consumed in the processing process is high in complexity, and a code structure and execution logic in the class object may be damaged, which greatly affects stability of a corresponding program.
In view of the problems with the update of file data in the existing program systems, the present applicant has made a corresponding search in view of solving the problems.
Disclosure of Invention
The application aims to meet the requirements of users and provides a file data updating method, and further relates to a corresponding device, equipment, a non-volatile storage medium and a computer program product of the method.
In order to realize the purpose of the application, the following technical scheme is adopted:
a file data updating method provided in response to an object of the present application, comprising the steps of:
monitoring text data stored in a plurality of split files corresponding to a source text file, responding to a data updating event acting on any split file, and correspondingly storing the file serial number and the updated text data of the split file into an updating queue, wherein all the text data of the source text file are dispersedly stored in each split file according to a file splitting rule;
acquiring a file serial number output by the updating queue and updating text data thereof, replacing original text data corresponding to the file serial number in a split copy data table with the updating text data, wherein mapping relation data formed by the file serial number of each split file and the text data thereof are stored in the split copy data table;
and merging all the text data in the split copy data table to generate a new text file, and matching a class object corresponding to each text data in the text file according to a class object matching rule.
In a further embodiment, the step of dispersedly storing all text data of the source text file into each split file according to the file splitting rule includes the following steps:
responding to a file splitting instruction acting on a source text file, and determining the target splitting number corresponding to the instruction;
determining a storage position serial number of text data to be split in a source text file, performing remainder calculation on the storage position serial number and a target splitting number, and storing the text data to be split into a split file with a file serial number as a remainder of a calculation result;
and by analogy, storing each text data in the source text file into the corresponding split text.
In a further embodiment, the step of storing the mapping relationship data formed by the file serial number of each split file and the text data thereof in the split copy data table includes the following steps:
determining the file serial number of each split file corresponding to the current source text file, and acquiring the text data of each split file;
generating a plurality of key value pair data consisting of the file serial numbers and the text data thereof by taking the file serial numbers as key identifications and the text data corresponding to the file serial numbers as value data;
and storing each key-value pair data into the split copy data table.
In a further embodiment, the step of obtaining the file serial number output by the update queue and the update text data thereof, and replacing the original text data corresponding to the file serial number in the split copy data table with the update text data includes the following steps:
acquiring a target file serial number and update text data currently output by the update queue;
inquiring target key value pair data with a target file sequence number in the split copy data table;
replacing the text data stored by the value data of the target key-value pair data with the updated text data.
In a further embodiment, the step of merging all the text data in the split-copy data table to generate a new text file includes the following steps:
acquiring all text data and storage position serial numbers thereof in the split copy data table;
and generating a new text file, and sequentially storing the text data into the text file according to the storage position serial number of each text data.
In a further embodiment, the step of matching the class object corresponding to each text data in the text file according to the class object matching rule includes the following steps:
acquiring target text data to be matched currently in a newly generated text file, and determining a data composition format of the target text data, wherein the data composition format refers to the data type and the data separator of each text in the text data;
determining a target class object of which the class object matching rule is matched with the data composition format, and taking target text data as reference text data of the target class object;
and by analogy, matching class objects corresponding to the text data in the text file, and allocating the text data as reference text data of the class objects corresponding to the text data.
A file data update apparatus proposed in conformity with the purpose of the present application, comprising:
the updated text acquisition module is used for monitoring text data stored in a plurality of split files corresponding to a source text file, responding to a data updating event acting on any split file, correspondingly storing the file serial number of the split file and the updated text data into an updating queue, and dispersedly storing all the text data of the source text file into each split file according to a file splitting rule;
the text data updating module is used for acquiring the file serial number output by the updating queue and updating text data thereof, replacing original text data corresponding to the file serial number in a split copy data table with the updating text data, and storing mapping relation data formed by the file serial number of each split file and the text data thereof in the split copy data table;
and the text object matching module is used for combining all the text data in the split copy data table to generate a new text file and matching the class object corresponding to each text data in the text file according to the class object matching rule.
In a further embodiment, the update text obtaining module includes:
the splitting instruction response submodule is used for responding to a file splitting instruction acting on the source text file and determining the target splitting number corresponding to the instruction;
the split text determining submodule is used for determining a storage position serial number where the text data to be split in the source text file are located, performing remainder calculation on the storage position serial number and the target split number, and storing the text data to be split into a split file with a file serial number as the remainder of a calculation result;
and the data splitting and storing submodule is used for storing each text data in the source text file into the corresponding splitting text in the same way.
In a further embodiment, the text data updating module includes:
the text data analysis submodule is used for determining the file serial number of each split file corresponding to the current source text file and acquiring the text data of each split file;
the data key value pair generation submodule is used for generating a plurality of key value pair data consisting of the file serial numbers and the text data thereof by taking the file serial numbers as key identifications and the text data corresponding to the file serial numbers as value data;
and the key value pair storage submodule is used for storing the key value pair data into the split copy data table.
In a preferred embodiment, the text data updating module further comprises:
the update text acquisition submodule is used for acquiring the serial number of the target file currently output by the update queue and the update text data;
the target key-value pair query submodule is used for querying target key-value pair data with a target file serial number in the split copy data table;
and the text data replacement submodule is used for replacing the text data stored by the value data of the target key-value pair data with the updated text data.
In a further embodiment, the text object matching module comprises:
the split data acquisition submodule is used for acquiring all text data and storage position serial numbers thereof in the split copy data table;
and the text file generation submodule is used for generating a new text file and sequentially storing the text data into the text file according to the storage position serial number of each text data.
In a preferred embodiment, the text object matching module further comprises:
the composition format determining submodule is used for acquiring target text data to be matched currently in a newly generated text file and determining a data composition format of the target text data, wherein the data composition format refers to the data type and the data separator of each text in the text data;
the target class object determining submodule is used for determining a target class object of which the class object matching rule is matched with the data composition format and taking target text data as reference text data of the target class object;
and the text data distribution submodule is used for matching class objects corresponding to the text data in the text file by analogy, and distributing the text data into reference text data of the corresponding class objects.
In order to solve the above technical problem, an embodiment of the present invention further provides a computer device, including a memory and a processor, where the memory stores computer-readable instructions, and the computer-readable instructions, when executed by the processor, cause the processor to execute the steps of the file data updating method.
In order to solve the above technical problem, an embodiment of the present invention further provides a storage medium storing computer-readable instructions, which, when executed by one or more processors, cause the one or more processors to perform the steps of the file data updating method described above.
In order to solve the above technical problem, an embodiment of the present invention further provides a computer program product, which includes a computer program and computer instructions, and when the computer program and the computer instructions are executed by a processor, the processor executes the steps of the file data updating method.
Compared with the prior art, the application has the following advantages that:
the method comprises the steps of splitting a large text file, splitting and storing all text data stored in the large text file into small split files, enabling developers to update the text data aiming at the split texts, enabling the large text file not to be damaged when the text data are updated, monitoring data updating events of the split texts, and guaranteeing the data safety problem of an updating thread when the text events are updated.
Drawings
The foregoing and/or additional aspects and advantages of the present application will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
fig. 1 is a schematic diagram of a typical network deployment architecture related to implementing the technical solution of the present application;
FIG. 2 is a schematic flow chart diagram illustrating an exemplary embodiment of a file data update method according to the present application;
FIG. 3 is a schematic flow chart illustrating a specific embodiment of splitting a source text file according to the present application;
FIG. 4 is a schematic flow chart diagram illustrating an embodiment of generating a split-copy data table according to the present application;
FIG. 5 is a schematic flow chart illustrating a specific embodiment of updating corresponding text data in a split-copy data table according to the present application;
FIG. 6 is a schematic flowchart illustrating a specific embodiment of generating a new text file by merging and splitting a duplicate data table according to the present application;
FIG. 7 is a flowchart illustrating a specific embodiment of matching class objects of text data in a newly generated text file according to the present application;
FIG. 8 is a functional block diagram of an exemplary embodiment of a file data update apparatus of the present application;
fig. 9 is a block diagram of a basic structure of a computer device according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to the embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like reference numerals refer to the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the drawings are exemplary only for the purpose of explaining the present application and are not to be construed as limiting the present application.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. As used herein, the term "and/or" includes all or any element and all combinations of one or more of the associated listed items.
It will be understood by those within the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
As used herein, "client," "terminal," and "terminal device" include both wireless signal receiver devices, which are only capable of wireless signal receiver devices without transmit capability, and receiving and transmitting hardware devices, which have receiving and transmitting hardware capable of two-way communication over a two-way communication link, as will be understood by those skilled in the art. Such a device may include: cellular or other communication devices such as personal computers, tablets, etc. having single or multi-line displays or cellular or other communication devices without multi-line displays; PCS (Personal Communications Service), which may combine voice, data processing, facsimile and/or data communication capabilities; a PDA (Personal Digital Assistant) which may include a radio frequency receiver, a pager, internet/intranet access, web browser, notepad, calendar and/or GPS (Global Positioning System) receiver; a conventional laptop and/or palmtop computer or other device having and/or including a radio frequency receiver. As used herein, a "client," "terminal device" can be portable, transportable, installed in a vehicle (aeronautical, maritime, and/or land-based), or situated and/or configured to operate locally and/or in a distributed fashion at any other location(s) on earth and/or in space. The "client", "terminal Device" used herein may also be a communication terminal, a web terminal, a music/video playing terminal, such as a PDA, an MID (Mobile Internet Device) and/or a Mobile phone with music/video playing function, and may also be a smart tv, a set-top box, and the like.
The hardware referred to by the names "server", "client", "work node", etc. is essentially an electronic device with the performance of a personal computer, and is a hardware device having necessary components disclosed by the von neumann principle such as a central processing unit (including an arithmetic unit and a controller), a memory, an input device, an output device, etc., a computer program is stored in the memory, and the central processing unit calls a program stored in an external memory into the internal memory to run, executes instructions in the program, and interacts with the input and output devices, thereby completing a specific function.
It should be noted that the concept of "server" as referred to in this application can be extended to the case of a server cluster. According to the network deployment principle understood by those skilled in the art, the servers should be logically divided, and in physical space, the servers may be independent from each other but can be called through an interface, or may be integrated into one physical computer or a set of computer clusters. Those skilled in the art will appreciate this variation and should not be so limited as to restrict the implementation of the network deployment of the present application.
Referring to fig. 1, the hardware basis required for implementing the related art embodiments of the present application may be deployed according to the architecture shown in the figure. The server 80 is deployed in the cloud, and serves as an online server, which may be responsible for further connecting to related data servers and other servers providing related support, so as to form a logically associated server group, so as to provide services for related terminal devices, such as the smart phone 81 and the personal computer 82 shown in the figure, or a third-party server (not shown). Both the smart phone and the personal computer can access the internet through a known network access mode, and establish a data communication link with the cloud server 80 so as to run a terminal application program related to the service provided by the server.
For the server, the application program is usually constructed as a service process, and a corresponding program interface is opened for remote call of the application program running on various terminal devices.
The application program refers to an application program running on a server or a terminal device, the application program realizes the related technical scheme of the application in a programming mode, a program code of the application program can be saved in a nonvolatile storage medium which can be identified by a computer in a form of a computer executable instruction, and is called into a memory by a central processing unit to run, and the related device of the application is constructed through the running of the application program on the computer.
For the server, the application program is usually constructed as a service process, and a corresponding program interface is opened for remote call of the application program running on various terminal devices.
The person skilled in the art will know this: although the various methods of the present application are described based on the same concept so as to be common to each other, they may be independently performed unless otherwise specified. In the same way, for each embodiment disclosed in the present application, it is proposed based on the same inventive concept, and therefore, concepts of the same expression and concepts of which expressions are different but are appropriately changed only for convenience should be equally understood.
Referring to fig. 2, a file data updating method according to the present application, in an exemplary embodiment, includes the following steps:
step S11, monitoring text data stored in a plurality of split files corresponding to a source text file, responding to a data updating event acting on any split file, correspondingly storing a file serial number of the split file and updated text data into an updating queue, and dispersedly storing all the text data of the source text file into each split file according to a file splitting rule:
the text file is a file storing a plurality of text data, the text file stores the text data in a storage structure of lines and columns, and the text data stored in the text file is referred by various objects of the text file, so that the various objects refer to the corresponding text data to execute corresponding code logic to realize corresponding functions.
The method comprises the steps of splitting each text data stored in a source text file to store the split text data into corresponding split files, splitting the text data at the storage position of each text data in the text file when splitting the text file, namely splitting rows or splitting columns, specifically, responding to a file splitting instruction acting on the source text file, determining the target splitting number corresponding to the instruction, determining the storage position serial number of the text data to be split in the source text file, wherein the storage position serial number refers to the number of the rows or the columns of the text data to be split, calculating the remainder of the storage position serial number and the target splitting number, storing the text data to be split into the split file with the file serial number as the remainder of the calculation result, and so on, and storing each text data in the source text file into the corresponding split text, wherein the text data stored in the split file and the corresponding storage position serial number of the text data are also stored correspondingly.
The data updating event refers to an event split after the management end or the development end updates the text data stored in any split text, and the data updating event acting on the split text is triggered after the management end or the development end modifies the text data stored in any split text.
When a data updating event acting on any split file is responded, the file serial number of the split file and the updated text data are determined, the file serial number and the text data are stored into an updating queue as mapping relation data, and the mapping relation data consisting of the file serial number and the text data and stored in the updating queue are output according to a first-in first-out rule so as to output data streams.
Step S12, obtaining the file serial number and the updated text data thereof output by the update queue, replacing the original text data corresponding to the file serial number in the split copy data table with the updated text data, wherein the split copy data table stores the mapping relation data formed by the file serial number and the text data of each split file:
the split copy data table is a copy of each split file, that is, the split copy data table stores text data and file numbers thereof of all split files, and each text data is stored corresponding to the file number thereof, specifically, the split copy data table takes the file number as key data and the text data as value data, and the split copy data table stores key value pair data which takes the file number as key data and the text data stored by the file number as value data.
And after acquiring the file serial number currently and latest output by the update queue and the update text data corresponding to the file serial number, inquiring a key value pair taking the file serial number as key data in the split copy data table, and replacing the original text data stored by value data of the key value pair with the update text data.
In one embodiment, after the file serial number output by the update queue in the split-copy data table is queried as the key value pair of the key data, the original text data with the storage location serial number is queried in the key value pair data based on the storage location serial number included in the update text data corresponding to the file serial number, so as to replace the original text data with the update text data.
Step S13, merging all the text data in the split copy data table to generate a new text file, and matching a class object corresponding to each text data in the text file according to a class object matching rule:
after replacing original text data of any file serial number in the split copy data table with updated text data, merging all the text data in the split copy data table to output a new text file, merging the split copy data table to sort all the text data based on the storage position serial numbers of all the text data to output the new text file, specifically, acquiring all the text data in the split copy data table, determining the storage position serial numbers corresponding to all the text data, simultaneously generating a new text file, and sequentially storing the text data into the text file according to the storage position serial numbers of all the text data.
The text file is regarded as a source text file which is completely updated, namely, the source text file is compared with a newly generated text file, and the newly generated text file has updated text data corresponding to the data updating event.
In one embodiment, the merging of the split copy data table is triggered at regular time, and after a timed merging instruction acting on the split copy data table is responded, the merging of the split copy data table is performed, so that all the text data stored in the split copy data table are merged into a new text file.
After the new text files are combined and generated, class objects corresponding to the text data in the text files are matched according to the class object matching rules, so that the text data are imported into the corresponding class objects for data reference, specifically, target text data to be matched in the currently newly generated text files are obtained, a data composition format of the target text data is determined, the data composition format refers to the data type and the data separator of each text in the text data, the target class objects of which the class object matching rules are matched with the data composition format are further determined, the target text data are used as reference text data of the target class objects, the class objects corresponding to the text data in the text files are matched by analogy, and the text data are distributed into the reference text data of the corresponding class objects.
In one embodiment, in addition to matching a corresponding class object for each text data through the data composition format, a corresponding class object may also be matched for the text data through a data attribute corresponding to the text data, where the data attribute refers to an attribute that the text data is customized by a developer in a program project, for example, when the text data is a product title data, a data attribute that is characterized as the product title data may be set for the text data, so as to match the text data as reference text data that references the class object of the product title data.
According to the typical embodiment of the method, a large text file is split and stored into small split files, so that developers can update the text data of the split files, the large text file is not damaged when the text data is updated, data updating events of the split files are monitored, the data safety problem of an updating thread when the text events are updated is guaranteed, split copy data tables with all the text data of the split files are generated to serve as copies of the split texts, data updating can be carried out on the split texts when the text data is updated, new text files are generated by combining the updated text data in the split text files, class object matching is carried out on the new text files with the updated text data, the text data are deleted from class objects without inquiring the class objects with the deleted text data one by one when the data is deleted and updated, new text data are redistributed for the various types of objects through the updated text files, reference can be carried out on the text data, and the text objects quoted by efficiently updating the text files can be guaranteed to be consistent with the text objects.
The above exemplary embodiments and variations thereof fully disclose the embodiments of the document data updating method of the present application, but many variations thereof can be deduced by transforming and augmenting some technical means, and other embodiments are briefly described as follows:
in an embodiment, referring to fig. 3, the step of storing all the text data in the source text file in each split file according to the file splitting rule in a distributed manner includes the following steps:
step S111, in response to a file splitting instruction acting on the source text file, determining a target splitting number corresponding to the instruction:
the file splitting instruction is used for triggering the source text files into split files with corresponding number, the target splitting number is set for the source text files to trigger the file splitting instruction acting on the source text files, and then the current equipment responds to the file splitting instruction to determine the target splitting number of the split text files needed to be split by the source text files.
Step S112, determining the storage position serial number of the text data to be split in the source text file, performing remainder calculation on the storage position serial number and the target splitting number, and storing the text data to be split into the split file with the file serial number as the remainder of the calculation result:
after the target splitting number to be split is determined, determining a storage position serial number of the current text data to be split in the source text file, for example, when the storage position serial number of the text data to be split is 1002 and the target splitting number is 10, performing remainder calculation on the storage position serial number and the target splitting number, wherein the storage position serial number is used as a remainder, and a calculation result is 2, and then storing the text data to be split into the split file with the file serial number of 2.
Step S113, by analogy, storing each text data in the source text file into a corresponding split text:
and performing remainder calculation on the storage position serial numbers of the text data in the source text file and the target splitting number to store the text data into the splitting file corresponding to the file serial numbers, completing the splitting in the source text file, and generating a plurality of splitting files storing the corresponding text data in the source text file.
In this embodiment, based on the storage location of each text data in the source text file, it is further efficiently determined that the text data needs to be stored in the corresponding split file, and the large text file is further sequentially split into a plurality of split files, so that the text data copies of the split texts are covered and merged in the following process.
In an embodiment, referring to fig. 4, the step of storing mapping relationship data composed of the file serial number of each split file and the text data thereof in the split copy data table includes the following steps:
step S121, determining a file number of each split file corresponding to the current source text file, and acquiring text data of each split file:
regarding the generation mode of the split copy data table, the split copy data table is a copy data table of each split text, and the text data is classified and stored based on each split text.
Step S122, using each file serial number as a key identifier, and using text data corresponding to the file serial numbers as value data, to generate a plurality of key-value pair data composed of file serial numbers and text data thereof:
after the file serial numbers of the split files and the stored text data are determined, the file serial numbers are used as value data, the text data corresponding to the file serial numbers are used as key data, a plurality of key value pair data formed by the file serial numbers and the corresponding text data are generated, and the file serial numbers and the corresponding text data are correspondingly stored.
Step S123, storing each key-value pair data in the split copy data table:
and generating any key value pair data consisting of a file serial number and text data, storing the key value pair data in the split copy data table, and so on, storing the file serial number and the text data of each split text in the split copy data table, so that the split copy data table is used as a copy of the text data of each split text.
In this embodiment, the split copy data table of the text data having each split file is generated as a copy, and is used as an update target in the update process of the text data, so that the text file having the updated text data is generated based on the split copy data table, and the consistency and timeliness of the updated text data are improved.
In an embodiment, referring to fig. 5, the step of obtaining the file serial number and the updated text data thereof output by the update queue and replacing the original text data corresponding to the file serial number in the split-copy data table with the updated text data includes the following steps:
step S121', acquiring a sequence number of a target file currently output by the update queue and update text data:
and the updating queue outputs the sequence numbers of the target files and the corresponding stored updating text quantity according to the rule of enqueuing and dequeuing, and pushes the data in a data stream mode.
Step S122', querying the target key-value pair data with the target file sequence number in the split copy data table:
after the target file serial number is obtained, the target key value pair data with the target file serial number in the split copy data table is inquired, and then the source text data stored by the target key value pair is updated.
Step S123' replaces the text data stored in the value data of the target key-value pair data with the updated text data:
and after the target key value pair data with the target file serial number is inquired, replacing the original text data stored by the target key value pair data with the updated text data so as to update the original text data stored by the target key value pair data.
In this embodiment, the original text data in the key value pair data is replaced with the updated text data by querying the key value pair data to be updated in the split-copy data table serving as the copy, so that the text data stored in the text file generated by combining the split-copy data tables is the updated text data.
In an embodiment, referring to fig. 6, the step of merging all the text data in the split-copy data table to generate a new text file includes the following steps:
step S131, acquiring all text data and storage position serial numbers thereof in the split copy data table:
the storage position sequence number is used for representing the storage position of the text data in the source text file, and the text data are stored in the storage position corresponding to the text file generated after combination by acquiring the storage position sequence number corresponding to each text data in the split copy data table.
Step S132, generating a new text file, and sequentially storing the text data into the text file according to the storage location sequence number of each text data:
and generating a new text file to store each text data, and when each text data is stored to the newly generated text file, sequentially storing the text data into the text file based on the storage position serial numbers of the text data, namely storing the text data with the minimum storage position serial number into the position, which is positioned at the front of the storage position, in the text file.
In this embodiment, the text data is sequentially stored in the newly generated text file based on the storage location number of the text data in each split-copy data table, so that the storage location of each text data in the newly generated text file is the same as that in the source text file.
In an embodiment, referring to fig. 7, the step of matching the class object corresponding to each text data in the text file according to the class object matching rule includes the following steps:
step S131', obtaining target text data to be matched currently in a newly generated text file, and determining a data composition format of the target text data, where the data composition format refers to a data type and a data delimiter of each text in the text data:
the data composition format refers to a data type and a data delimiter of each text in the text data, wherein the data type refers to a data type of the text data in a high-level programming language such as long integer, short integer or number, and the data delimiter refers to the data type; "," < > "or" [ ] ", or the like, in a high-level programming language.
Step S132', determining a target class object whose class object matching rule matches the data composition format, and using the target text data as reference text data of the target class object:
the class object matching rules are provided with regular expressions or method matching rules corresponding to a plurality of class objects, after the representation data types of the target text data needing to be matched and the data composition formats of the data separators are determined, the regular expressions or the method matching rules matched with the data composition formats are inquired, the class objects corresponding to the regular expressions or the method matching rules are used as target class objects, and the target text data are led into the target class objects to be used as reference text data.
Step S133', and so on, matching class objects corresponding to each text data in the text file, and allocating the text data as reference text data of the respective corresponding class objects:
matching class objects corresponding to the text data through the data composition format of the text data in the newly generated text file, and further respectively importing the text data into the corresponding class objects, namely allocating the text data as reference text data of the respective corresponding class objects.
In this embodiment, by matching the text data in the newly generated text file to the corresponding class object, so that the class object references the latest updated text data, the class objects are matched in a centralized manner, and for the deleted text data, text data deletion does not need to be performed in the class object, the deleted text data cannot be matched to the corresponding class object naturally, and the text data referenced in the class object is also replaced by the text data in the newly deleted text file.
Further, a document data updating apparatus of the present application can be constructed by functionalizing the steps in the methods disclosed in the above embodiments, and according to this idea, please refer to fig. 8, wherein in an exemplary embodiment, the apparatus includes: the updated text acquisition module 11 is configured to monitor text data stored in a plurality of split files corresponding to a source text file, respond to a data update event acting on any split file, and correspondingly store a file serial number of the split file and updated text data into an update queue, where all text data of the source text file are dispersedly stored in each split file according to a file split rule; a text data updating module 12, configured to obtain a file serial number output by the update queue and update text data thereof, and replace original text data corresponding to the file serial number in a split-copy data table with the update text data, where a mapping relationship data formed by the file serial number of each split file and the text data thereof is stored in the split-copy data table; and the text object matching module 13 is configured to combine all text data in the split copy data table to generate a new text file, and match a class object corresponding to each text data in the text file according to a class object matching rule.
In one embodiment, the update text obtaining module 11 includes: the splitting instruction response submodule is used for responding to a file splitting instruction acting on the source text file and determining the target splitting number corresponding to the instruction; the split text determining submodule is used for determining a storage position serial number of the text data to be split in the source text file, performing remainder calculation on the storage position serial number and the target split number, and storing the text data to be split into a split file of which the file serial number is the remainder of the calculation result; and the data splitting and storing submodule is used for storing each text data in the source text file into the corresponding splitting text in the same way.
In one embodiment, the text data update module 12 comprises: the text data analysis submodule is used for determining the file serial number of each split file corresponding to the current source text file and acquiring the text data of each split file; the data key value pair generation submodule is used for generating a plurality of key value pair data consisting of the file serial numbers and the text data thereof by taking the file serial numbers as key identifications and the text data corresponding to the file serial numbers as value data; and the key value pair storage submodule is used for storing the key value pair data into the split copy data table.
In another embodiment, the text data updating module 12 further includes: the update text acquisition submodule is used for acquiring the serial number of the target file currently output by the update queue and the update text data; the target key-value pair query submodule is used for querying target key-value pair data with a target file serial number in the split copy data table; and the text data replacement sub-module is used for replacing the text data stored by the value data of the target key-value pair data with the updated text data.
In one embodiment, the text object matching module 13 includes: the split data acquisition submodule is used for acquiring all text data and storage position serial numbers thereof in the split copy data table; and the text file generation submodule is used for generating a new text file and sequentially storing the text data into the text file according to the storage position serial number of each text data.
In another embodiment, the text object matching module 13 further includes: the composition format determining submodule is used for acquiring target text data to be matched currently in a newly generated text file and determining a data composition format of the target text data, wherein the data composition format refers to the data type and the data separator of each text in the text data; the target class object determining submodule is used for determining a target class object of which the class object matching rule is matched with the data composition format and taking target text data as reference text data of the target class object; and the text data distribution submodule is used for matching class objects corresponding to the text data in the text file by analogy, and distributing the text data into reference text data of the corresponding class objects.
In order to solve the above technical problem, an embodiment of the present application further provides a computer device, configured to run a computer program implemented according to the file data updating method. Referring to fig. 9, fig. 9 is a block diagram of a basic structure of a computer device according to the present embodiment.
As shown in fig. 9, the internal structure of the computer device is schematically illustrated. The computer device includes a processor, a non-volatile storage medium, a memory, and a network interface connected by a system bus. The non-volatile storage medium of the computer device stores an operating system, a database and computer readable instructions, the database can store control information sequences, and the computer readable instructions can enable a processor to realize a file data updating method when being executed by the processor. The processor of the computer device is used for providing calculation and control capability and supporting the operation of the whole computer device. The memory of the computer device may have stored therein computer readable instructions which, when executed by the processor, cause the processor to perform a file data update method. The network interface of the computer device is used for connecting and communicating with the terminal. Those skilled in the art will appreciate that the architecture shown in fig. 9 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In this embodiment, the processor is configured to execute specific functions of each module/sub-module in the file data update apparatus of the present application, and the memory stores program codes and various types of data required for executing the modules. The network interface is used for data transmission to and from a user terminal or a server. The memory in this embodiment stores program codes and data necessary for executing all modules/sub-modules in the file data update apparatus, and the server can call the program codes and data of the server to execute the functions of all sub-modules.
The present application also provides a non-volatile storage medium, wherein the file data updating method is written as a computer program, and the computer program is stored in the storage medium in the form of computer readable instructions, and when the computer readable instructions are executed by one or more processors, the program is executed in a computer, so that the one or more processors execute the steps of the file data updating method of any one of the embodiments.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the computer program is executed. The storage medium may be a non-volatile storage medium such as a magnetic disk, an optical disk, a Read-Only Memory (ROM), or a Random Access Memory (RAM).
In summary, the present application can split a large file acting on a class object into multiple subfiles for monitoring and updating, ensure data consistency of data of the file during updating, and efficiently match corresponding data for various classes of objects after updating.
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein. Moreover, at least a portion of the steps in the flow chart of the figure may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
Those of skill in the art will appreciate that the various operations, methods, steps in the processes, acts, or solutions discussed in this application can be interchanged, modified, combined, or eliminated. Further, various operations, methods, steps, measures, schemes in the various processes, methods, procedures that have been discussed in this application may be alternated, modified, rearranged, decomposed, combined, or eliminated. Further, steps, measures, schemes in the prior art having various operations, methods, procedures disclosed in the present application may also be alternated, modified, rearranged, decomposed, combined, or deleted.
The foregoing is only a partial embodiment of the present application, and it should be noted that, for those skilled in the art, several modifications and decorations can be made without departing from the principle of the present application, and these modifications and decorations should also be regarded as the protection scope of the present application.

Claims (10)

1. A file data updating method is characterized by comprising the following steps:
monitoring text data stored in a plurality of split files corresponding to a source text file, responding to a data updating event acting on any split file, correspondingly storing a file serial number of the split file and updated text data into an updating queue, and dispersedly storing all the text data of the source text file into each split file according to a file splitting rule;
acquiring a file serial number output by the updating queue and updating text data thereof, replacing original text data corresponding to the file serial number in a split copy data table with the updating text data, wherein the split copy data table stores mapping relation data formed by the file serial numbers of the split files and the text data thereof;
and merging all the text data in the split copy data table to generate a new text file, and matching a class object corresponding to each text data in the text file according to a class object matching rule.
2. The method according to claim 1, wherein the step of storing all text data of the source text file into each split file according to the file splitting rule in a scattered manner comprises the following steps:
responding to a file splitting instruction acting on a source text file, and determining the target splitting number corresponding to the instruction;
determining a storage position serial number of text data to be split in a source text file, performing remainder calculation on the storage position serial number and a target splitting number, and storing the text data to be split into a split file with a file serial number as a remainder of a calculation result;
and in such a way, storing each text data in the source text file into the corresponding split text.
3. The method according to claim 1, wherein the step of storing mapping relationship data composed of the file serial number and the text data of each split file in the split copy data table comprises the following steps:
determining the file serial number of each split file corresponding to the current source text file, and acquiring the text data of each split file;
using each file serial number as a key identification, using text data corresponding to the file serial numbers as value data, and generating a plurality of key value pair data consisting of the file serial numbers and the text data thereof;
and storing each key-value pair data into the split copy data table.
4. The method according to claim 1, wherein the step of obtaining the file serial number and the updated text data thereof output by the update queue and replacing the original text data corresponding to the file serial number in the split-copy data table with the updated text data comprises the steps of:
acquiring a target file serial number and update text data currently output by the update queue;
inquiring target key value pair data with a target file sequence number in the split copy data table;
replacing the text data stored by the value data of the target key-value pair data with the updated text data.
5. The method according to claim 1, wherein the step of merging all the text data in the split-copy data table to generate a new text file comprises the following steps:
acquiring all text data and storage position serial numbers thereof in the split copy data table;
and generating a new text file, and sequentially storing the text data into the text file according to the storage position serial number of each text data.
6. The method according to claim 1, wherein the step of matching the class object corresponding to each text data in the text file according to the class object matching rule comprises the following steps:
acquiring target text data to be matched currently in a newly generated text file currently, and determining a data composition format of the target text data, wherein the data composition format refers to a data type and a data separator of each text in the text data;
determining a target class object of which the class object matching rule is matched with the data composition format, and taking target text data as reference text data of the target class object;
and matching class objects corresponding to the text data in the text file by analogy, and distributing the text data as reference text data of the class objects corresponding to the text data.
7. A file data updating apparatus, comprising:
the updated text acquisition module is used for monitoring text data stored in a plurality of split files corresponding to a source text file, responding to a data updating event acting on any split file, correspondingly storing a file serial number of the split file and the updated text data into an updating queue, and dispersedly storing all the text data of the source text file into each split file according to a file splitting rule;
the text data updating module is used for acquiring the file serial number output by the updating queue and updating text data thereof, replacing original text data corresponding to the file serial number in a split copy data table with the updating text data, and storing mapping relation data formed by the file serial number of each split file and the text data thereof in the split copy data table;
and the text object matching module is used for combining all the text data in the split copy data table to generate a new text file and matching the class object corresponding to each text data in the text file according to the class object matching rule.
8. An electronic device comprising a central processor and a memory, characterized in that the central processor is configured to invoke execution of a computer program stored in the memory to perform the steps of the method according to any one of claims 1 to 6.
9. A non-volatile storage medium, characterized in that it stores, in the form of computer-readable instructions, a computer program implemented according to the method of any one of claims 1 to 6, which, when invoked by a computer, performs the steps comprised by the method.
10. A computer program product comprising computer program/instructions, characterized in that the computer program/instructions, when executed by a processor, implement the steps of the method of any one of claims 1 to 6.
CN202210918216.0A 2022-08-01 2022-08-01 File data updating method and device, equipment, medium and product thereof Pending CN115237446A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210918216.0A CN115237446A (en) 2022-08-01 2022-08-01 File data updating method and device, equipment, medium and product thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210918216.0A CN115237446A (en) 2022-08-01 2022-08-01 File data updating method and device, equipment, medium and product thereof

Publications (1)

Publication Number Publication Date
CN115237446A true CN115237446A (en) 2022-10-25

Family

ID=83676864

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210918216.0A Pending CN115237446A (en) 2022-08-01 2022-08-01 File data updating method and device, equipment, medium and product thereof

Country Status (1)

Country Link
CN (1) CN115237446A (en)

Similar Documents

Publication Publication Date Title
CN108510082B (en) Method and device for processing machine learning model
CN104573115B (en) Support the realization method and system of the integrated interface of multi-type database operation
US9619491B2 (en) Streamlined system to restore an analytic model state for training and scoring
CN101385017B (en) Partial item change tracking and synchronization
US20170063965A1 (en) Data transfer in a collaborative file sharing system
US20170064027A1 (en) Data caching in a collaborative file sharing system
CN111143382B (en) Data processing method, system and computer readable storage medium
CN103473696A (en) Method and system for collecting, analyzing and distributing internet business information
CN106681820B (en) Extensible big data computing method based on message combination
CN112069265A (en) Configuration data synchronization method, service data system, computer system and medium
WO2013175495A2 (en) A system and a method for reasoning and running continuous queries over data streams
CN111966692A (en) Data processing method, medium, device and computing equipment for data warehouse
KR101950050B1 (en) Scale-out system to acquire event data
CN113961643A (en) Search engine updating method and device, equipment, medium and product thereof
CN109586970A (en) Resource allocation methods, apparatus and system
CN111338717B (en) Interface calling method, application program upgrading method, server and client
CN112732663A (en) Log information processing method and device
CN111858617A (en) User searching method and device, computer readable storage medium and electronic equipment
CN116521664A (en) Data monitoring method and device for data warehouse, computing equipment and storage medium
CN115237446A (en) File data updating method and device, equipment, medium and product thereof
CN114647702A (en) Data synchronous processing method and device, equipment and medium thereof
WO2023096731A1 (en) Detect anomalous container deployment at a container orchestration service
CN115712677A (en) Search data synchronization method and device, equipment, medium and product thereof
CN114661726A (en) Data type mapping processing method and device, equipment, medium and product thereof
CN114756301A (en) Log processing method, device and system

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