CN113377716B - File acquisition method, electronic equipment, chip and storage medium - Google Patents

File acquisition method, electronic equipment, chip and storage medium Download PDF

Info

Publication number
CN113377716B
CN113377716B CN202110719429.6A CN202110719429A CN113377716B CN 113377716 B CN113377716 B CN 113377716B CN 202110719429 A CN202110719429 A CN 202110719429A CN 113377716 B CN113377716 B CN 113377716B
Authority
CN
China
Prior art keywords
folder
storage area
files
file
preset storage
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
CN202110719429.6A
Other languages
Chinese (zh)
Other versions
CN113377716A (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.)
Spreadtrum Communications Tianjin Co Ltd
Original Assignee
Spreadtrum Communications Tianjin 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 Spreadtrum Communications Tianjin Co Ltd filed Critical Spreadtrum Communications Tianjin Co Ltd
Priority to CN202110719429.6A priority Critical patent/CN113377716B/en
Publication of CN113377716A publication Critical patent/CN113377716A/en
Application granted granted Critical
Publication of CN113377716B publication Critical patent/CN113377716B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application provides a file acquisition method, a chip, electronic equipment and a storage medium, wherein the file acquisition method is applied to first electronic equipment, and the method comprises the following steps: establishing a first folder and a second folder; mounting a preset storage area of second electronic equipment to the first folder, copying one or more first files in the preset storage area to a second folder, and judging whether the one or more first files in the preset storage area are updated or not based on the first folder; and adjusting the first files in the second folder based on the one or more first files in the preset storage area, and updating the local test files regularly or in real time by the method.

Description

