Data processing method and device based on PYQT5

Through the data processing method based on PYQT5, the problem of unable to respond in real time to the version release is solved, the timely acquisition of the server plug-in content and the update of the database are realized, and the integration and intelligence of the system are improved.

CN118760425APending Publication Date: 2024-10-11CHINA FAW CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410756268.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-12
Publication Date
2024-10-11

AI Technical Summary

Technical Problem

In the existing technology, version release cannot respond in real time, is low in integration and intelligence, and cannot obtain plug-in content updated by the server in a timely manner.

Method used

Provide a data processing method based on PYQT5, by receiving request information, including query, download and optimization information, sending requests to the cloud or local server, parsing and updating the database, using the QTableWidget module of PYQT5 to display data, and saving and Delete plug-in information.

Benefits of technology

It achieves real-time response to version releases, improves the integration and intelligence of the system, and ensures timely updates of the database.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118760425A_ABST
    Figure CN118760425A_ABST
Patent Text Reader

Abstract

The invention discloses a data processing method and device based on PYQT5. The method comprises the steps that request information is received, the request information comprises at least one of query request information, downloading request information and optimization request information, the query request information is used for querying target information based on a preset query condition, the downloading request information is used for requesting a server to download a preset plug-in, and the optimization request information is used for optimizing the preset plug-in; the request optimization information is used for requesting to add a plug-in in a database, and the server comprises at least one of a cloud server and a local server; in response to the request information, under the condition that the target file is determined to be obtained, a current database is updated based on the target file, a target database is obtained, the target file comprises at least one of target data and a target plug-in, the target data is used for displaying the query result to the target object, and the target plug-in is used for updating the database. The technical problems that version release cannot be responded in real time, and integration and intelligence are low are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of platform software development, and in particular to a data processing method and device based on PYQT5. Background Art

[0002] PYQT5 is a graphical user interface toolkit based on the Python programming language. It is a Python binding for the QT library. Using PYQT5, you can easily develop cross-platform desktop applications. It is powerful, easy to learn and use, suitable for developing desktop applications, and has cross-platform support and rich functions, making it a good choice for Python developers to develop graphical interface applications.

[0003] At present, the new version release in the existing technology is mainly based on email notification and uploading to the system, which cannot respond to the version release output in real time, for example, it is not possible to obtain the updated plug-in content from the server in time.

[0004] Currently, no effective solution has been proposed to address the issues of the above version releases being unable to respond in real time and having low integration and intelligence. Summary of the invention

[0005] The embodiment of the present invention provides a data processing method and device based on PYQT5, so as to at least solve the problem that version release cannot respond in real time and has low integration and intelligence.

[0006] According to one aspect of an embodiment of the present invention, a data processing method based on PYQT5 is provided, comprising: receiving request information, wherein the request information comprises at least one of the following: requesting query information, requesting download information and requesting optimization information, the requesting query information is used to query target information based on preset query conditions, the requesting download information is used to request downloading of preset plug-ins from a server, the requesting optimization information is used to request adding plug-ins in a database, the server comprises at least one of a cloud server and a local server; in response to the request information, when it is determined that a target file is obtained, updating a current database based on the target file to obtain a target database, wherein the target file comprises at least one of the following: target data and a target plug-in, the target data is used to display query results to a target object, and the target plug-in is used to update the database.

[0007] Optionally, in response to the request information, a target file is obtained, and before the current database is updated based on the target file, the process includes: upon determining that the received request information is a request for query information, judging the type of the request for query information, wherein the types of the request for query information include request for cloud query and request for local query; upon determining that the type of the request for query information is a request for cloud query, using the request module to send a cloud request for query instruction to a cloud server in the server; in response to the cloud request for query instruction, obtaining json format data, using the loads method of the json library to parse the json format data, and obtaining a Dictionary data type that satisfies python; using the setItem method of the QTableWidget module of PYQT5 to assign the Dictionary data type to the table at the first target position, and obtaining the target data of the target data file.