File acquisition method, electronic equipment, chip and storage medium
Technical Field
The present application relates to the field of storage technologies, and in particular, to a file obtaining method, an electronic device, a chip, and a storage medium.
Background
In the prior art, some test tasks in the machine need to be tested through a test script. The test scripts are typically maintained by a test file server, where the scripts may be updated over a period of time. Therefore, the present machine needs to download the test script from the test server before testing the test task, for example, by copying the test script from the file server through the SCP software. However, when the network speed is low or the server configuration is low, the downloading time of the test script may be extremely long, so that the task test can be performed only after a long time, which takes a lot of time.
Disclosure of Invention
In a first aspect, the present application provides a file obtaining method, which is applied to a first electronic device, and includes:
establishing a first folder and a second folder;
mounting a preset storage area of the second electronic equipment to the first folder, copying one or more first files in the preset storage area to the second folder,
judging whether one or more first files in a preset storage area are updated or not based on the first folder;
and adjusting the first files in the second folder based on one or more first file updates in the preset storage area.
In an embodiment of the present application, after copying one or more first files in the preset storage area to the second folder, the method further includes:
and recording first information of the first folder at a first moment, wherein the first moment is the time when one or more first files are copied to the second folder.
In an embodiment of the application, determining whether one or more first files in a preset storage area are updated based on a first folder includes:
acquiring second information of the first folder at the current moment;
and comparing the first information with the second information, and judging whether one or more first files in the preset storage area are updated or not based on the comparison result.
In one embodiment of the application, the first information includes a directory tree structure of the first folder at a first time, and the second information includes a directory tree structure of the first folder at a current time.
In one embodiment of the present application, adjusting one or more first files in a second folder comprises:
and downloading one or more second files from a preset storage area and/or deleting one or more first files in the second folder based on the first information and the second information.
In one embodiment of the present application, the second folder is located on the first electronic device; alternatively, the second folder is located on a third electronic device.
In a second aspect, the present application provides a chip comprising
The establishing module is used for establishing a first folder and a second folder;
the system comprises a mounting module and a first copying module, wherein the mounting module is used for mounting a preset storage area of second electronic equipment to a first folder, and the first copying module is used for copying one or more first files in the preset storage area to a second folder;
the judging module is used for judging whether one or more first files in the preset storage area are updated or not based on the first folder;
and the second copying module is used for adjusting the first files in the second folder based on one or more first file updates in the preset storage area.
In one embodiment of the application, the chip further comprises a recording module for
First information of the first folder at a first moment is recorded, wherein the first moment is the time when one or more first files are copied to the second folder.
In one embodiment of the present application, the determining module is further configured to
Acquiring second information of the first folder at the current moment;
and comparing the first information with the second information, and judging whether one or more first files in the preset storage area are updated or not based on the comparison result.
In a third aspect, the present application provides an electronic device, where the electronic device further includes a processor and a storage device, where the storage device stores program instructions, and the program instructions, when executed by the processor, cause the electronic device to execute the obtaining method of the first aspect.
In a fourth aspect, the present application provides a computer-readable storage medium comprising computer instructions which, when run on a computer device, cause the computer device to perform the acquisition method of the first aspect.
Drawings
Fig. 1A to fig. 1B are exemplary diagrams of usage scenarios of a file acquisition method provided in an embodiment of the present application;
fig. 2 is a flowchart of a file acquisition method according to an embodiment of the present application;
FIG. 3 is a flowchart of a file retrieval method according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an electronic device 4 according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application. Wherein in the description of the embodiments of the present application, "/" indicates an inclusive meaning, for example, a/B may indicate a or B; "and/or" herein is merely an association describing an associated object, and means that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone.
In the following, the terms "first", "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the embodiments of the present application, "a plurality" means two or more unless otherwise specified.
In the prior art, some test tasks in the machine need to be tested through a test script. The test scripts are typically maintained by a test file server, where the scripts may be updated over a period of time. Therefore, the present machine needs to download the test script from the test server before testing the test task, for example, by copying from the test file server through the SCP software. However, when the network speed is low or the server configuration is low, the downloading time of the test script may be extremely long, so that the task test can be performed only after a long time, which consumes a lot of time and greatly affects the development efficiency.
In order to solve the technical problem, at least one first folder is created in the local computer, and then the storage path of the test file server is mounted to the first folder, so that accessing the first folder is equivalent to accessing the storage location of the test script in the test file server. Further, based on the first folder, whether the test file such as the test script is updated or not can be obtained, and when the test file is updated, the updated test file can be downloaded from the test file server to the second folder, where the second folder may be a folder in the local computer or a folder in another device.
Referring to fig. 1A to fig. 1B, diagrams of usage scenarios of a file acquisition method according to an embodiment of the present application are shown.
Three electronic devices are shown in fig. 1, specifically a first electronic device 102, a second electronic device 104, and an electronic device 112. The first electronic device 102, the second electronic device 104, and the electronic device 112 may communicate with each other. The second electronic device 104 includes a preset storage area, and the preset storage area may store one or more second files, for example, a second file 1, a second file 2, and a second file 3. The second file may illustratively comprise a test file or a test script, or the like.
A first folder 106 and a second folder 108 may be included in the first electronic device 102. Further, the preset memory area of the second electronic device 104 may be mounted to the first folder 106. It can be understood that after the preset storage area of the second electronic device is mounted in the first folder 106, the first folder 106 is associated with the preset storage area, and the user accesses the first folder in the first electronic device 102, which is equivalent to accessing the preset storage area. That is, the first electronic device 102 may determine whether the file in the preset storage area is changed by accessing the first folder 106. For example, the first electronic device 102 may determine whether files in the storage area have been updated, whether any files have been deleted, etc. by polling the contents of the first folder 106. It is understood that when files in the storage area are increased or decreased, the first folder is modified, and the file directory structure may be changed. Exemplarily, it is assumed that the second file 1 in the preset storage area further includes a first subfile, and if the first subfile is deleted, the directory structure of the file in the storage area is inevitably changed, and the content and the directory structure of the first folder are also changed equivalently.
Further, referring to fig. 1A, in an embodiment of the present application, at a first time, the second electronic device 104 stores one or more second files in a preset storage area. At the second time, the first electronic device 102 may start to copy and acquire one or more second files, for example, the second file 1, in the preset storage area from the preset storage area of the second electronic device 104, and store the one or more second files in the second folder 108. At a third time, the second electronic device completes the operation of storing one or more second files in the second folder 108, and the first electronic device records the third time as the modification time of the first folder, and determines and records the directory structure of the first folder at the third time according to the content of the files in the preset storage area.
In another embodiment of the present application, at a first time, the second electronic device 104 stores one or more second files shown in fig. 1A in a preset storage area. At a second time, the first electronic device 102 may cause the third electronic device to start copying one or more second files, e.g., second file 1, in the preset storage area from the preset storage area of the second electronic device 104 and store the one or more second files in the second folder 110 in the third electronic device 112. At a third time, the second electronic device completes the operation of storing one or more second files in the second folder. The first electronic device 102 records the third time as the modification time of the first folder, and determines and records the directory structure of the first folder at the third time according to the content of the file in the preset storage area. In one embodiment of the present application, the above-mentioned storing action of the third electronic device 112 may be performed based on an indication of the first electronic device 102.
In one example, the first electronic device 102 may cause the third electronic device to start to copy and acquire one or more second files in a preset storage area from the preset storage area of the second electronic device 104 by sending a control message to the third electronic device. Or, in another example, the first electronic device 102 may cause the second electronic device 104 to transmit one or more second files of the preset storage area to the third electronic device 112 by transmitting a control message to the second electronic device.
In one embodiment, the copy-to-store operation may be understood as a download operation.
Further, in one embodiment, referring to fig. 1B, at a fourth time, on the basis of fig. 1A, the second electronic device 104 deletes the second file 1 and the second file 2 in the preset storage area and stores the first file 1. It can be understood that, at this time, the files in the preset storage area are modified, and the directory structure of the files in the preset storage area is changed, that is, the directory structure of the first folder 106 is also changed.
In one embodiment, the first electronic device may poll whether the content in the first folder has been modified. Illustratively, at a fifth time, the first electronic device queries whether the content in the first folder has been modified. Specifically, at the fifth time, the first electronic device may obtain the directory structure of the first folder at the fifth time, and compare the directory structure of the first folder at the third time with the directory structure of the first folder at the fifth time, if the directory structures are different, the first electronic device may determine that, after the third time, the file in the preset storage area of the second electronic device has changed, and the first electronic device 102 updates the file in the second folder based on the directory structure of the file at the fifth time under the first folder (i.e., under the preset storage area). Illustratively, referring to fig. 1B, at the fifth time, the files in the preset storage area are the first file 1 and the second file, and the first electronic device may delete the second file 1 and the second file 2 acquired by the second folder 108 at the third time and acquire the first file 1 from the preset storage area. It is to be understood that, in the above example, the directory structure of the first folder in the fourth time and the fifth time is the same. In the above example, the first time, the second time, the third time, the fourth time, and the fifth time are chronologically consecutive times.
In one embodiment, the first electronic device 102 can poll whether the content in the first folder has been modified. Illustratively, at a fifth time, the first electronic device queries whether the content in the first folder has been modified. Specifically, at the fifth time, the first electronic device may obtain the directory structure of the first folder at the fifth time, and compare the directory structure of the first folder at the third time with the directory structure of the first folder at the fifth time, if the directory structures are different, the first electronic device may determine that the file in the preset storage area of the second electronic device has changed after the third time, and the first electronic device 102 may update the file of the second folder 110 in the third electronic device 112 based on the directory structure of the file at the fifth time under the first folder (i.e., under the preset storage area). For example, referring to fig. 1B, at the fifth time, the files in the preset storage area are the first file 1 and the second file 3, and the third electronic device may delete the second file 1 and the second file 2 acquired by the second folder 110 in the third electronic device at the third time, and acquire the first file 1 from the preset storage area. For example, the first electronic device may delete the second file 1 and the second file 2 acquired by the second folder 110 at the third time in the third electronic device by sending a control message to the third electronic device, and acquire the first file 1 from the preset storage area.
As can be seen from the above, the first electronic device may compare information (such as modification time and directory structure) of the first folder at different times to determine whether the files in the preset storage area are updated.
Referring to fig. 2, a flowchart of a file obtaining method provided in an embodiment of the present application may be applied to the first electronic device 102, and the method specifically includes:
in step 202, the first electronic device 102 establishes a first folder 106 and a second folder 108.
In step 204, the first electronic device 102 mounts the preset storage area of the second electronic device 104 to the first folder 106.
In step 206, the first electronic device 102 establishes the second folder 108 in the first electronic device 102, or establishes the second folder 110 in the third electronic device.
At the mth moment, the first electronic device 102 copies the file (the preset storage area) in the first folder 106 to the second folder 108 or to the second folder 110, step 208.
In step 210, the second folder 110 records the modification time (mth time) of the first folder and the file directory structure at the mth time.
Step 212 polls whether the modification time and file directory structure of the first folder has changed.
If a change occurs, the contents of the second file are updated based on the contents of the first folder, step 214.
Referring to fig. 3, a flowchart of a file obtaining method provided in an embodiment of the present application may be applied to the first electronic device 102, and the method specifically includes:
step 302, establishing a first folder and a second folder;
step 304, mounting a preset storage area of a second electronic device to the first folder, and copying one or more first files in the preset storage area to a second folder,
step 306, judging whether one or more first files in the preset storage area are updated or not based on the first folder;
step 308, adjusting the first file in the second folder based on the one or more first file updates in the preset storage area.
Referring to fig. 4, a schematic structural diagram of an electronic device 4 according to an embodiment of the present application is provided.
The present invention proposes that the method for sending voice data can be applied to the electronic device 4, and the electronic device 4 includes, but is not limited to, the processor 11 and the memory 12. Those skilled in the art will appreciate that fig. 4 is merely an example of an electronic device and does not constitute a limitation of the electronic device 4 and may include more or fewer components than shown, or combine certain components, or different components, e.g., the electronic device 4 may also include input-output devices, network access devices, buses, etc.
The Processor 11 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The storage 12 may be an internal storage unit of the electronic device 4, such as a hard disk or a memory of the electronic device 4. The memory 12 may also be an external storage device of the electronic device 4, such as a plug-in hard disk provided on the electronic device 4, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like. Further, the memory 12 may also include both an internal storage unit and an external storage device of the electronic device 4. The memory 12 is used for storing computer programs and other programs and data required by the electronic device 4. The memory 12 may also be used to temporarily store data that has been output or is to be output.
In one embodiment, the electronic device may further include a display screen for displaying images, videos, etc., and may also be used to accept user input data. The display screen includes a display panel. The display panel may be a Liquid Crystal Display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (active-matrix organic light-emitting diode, AMOLED), a flexible light-emitting diode (FLED), a miniature, a Micro-oeld, a quantum dot light-emitting diode (QLED), or the like. In some embodiments, electronic device 4 may include 1 or N display screens, with N being a positive integer greater than 1.