[0008] Optionally, the data processing method includes: when it is determined that the received request information is a request for a local query, using the session.query.filter method to query the database based on preset query conditions to obtain local query information in the target data file; using the setItem method of the QTableWidget module to refresh the target interface based on the local query information.

[0009] Optionally, in response to the request information, the target file is obtained, and the current database is updated based on the target file, including: in response to the request information being a request for download information, wherein the request for download information is used to request the cloud server to download the target plug-in, and using the request module to initiate a request to the cloud server; obtaining the json format data returned by the cloud server, using the loads method of the json library to parse the json format data into a python Dictionary data type, using the BytesIO library to read and write the parsed python Dictionary data type into binary data in memory, obtaining the binary data file in the target file, and then using the Python file (File) write() method to download the binary data file to a second target location, and finally using the session.add method of the sqlalchemy library to save the binary data file located at the second target location to the database.

[0010] Optionally, in response to the request information, the target file is obtained, and the current database is updated based on the target file to obtain the target database, including: in response to the request information being a request for optimization information, the type of the request for optimization information is determined, wherein the type of the request for optimization information includes a request for adding a database plug-in class and a request for deleting a database plug-in class; when it is determined that the type of the request for optimization information is a request for adding a database plug-in class, a local file selection box is popped up using the QFileDialog component to select the plug-in to be added, the plug-in information to be added in the target file is obtained, and the session.add method of the sqlalchemy library is used to save the plug-in information to be added to the database to obtain the target database. Then the session.query method is used to query all the plug-in information in the database, and finally the setItem method of the QTableWidget module is used to refresh the target interface.

[0011] Optionally, the data processing method includes: when it is determined that the type of optimization information requested is a request to delete a database plug-in class, using the shutil.rmtree method to delete the plug-in to be deleted at the third target location, using the session.query.filter.delete method to delete the records in the database, and then using the session.query method to query all plug-in information in the database, and finally using the setItem method of the QTableWidget module to refresh the target interface and obtain the target database.

[0012] Optionally, the data processing method also includes: detecting file information of the cloud server; based on the file information, determining that the cloud server has received a new file, generating a download instruction; and downloading the new file from the cloud server to the local computer based on the download instruction.

[0013] Optionally, the data processing method further includes: when it is determined that the newly added file in the cloud server is to be downloaded locally, generating a reminder message, the reminder message being used to remind the target object that the newly added file in the cloud server has been downloaded successfully.

[0014] According to another aspect of an embodiment of the present invention, a data processing device is also provided, including: a receiving module, used to receive request information, wherein the request information includes at least one of the following: request query information, request download information and request optimization information, the request query information is used to query target information based on preset query conditions, the request download information is used to request to download a preset plug-in from a server, and the request optimization information is used to request to add a plug-in in a database, the server includes at least one of a cloud server and a local server; a response module, used to update the current database based on the target file in response to the request information to obtain the target database based on the target file when it is determined that the target file is obtained, wherein the target file includes at least one of the following: target data and a target plug-in, the target data is used to display the query results to the target object, and the target plug-in is used to update the database.

[0015] According to another embodiment of the present invention, a non-volatile storage medium is also provided, and the non-volatile storage medium includes a stored program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute the above-mentioned data processing method based on PYQT5.

[0016] According to another aspect of an embodiment of the present invention, a computer program product is provided, including a computer program, which implements the steps of the above-mentioned PYQT5-based data processing method when executed by a processor.

[0017] In the technical solution of the present invention, a request message is received, wherein the request message includes at least one of the following: request query information, request download information and request optimization information, the request query information is used to query target information based on preset query conditions, the request download information is used to request to download preset plug-ins from a server, and the request optimization information is used to request to add plug-ins in a database, and the server includes at least one of a cloud server and a local server; in response to the request information, when it is determined that a target file is obtained, the current database is updated based on the target file to obtain a target database, wherein the target file includes at least one of the following: target data and a target plug-in, the target data is used to display query results to the target object, and the target plug-in is used to update the database. The data processing method based on PYQT5 can be used to obtain plug-in information in the server in a timely manner, so as to update the database in a timely manner.

[0018] The technical solution of the present application also solves the problem that version release cannot respond in real time and the low-tech problems of integration and intelligence. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0020] Figure 1 is a flowchart of a data processing method based on PYQT5 according to an optional embodiment of an embodiment of the present invention;

[0021] Figure 2 is a structural block diagram of a data processing device based on PYQT5 according to an optional embodiment of an embodiment of the present invention;

[0022] Figure 3 It is a structural block diagram of an embodiment of a data processing device based on PYQT5 to implement plug-in management according to an optional embodiment of the embodiment of the present invention. DETAILED DESCRIPTION

[0023] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0025] First, some nouns or terms that appear in the description of the prior art and the embodiments of the present application are subject to the following explanations:

[0026] PYQT5: A Python library for creating desktop applications, based on the Python bindings for the Qt library.

[0027] Qt: A cross-platform C++ application development framework used to develop various applications such as graphical user interfaces, network applications, database connections, XML processing multithreading, etc.

[0028] Request module: A module in Python used to send HTTP requests to obtain data from the network.

[0029] QFileDialog: A module in the PYQT5 library that is used to create dialog boxes to select files or directories.

[0030] sqlalchemy: A SQL toolkit and object-relational mapper for Python that provides a Pythonic way to operate databases, used with PyQt5.

[0031] shutil.rmtree method: A method in the Python standard library that recursively deletes a directory and its contents.

[0032] session.query.filter.delete: A method in the sqlalchemy library that is used to perform delete operations. It is used to delete records that meet specific conditions from the database. When used with PYQT5, you can interact with the database in a PYQT5 application.

[0033] QTableWidget module: used to display data in the database in the PYQT5 application and interact with the database.

[0034] According to an embodiment of the present invention, an embodiment of a data processing method based on PYQT5 is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0035] Figure 1 is a data processing method based on PYQT5 according to an embodiment of the present invention, such as Figure 1 As shown, the method comprises the following steps:

[0036] Step S1, receiving request information, wherein the request information includes at least one of the following: request query information, request download information and request optimization information, the request query information is used to query target information based on preset query conditions (for example, it can be input to query a certain type of plug-in information), the request download information is used to request to download a preset plug-in from a server, and the request optimization information is used to request to add a plug-in in a database, and the server includes at least one of a cloud server and a local server;

[0037] Specifically, users send request information through UI interaction according to different needs. This method receives the request information, distinguishes the user's request information into request query information, request download information and request optimization information, and then takes corresponding actions based on preset query conditions to query the target information, and requests the server to download preset plug-ins and add plug-ins in the database. Users can send request information to any one or both of the local server and the cloud server according to their needs. Users can directly download file data from the cloud and save it to a local path, or set the automatic download function, which can be automatically downloaded to the local after the cloud releases the updated version, improving the intelligence of platform software development and integration.

[0038] It should be noted that according to the data processing method of PYQT5, a plug-in with a C / S architecture is used to manage the client. The request information is sent by the user on the client to the server. According to the different request information of the user, the server processes and executes the corresponding logic program.

[0039] Step S2, in response to the request information, when it is determined that the target file is obtained, the current database is updated based on the target file to obtain the target database, wherein the target file includes at least one of the following: target data and a target plug-in, the target data is used to display the query results to the target object, and the target plug-in is used to update the database.

[0040] Specifically, after receiving the request information sent by the user, the server performs corresponding logic execution according to the different request information sent by the user. When the request information sent by the user is query information, the server obtains the target file and target data based on the preset query conditions and feeds back to the user. When the request information sent by the user is download information or optimization information, the server obtains the target plug-in based on the request conditions for display or provision to the user.