Claims (11)

1. A file acquisition method is applied to first electronic equipment, and comprises the following steps:
establishing a first folder and a second folder;
mounting a preset storage area of second electronic equipment to the first folder, and copying one or more first files in the preset storage area to the second folder;
judging whether one or more first files in the preset storage area are updated or not based on the first folder;
adjusting the first file in the second folder based on the one or more first file updates in the preset storage area.
2. The obtaining method according to claim 1, wherein after copying the one or more first files in the preset storage area to the second folder, the obtaining method further comprises:
recording first information of a first time when the first file folder is copied to the second file folder, wherein the first time is the time when the one or more first files are copied to the second file folder.
3. The method according to claim 2, wherein the determining whether one or more first files in the preset storage area are updated based on the first folder includes:
acquiring second information of the first folder at the current moment;
and comparing the first information with the second information, and judging whether one or more first files in the preset storage area are updated or not based on the comparison result.
4. The method according to claim 3, wherein the first information includes a directory tree structure of the first folder at the first time, and the second information includes a directory tree structure of the first folder at the current time.
5. The method according to claim 3 or 4, wherein the adjusting one or more first files in the second folder comprises:
and downloading one or more second files from the preset storage area and/or deleting one or more first files in the second folder based on the first information and the second information.
6. The acquisition method according to claim 3, wherein the second folder is located in the first electronic device; or the second folder is located on a third electronic device.
7. A chip is characterized by comprising
The establishing module is used for establishing a first folder and a second folder;
the system comprises a mounting module and a first copying module, wherein the mounting module is used for mounting a preset storage area of second electronic equipment to the first folder, and the first copying module is used for copying one or more first files in the preset storage area to a second folder;
the judging module is used for judging whether one or more first files in the preset storage area are updated or not based on the first folder;
a second copying module, configured to adjust the first file in the second folder based on the one or more first file updates in the preset storage area.
8. Chip according to claim 7, characterized in that it further comprises a recording module for
Recording first information of a first time when the first file folder is copied to the second file folder, wherein the first time is the time when the one or more first files are copied to the second file folder.
9. The chip of claim 8, wherein the determining module is further configured to determine whether the chip is a power supply
Acquiring second information of the first folder at the current moment;
and comparing the first information with the second information, and judging whether one or more first files in the preset storage area are updated or not based on a comparison result.
10. An electronic device, further comprising a processor and a storage device, the storage device storing program instructions that, when executed by the processor, cause the electronic device to perform the acquisition method of any one of claims 1-6.
11. A computer-readable storage medium comprising computer instructions that, when executed on a computer device, cause the computer device to perform the acquisition method of any one of claims 1-6.
CN202110719429.6A 2021-06-28 2021-06-28 File acquisition method, electronic equipment, chip and storage medium Active CN113377716B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110719429.6A CN113377716B (en) 2021-06-28 2021-06-28 File acquisition method, electronic equipment, chip and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110719429.6A CN113377716B (en) 2021-06-28 2021-06-28 File acquisition method, electronic equipment, chip and storage medium