[0041] Through the above steps, the request information is received, wherein the request information includes at least one of the following: request query information, request download information and request optimization information, the request query information is used to query the target information based on the preset query conditions, the request download information is used to request the server to download the preset plug-in, and the request optimization information is used to request to add the plug-in in the database, and the server includes at least one of the cloud server and the local server; in response to the request information, when it is determined that the target file is obtained, the current database is updated based on the target file to obtain the target database, wherein the target file includes at least one of the following: target data and target plug-in, the target data is used to display the query results to the target object, and the target plug-in is used to update the database. The data processing method based on PYQT5 can solve the technical problems that the version release cannot respond in real time, and the integration and intelligence are low.

[0042] Optionally, in step S2, before obtaining the target file in response to the request information and updating the current database based on the target file, the method includes:

[0043] Step S11, after determining that the received request information is a request query information, determining the type of the request query information, wherein the type of the request query information includes a request cloud query and a request local query;

[0044] Specifically, the server is divided into cloud servers and local servers. When the server receives a request for query information, it automatically determines whether the user is making a request to the local or cloud. Since the local and cloud data are different, when it is detected that the user has issued a query request to the local server, the query task is assigned to the local server, reducing the network delay of the cloud server, which can reduce the burden on the cloud server, and at the same time, the local server query is more convenient and faster.

[0045] Step S12, when it is determined that the type of the request query information is a request for cloud query, the request module sends a cloud query request instruction to the cloud server in the server;

[0046] Specifically, when it is detected that the user has sent a query request to the cloud server, the server will provide feedback to the user after searching and querying the specific search library and database. In one embodiment of the present application, the cloud query request uses a request module independent of PYQT5, and the database uses a sqlite database.

[0047] It should be noted that according to the request module, a cloud request query instruction is sent to the cloud server, and the query conditions are pre-input or preset. The specific operation is to enter keywords for search, and fuzzy search can be performed according to the plug-in name, category, developer, and plug-in alias.

[0048] Step S13, responding to the cloud request query instruction to obtain json format data, using the loads method of the json library to parse the json format data to obtain a Dictionary data type that meets python requirements;

[0049] Specifically, using json format data and using the loads method of the json library to parse the json format data has the advantages of strong readability, good cross-platform performance, and easy parsing, and has good compatibility with the JavaScript language commonly used in Web development.

[0050] Step S14, using the setItem method of the QTableWidget module of PYQT5 to assign the Dictionary data type to the table at the first target position, and obtain the target data of the target data file.

[0051] Specifically, the request module is used to initiate a POST request to the cloud, and the server returns the corresponding json format data, which is parsed into the python Dictionary data type through the loads method of the json library. Finally, the setItem method of the QTableWidget module of PYQT5 is called to assign the data to the table, which can realize flexible controls of each module.

[0052] Optionally, in step S11, the data processing method includes:

[0053] Step S111, when it is determined that the requested information received is a request for local query, query the database based on preset query conditions using the session.query.filter method query method to obtain local query information in the target data file;

[0054] Specifically, when it is detected that the user has issued a query request to the local server, the query task will be assigned to the local server, reducing the network delay of the cloud server and alleviating the burden on the cloud server. At the same time, the local server usually has strong computing and data processing capabilities, and can perform complex local calculations, data processing and data storage, which is more convenient for applications that require a lot of computing or data processing, making queries more convenient and faster.

[0055] Step S112, using the setItem method of the QTableWidget module to refresh the target interface based on the local query information.

[0056] Specifically, when the target interface is refreshed using the setItem method, it is convenient to update or replace data in the table. The setItem method can customize the form of cells and edit the content of cells, which can more efficiently manage the data in cells and realize rapid refresh and display of data.

[0057] Optionally, in step S2, obtaining a target file in response to the request information, and updating the current database based on the target file include:

[0058] Step S201, in response to the request information being a download request information, wherein the download request information is used to request a cloud server to download a target plug-in, a request is initiated to the cloud server using a request module;

[0059] Specifically, when it is detected that the user has sent a download request to the cloud server, the server will search and provide plug-in feedback to the user, send a cloud request download instruction to the cloud server according to the request module, and search for the plug-in according to the preset download conditions. The specific operation is to enter keywords for search, and you can choose to download according to the searched plug-in.

[0060] Step S202, obtain the json format data returned by the cloud server, use the loads method of the json library to parse the json format data into a python dictionary data type, use the BytesIO library to read and write the parsed python dictionary data type into binary data in the memory, obtain the binary data file in the target file, and then use the Python file (File) write() method to download the binary data file to the second target location, and finally use the session.add method of the sqlalchemy library to save the binary data file located at the second target location to the database.

[0061] Specifically, using json format data and the loads method of the json library to parse json format data has the advantages of strong readability, good cross-platform, and easy parsing, and has good compatibility with the JavaScript language commonly used in Web development. The parsed data type is read and written into binary data in memory using the BytesIO library. In the process of saving binary data files, it is possible to avoid creating actual physical files and uploading temporary files on disk, saving space, and operating quickly and conveniently.

[0062] Optionally, in step S2, obtaining a target file in response to the request information, updating a current database based on the target file, and obtaining the target database includes:

[0063] Step S211, in response to the request information being a request for optimization information, determining the type of the request for optimization information, wherein the type of the request for optimization information includes a request for adding a database plug-in type and a request for deleting a database plug-in type.

[0064] Specifically, when it is detected that the optimization request issued by the user to the cloud server is a request to add a database plug-in, the server searches and provides plug-in feedback to the user; when it is detected that the optimization request issued by the user to the cloud server is a request to delete a database plug-in, the server detects the files under the corresponding deletion path and deletes the corresponding record information in the database.

[0065] Step S212, when it is determined that the type of the request for optimization information is a request to add a database plug-in class, the QFileDialog component is used to pop up a local file selection box to select the plug-in to be added, the plug-in information to be added in the target file is obtained, and the session.add method of the sqlalchemy library is used to save the plug-in information to be added to the database to obtain the target database. Then the session.query method is used to query all the plug-in information in the database, and finally the setItem method of the QTableWidget module is used to refresh the target interface.

[0066] Specifically, the QFileDialog component is used to create a dialog box to select files or directories. When it is determined that the type of optimization information requested is a request to add a database plug-in, the preset plug-in is retrieved through the server, and a local file selection box pops up to select the plug-in to be added. After the user selects, the session.add method of the sqlalchemy library is used to save the plug-in information to be added to the database, and then the database is updated; when it is determined that the type of optimization information requested is a request to delete a database plug-in, the corresponding database plug-in is retrieved through the server, and a local file selection box pops up to select the plug-in to be deleted. After the user selects, session.query.filter.delete is used to delete the corresponding records in the database, and then session.query is used to query all plug-in information, and the setItem method of the QTableWidget module is used to refresh the target interface and data.

[0067] Optionally, in step S211, the data processing method includes:

[0068] Step S2111, when it is determined that the type of the request optimization information is a request to delete a database plug-in, the shutil.rmtree method is used to delete the plug-in to be deleted at the third target location, the session.query.filter.delete method is used to delete the records in the database, and then the session.query method is used to query all plug-in information in the database, and finally the setItem method of the QTableWidget module is used to refresh the target interface to obtain the target database. Among them, the first target location, the second target location and the third target location can be the same or different, and the first target location, the second target location and the third target location can be local or cloud, and can be arranged according to actual conditions.

[0069] Optionally, in steps S1-S2, the data processing method further includes:

[0070] Step S31, detecting file information of the cloud server;

[0071] Step S32, based on the file information, when determining that the cloud server has received a newly added file, a download instruction is generated;

[0072] Step S33: Download the newly added file from the cloud server to the local computer based on the download instruction.

[0073] Specifically, the files in the cloud server are files uploaded by other clients through http. After the user sends an http request through the request module on the client, the corresponding file information in the cloud server is detected, and then the client is notified through http to generate a download instruction and a download window. The user calls the file download interface from the client and downloads the newly added files on the cloud server to the local computer based on the download spirit.

[0074] Optionally, in step S33, the data processing method further includes:

[0075] Step S34, when it is determined that the newly added file in the cloud server is downloaded to the local computer, a reminder message is generated, and the reminder message is used to remind the target object that the newly added file in the cloud server has been downloaded successfully.