Publications (2)

Publication Number Publication Date
CN113377716A CN113377716A (en) 2021-09-10
CN113377716B true CN113377716B (en) 2023-01-31

Family

ID=77579452

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110719429.6A Active CN113377716B (en) 2021-06-28 2021-06-28 File acquisition method, electronic equipment, chip and storage medium

Country Status (1)

Country Link
CN (1) CN113377716B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103731508A (en) * 2014-01-23 2014-04-16 易桂先 Cloud-storage-based network hard disk device and management method thereof
CN106559392A (en) * 2015-09-28 2017-04-05 北京神州泰岳软件股份有限公司 A kind of file sharing method, device and system
CN108776680A (en) * 2018-05-31 2018-11-09 郑州云海信息技术有限公司 A kind of KVM and its one key hanging method of file, device, equipment, medium
CN110795278A (en) * 2018-08-03 2020-02-14 Emc Ip控股有限公司 System and method for providing file level recovery
CN112988665A (en) * 2019-12-17 2021-06-18 英属维京群岛商联存***股份有限公司 Method for copying and archiving data of storage device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103731508A (en) * 2014-01-23 2014-04-16 易桂先 Cloud-storage-based network hard disk device and management method thereof
CN106559392A (en) * 2015-09-28 2017-04-05 北京神州泰岳软件股份有限公司 A kind of file sharing method, device and system
CN108776680A (en) * 2018-05-31 2018-11-09 郑州云海信息技术有限公司 A kind of KVM and its one key hanging method of file, device, equipment, medium
CN110795278A (en) * 2018-08-03 2020-02-14 Emc Ip控股有限公司 System and method for providing file level recovery
CN112988665A (en) * 2019-12-17 2021-06-18 英属维京群岛商联存***股份有限公司 Method for copying and archiving data of storage device