[0076] It should be noted that when the file has been downloaded successfully, a reminder message is generated. The reminder message can be generated on the user client, or on the window segment connected to the client and the mobile terminal, so as to remind the user.

[0077] According to another aspect of an embodiment of the present invention, a data processing device is provided. The data processing device uses the above-mentioned data processing method to perform data processing.

[0078] Figure 2 The structural block diagram of a data processing device according to one optional embodiment of the present invention is as follows: Figure 2 As shown, the data processing device includes a receiving module 40, which is used to receive request information, wherein the request information includes at least one of the following: request query information, request download information and request optimization information, the request query information is used to query target information based on preset query conditions, the request download information is used to request the server to download a preset plug-in, and the request optimization information is used to request to add a plug-in in the database, and the server includes at least one of a cloud server and a local server; a response module 42 is used to respond to the request information and update the current database based on the target file to obtain the target database when it is determined that the target file is obtained, wherein the target file includes at least one of the following: target data and a target plug-in, the target data is used to display the query results to the target object, and the target plug-in is used to update the database.

[0079] Through the above data processing device, a request message is received, wherein the request message includes at least one of the following: request query information, request download information and request optimization information, the request query information is used to query the target information based on the preset query conditions, the request download information is used to request the server to download the preset plug-in, and the request optimization information is used to request to add the plug-in in the database, and the server includes at least one of the cloud server and the local server; in response to the request information, when it is determined that the target file is obtained, the current database is updated based on the target file to obtain the target database, wherein the target file includes at least one of the following: target data and target plug-in, the target data is used to display the query results to the target object, and the target plug-in is used to update the database. This embodiment adopts a C / S architecture between the client and the server according to user needs to provide a faster response speed.

[0080] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

[0081] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

[0082] According to another aspect of the present invention, a preferred embodiment of a data processing device is provided. This embodiment is a plug-in management client tool based on PYQT5. The UI involves using the QTDesign tool, the functions are implemented based on PYQT5, the cloud request uses the request library, the database uses the sqlite database, and the ORM (Object Relationship Mapping) framework uses SQLAlchemy. The data processing device in this embodiment includes a receiving module 40 and a response module 42, and its main functions are as follows:

[0083] Cloud query function: enter the search keyword in the search box and click the search button. This function can perform fuzzy search according to the plug-in name, category, developer, and plug-in alias. Use the request module to initiate a POST request to the cloud. The server returns the corresponding json format data, which is parsed into python's Dictionary data type through the loads method of the json library. Finally, call the setItem method of the QTableWidget module of PYQT5 to assign the data to the table.

[0084] Cloud download function (see attached Figure 3): Click the download button. This function uses the request module to initiate a POST request to the cloud. The server returns the corresponding json format data, which is parsed into the python Dictionary data type by the loads method of the json library. The BytesIO library is used to read and write binary data in memory, and then the Python file (File) write() method is used to download the received binary file data to the file in the corresponding directory. Finally, the session.add of the sqlalchemy library is used to save the plug-in information to the database.

[0085] Local new functions: Click the Add button, select the corresponding plug-in through the QFileDialog pop-up local file selection box, read the corresponding plug-in information, use the sqlalchemy library's session.add to save the plug-in information to the database, then use session.query to query all plug-in information, and finally use the setItem method of the QTableWidget module to refresh the interface.

[0086] Local deletion function: click the delete button, use the shutil.rmtree method to delete the files under the corresponding path, use session.query.filter.delete to delete the corresponding records in the database, then use session.query to query all plug-in information, and finally use the setItem method of the QTableWidget module to refresh the interface.

[0087] Local query function: enter the search keyword in the search box and click the search button. This function can perform fuzzy search according to the plug-in name, category, developer, plug-in alias, use session.query.filter to query the corresponding records in the database, and finally use the setItem method of the QTableWidget module to refresh the interface.

[0088] Automatic cloud download function: When uploading files to the cloud, the client is notified and downloaded through http. The client calls the file download interface to download the file data to the local computer, and calls the client interface to notify the user that the file has been downloaded successfully.

[0089] By using the data processing method and the data processing device in this embodiment, the corresponding plug-in can be automatically downloaded from the cloud to the project directory, which provides convenience. By using the C / S architecture, the following technical effects can also be achieved:

[0090] 1) Since the logic processing occurs between the client and the server, the C / S architecture can usually provide faster response speed. The client can perform some calculations and data processing locally, reducing the number of interactions with the server and network latency.

[0091] 2) The C / S architecture allows the client application to run offline and synchronize data after reconnecting to the server. This means that even without a network connection, users can still use certain features of the application.

[0092] 3) The client usually has strong computing and data processing capabilities, and can perform complex local calculations, data processing, and data storage. This is very useful for applications that require a lot of computing or data processing, and reduces the burden on the server.

[0093] 4) The C / S architecture allows the client application to fully control the user interface, creating a highly customized and interactive interface. The client application can flexibly design and change the user interface according to specific needs.

[0094] 5) The C / S architecture allows for stricter security control between the client and the server. Sensitive data and logic can be concentrated on the server side, while the client can only access data and functions that have been verified and authorized.

[0095] 6) The C / S architecture can distribute part of the computing tasks and data processing to the client, thereby reducing the load on the server. This is very beneficial for large-scale applications or scenarios that need to handle a large number of user requests.

[0096] According to another aspect of an embodiment of the present invention, a computer non-volatile storage medium is provided, the computer non-volatile storage medium includes a stored program, wherein when the program is running, the device where the computer non-volatile storage medium is located is controlled to execute the steps of any of the above method embodiments.

[0097] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:

[0098] Step S1, receiving request information, wherein the request information includes at least one of the following: request query information, request download information, and request optimization information, the request query information is used to query target information based on preset query conditions, the request download information is used to request to download a preset plug-in from a server, and the request optimization information is used to request to add a plug-in in a database, and the server includes at least one of a cloud server and a local server;

[0099] Step S2, in response to the request information, when it is determined that the target file is obtained, the current database is updated based on the target file to obtain the target database, wherein the target file includes at least one of the following: target data and a target plug-in, the target data is used to display the query results to the target object, and the target plug-in is used to update the database.

[0100] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0101] An embodiment of the present invention further provides a computer program product, including a computer program, and the computer program is executed by a processor to implement the steps in any of the above method embodiments.

[0102] Optionally, in this embodiment, the computer program product may be configured to perform the following steps through a computer program:

[0103] Step S1, receiving request information, wherein the request information includes at least one of the following: request query information, request download information, and request optimization information, the request query information is used to query target information based on preset query conditions, the request download information is used to request to download a preset plug-in from a server, and the request optimization information is used to request to add a plug-in in a database, and the server includes at least one of a cloud server and a local server;

[0104] Step S2, in response to the request information, when it is determined that the target file is obtained, the current database is updated based on the target file to obtain the target database, wherein the target file includes at least one of the following: target data and a target plug-in, the target data is used to display the query results to the target object, and the target plug-in is used to update the database.

[0105] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0106] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0107] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0108] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0109] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0110] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.

[0111] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A data processing method based on PYQT5, characterized in that: include: Receive request information, wherein the request information includes at least one of the following: request query information, request download information, and request optimization information, the request query information is used to query target information based on preset query conditions, the request download information is used to request to download a preset plug-in from a server, and the request optimization information is used to request to add a plug-in in a database, the server includes at least one of a cloud server and a local server; In response to the request information, when it is determined that the target file is obtained, the current database is updated based on the target file to obtain the target database, wherein the target file includes at least one of the following: target data and a target plug-in, the target data is used to display the query results to the target object, and the target plug-in is used to update the database.