Also Published As

Publication number Publication date
CN113377716A (en) 2021-09-10

Similar Documents

Publication Publication Date Title
US10712915B2 (en) Information presentation using a client on a terminal
US11010227B2 (en) Exception stack information acquisition method and device and computer-readable storage medium
CN111475180A (en) Method and system for updating client cache
US20230084369A1 (en) Configuration updating method and apparatus, device and storage medium
CN109240727A (en) Application program update method, apparatus, computer equipment and storage medium
CN107644075B (en) Method and device for collecting page information
CN108536617B (en) Cache management method, medium, system and electronic device
CN111930706B (en) Remote call-based distributed network file storage system and method
CN112433920A (en) Buried point data reporting method, device, equipment and medium
CN110781149A (en) Method, device, equipment and storage medium for managing live broadcast room information
CN112948409A (en) Data processing method and device, electronic equipment and storage medium
CN110765394A (en) So file loading method and device, storage medium and terminal equipment
CN110990346A (en) File data processing method, device, equipment and storage medium based on block chain
CN112965761A (en) Data processing method, system, electronic equipment and storage medium
CN114791961A (en) Media data processing method and device and terminal equipment
CN110865981A (en) File access method for mobile terminal and mobile terminal thereof
CN113377716B (en) File acquisition method, electronic equipment, chip and storage medium
CN110795495A (en) Data processing method and device, electronic equipment and computer readable medium
CN113986679A (en) Performance analysis method and device based on configuration information hot loading
CN113407376A (en) Data recovery method and device and electronic equipment
CN108616603B (en) Method and system for synchronizing internal and external network data
CN113608831B (en) Plug-in instance management method, system, storage medium and equipment
CN114117280A (en) Page static resource using method and device, terminal equipment and storage medium
CN112685071A (en) Application program repairing method, device, equipment and storage medium
CN111382203A (en) Plug-in based data synchronization method and device and storage medium

Legal Events

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