2. The data processing method according to claim 1, characterized in that: Obtaining the target file in response to the request information, and before updating the current database based on the target file, comprising: After determining that the received request information is the request query information, determining the type of the request query information, wherein the type of the request query information includes request cloud query and request local query; In the case where it is determined that the type of the request query information is the request cloud query, using the request module to send a cloud request query instruction to a cloud server in the server; Respond to the cloud request query instruction to obtain json format data, use the loads method of the json library to parse the json format data, and obtain the dictionary data type that meets python; The setItem method of the QTableWidget module of PYQT5 is used to assign the Dictionary data type to the table at the first target position to obtain the target data of the target data file.

3. The data processing method according to claim 2, characterized in that: The data processing method comprises: In the case where it is determined that the received request information is the request for local query, querying the database based on the preset query condition using the session.query.filter method query method to obtain the local query information in the target data file; The setItem method of the QTableWidget module is used to refresh the target interface based on the local query information.

4. The data processing method according to any one of claims 1 to 3, characterized in that: Obtaining the target file in response to the request information, and updating the current database based on the target file, comprising: In response to the request information being the download request information, wherein the download request information is used to request the cloud server to download the target plug-in, a request is initiated to the cloud server using a request module; Obtain the json format data returned by the cloud server, use the loads method of the json library to parse the json format data into a python Dictionary data type, use the BytesIO library to read and write the parsed python Dictionary data type into binary data in the memory, obtain the binary data file in the target file, and then use the Python file (File) write() method to download the binary data file to the second target location, and finally use the session.add method of the sqlalchemy library to save the binary data file located at the second target location to the database.

5. The data processing method according to claim 3, characterized in that: Obtaining the target file in response to the request information, updating the current database based on the target file, and obtaining the target database, including: In response to the request information being the request optimization information, determining a type of the request optimization information, wherein the type of the request optimization information includes a request for adding the database plug-in class and a request for deleting the database plug-in class; When it is determined that the type of the requested optimization information is a request to add the database plug-in class, the QFileDialog component is used to pop up a local file selection box to select the plug-in to be added, and the plug-in information to be added in the target file is obtained. The session.add method of the sqlalchemy library is used to save the plug-in information to be added to the database, the target database is obtained, and then the session.query method is used to query all the plug-in information in the database, and finally the setItem method of the QTableWidget module is used to refresh the target interface.

6. The data processing method according to claim 5, characterized in that: The data processing method comprises: When it is determined that the type of the requested optimization information is a request to delete the database plug-in class, the shutil.rmtree method is used to delete the plug-in to be deleted at the third target location, the session.query.filter.delete method is used to delete the records in the database, and then the session.query method is used to query all plug-in information in the database. Finally, the setItem method of the QTableWidget module is used to refresh the target interface to obtain the target database.

7. The data processing method according to claim 1, characterized in that: The data processing method further includes: Detecting file information of the cloud server; Based on the file information, when it is determined that the cloud server has received a newly added file, a download instruction is generated; The newly added files of the cloud server are downloaded to the local computer based on the download instruction.

8. The data processing method according to claim 7, characterized in that: The data processing method further includes: When it is determined that the newly added file in the cloud server is downloaded to the local computer, a reminder message is generated, and the reminder message is used to remind the target object that the newly added file in the cloud server has been downloaded successfully.

9. A data processing device, characterized in that: include: A receiving module, configured to receive request information, wherein the request information includes at least one of the following: request query information, request download information, and request optimization information, wherein the request query information is used to query target information based on preset query conditions, the request download information is used to request a server to download a preset plug-in, and the request optimization information is used to request to add a plug-in in a database, wherein the server includes at least one of a cloud server and a local server; A response module is used to respond to the request information and, when it is determined that a target file is obtained, update the current database based on the target file to obtain a target database, wherein the target file includes at least one of the following: target data and a target plug-in, the target data is used to display query results to the target object, and the target plug-in is used to update the database.

10. A non-volatile storage medium, characterized in that: The non-volatile storage medium includes a stored program, wherein when the program is executed, the device where the non-volatile storage medium is located is controlled to execute the data processing method according to any one of claims 1 to 8.

11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.

Citation Information

Cited By

  • Media data processing method and device, computer equipment and readable storage medium

    CN119814741A