User protocol automatic generation method and device, electronic equipment and storage medium
By automatically generating user agreements, the problem of inefficient update and modification of user agreements in the prior art is solved, and automated releases without the participation of technical personnel are realized, which improves work efficiency and reduces development costs.
Patent Information
- Application Number
- CN202411963885.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-05-30
AI Technical Summary
In the prior art, updating and modifying user agreements requires technicians to manually develop HTML pages, resulting in inefficiency and every time there is a new protocol or project, all user agreements need to be redeveloped.
It provides an automatic generation method for user protocols, which automatically parses and saves content to the database by obtaining the basic information of the protocol and user protocol documents, generates HTML pages of each publishing platform, and pushes them to the OSS repository for publication.
The automatic generation and update of user agreements is realized without the participation of technical personnel, greatly improving the work efficiency of operations and legal personnel and reducing development costs.
Smart Images

Figure CN120067478A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet technologies, and in particular, to a method, apparatus, electronic device, and storage medium for automatically generating user agreements. Background Art
[0002] Internet application programs need to provide user service agreements (hereinafter referred to as user agreements) to users, which detail the terms and conditions that users need to abide by when using various services provided by service providers.
[0003] Currently, for the update of traditional user agreements, developers need to create HTML (HyperText Markup Language) pages according to the content of the documents provided by legal affairs, submit them to the code repository, and the operation and maintenance building platform publishes them to the business CDN (Content Delivery Network) for users to access.
[0004] However, every time a new agreement is available, technical personnel need to newly develop HTML pages, and when the agreement is modified, technical personnel also need to compare the differences and then manually modify the existing HTML pages. In addition, for new projects, all user agreements need to be re-developed. Summary of the Invention
[0005] The present invention provides a method, apparatus, electronic device, and storage medium for automatically generating user agreements, which realizes the automatic generation and update of user agreements, enables operation and legal personnel who do not understand code to conveniently create and modify user agreements within the APP without the participation of technical personnel, and greatly improves work efficiency.
[0006] The present invention provides a method for automatically generating user agreements, including:
[0007] Obtaining the basic agreement information entered on the agreement editing page, where the basic agreement information includes an agreement name, version information, release platform, and project name;
[0008] Receiving a user agreement document uploaded by a user, parsing the user agreement document to obtain user agreement content; or obtaining the user agreement content edited online on the agreement editing page;
[0009] Saving the user agreement content and the basic agreement information to the fields corresponding to the release platform in a database;
[0010] Generating an html page corresponding to the release platform according to the user agreement content;
[0011] Pushing the html page to a preset OSS repository so that the building platform can pull the html page and distribute it to the business CDN for release.
[0012] A method for automatically generating a user agreement provided by the present invention, wherein the publishing platform includes an Android platform, an iOS platform, and a PC platform
[0013] A method for automatically generating a user agreement provided by the present invention, after generating the html page corresponding to the publishing platform according to the content of the user agreement, further includes:
[0014] Adding and saving the protocol basic information and time information of the user agreement content in the historical record table
[0015] A method for automatically generating a user agreement provided by the present invention, after adding and saving the time information of the user agreement content in the historical record table, includes:
[0016] In response to a preview protocol instruction, displaying the user agreement content on a preview page;
[0017] According to the protocol basic information and time information of the previous version of the user agreement content saved in the historical record table, retrieving the previous version of the user agreement content from the database and displaying it on the preview page;
[0018] Performing a difference comparison between the user agreement content and the previous version of the user agreement content, and displaying the difference points on the preview page.
[0019] A method for automatically generating a user agreement provided by the present invention, further includes:
[0020] In response to a restore protocol instruction, obtaining the protocol basic information of the target restored user agreement content;
[0021] According to the protocol basic information of the target restored user agreement content, retrieving the target restored user agreement content from the database;
[0022] Generating a target restored html page corresponding to the publishing platform according to the target restored user agreement content;
[0023] Pushing the target restored html page to the preset OSS repository, so that the construction platform can pull the target restored html page and distribute it to the business CDN for publishing.
[0024] A method for automatically generating a user agreement provided by the present invention, further includes:
[0025] In response to a protocol copy instruction, obtaining the project name of the target project and the protocol name of the first user agreement content;
[0026] Retrieve and display the content of the first user agreement according to the agreement name in the content of the first user agreement;
[0027] Obtain the original keyword and replacement keyword entered;
[0028] Batch replace the original keyword in the content of the first user agreement with the replacement keyword to generate the content of the second user agreement;
[0029] Save the content of the second user agreement to the corresponding field of the publishing platform in the database.
[0030] According to a method for automatically generating a user agreement provided by the present invention, the batch replacing the original keyword in the content of the first user agreement with the replacement keyword to generate the content of the second user agreement includes:
[0031] Substitute the original keyword and the replacement keyword into a preset regular expression to obtain a replacement result;
[0032] Generate the content of the second user agreement according to the replacement result.
[0033] The present invention also provides a device for automatically generating a user agreement, including:
[0034] A first acquisition module, configured to acquire the basic information of the agreement entered on the agreement editing page, where the basic information of the agreement includes an agreement name, a version information, a publishing platform, and a project name;
[0035] A second acquisition module, configured to receive a user agreement document uploaded by a user, parse the user agreement document to obtain the content of the user agreement; or acquire the content of the user agreement edited online on the agreement editing page;
[0036] A saving module, configured to save the content of the user agreement and the basic information of the agreement to the corresponding field of the publishing platform in the database;
[0037] A generating module, configured to generate an html page corresponding to the publishing platform according to the content of the user agreement;
[0038] A pushing module, configured to push the html page to a preset OSS repository, so that a building platform pulls the html page and distributes it to a business CDN for publishing.
[0039] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the program, it implements the method for automatically generating a user agreement as described in any one of the above.
[0040] The present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the method for automatically generating a user agreement as described in any one of the above is implemented.
[0041] A method, device, electronic device and storage medium for automatically generating a user agreement provided by the present invention can automatically analyze the user agreement content in a document uploaded by a user (operation or legal staff), or the user agreement content edited online by the user, and automatically save it into the fields corresponding to each publishing platform in a database. And according to the user agreement content, an html page corresponding to each publishing platform is automatically generated, and the html page is automatically pushed to a preset OSS repository, so that a construction platform can pull the html page and distribute it to a business CDN for publishing. Thus, the present invention realizes the automatic generation and publication of an agreement, without the need for technical personnel to develop, making it convenient for operation and legal staff who do not understand code to create and modify the user agreement in an APP, greatly improving work efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0043] Figure 1 is a flowchart of the method for automatically generating a user agreement provided by the present invention;
[0044] Figure 2 is a structural diagram of the device for automatically generating a user agreement provided by the present invention;
[0045] Figure 3 is a structural diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0046] To make the objectives, technical solutions and advantages of the present invention clearer, the following will clearly and completely describe the technical solutions in the present invention with reference to the accompanying drawings in the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts fall within the protection scope of the present invention.
[0047] It should be noted that in the description of the embodiments of the present invention, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, article or device including the said element. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0048] The terms "first", "second", etc. in the present invention are used to distinguish similar objects, rather than to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances, so that the embodiments of the present invention can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are usually of the same category, and do not limit the number of objects. For example, the first object can be one or multiple. In addition, "and / or" means at least one of the connected objects, and the character " / " generally means that the objects before and after are in an "or" relationship.
[0049] The following Figures 1 to 3 describes a method, device, electronic device and storage medium for automatically generating a user agreement of the present invention.
[0050] As Figure 1 shown, the present invention provides a method for automatically generating a user agreement, which can be applied to the user agreement management background of each application program, and specifically may include the following steps:
[0051] Step 110, obtaining the protocol basic information entered on the protocol editing page, where the protocol basic information includes the protocol name, version information, release platform, and project name.
[0052] Specifically, a user (such as an operation staff, a legal staff, etc.) can enter the protocol basic information of the user agreement to be newly created or edited through a form on the protocol editing page after the user agreement management. The release platform includes the Android platform, the iOS platform, and the PC platform.
[0053] Step 120, receiving the user agreement document uploaded by the user, parsing the user agreement document to obtain the user agreement content; or obtaining the user agreement content edited online on the protocol editing page.
[0054] Specifically, for the newly created user agreement, the user can upload the document of the user agreement through a rich text editor, automatically parse it according to the document to obtain the content of the user agreement; the user can also edit the content of the user agreement online on the agreement editing page. For modifying the original user agreement, the corresponding user agreement content is retrieved according to the agreement basic information and displayed on the agreement editing page, and the user can modify the original user agreement online according to the needs.
[0055] Step 130, save the user agreement content and the agreement basic information into the corresponding fields of the database for the release platform.
[0056] Specifically, the database of the user agreement management background has corresponding fields to save the user agreement content of each platform, receives the data of the agreement editing page through the http interface, and saves the user agreement content and the corresponding agreement basic information into the database.
[0057] Step 140, generate the html page corresponding to the release platform according to the user agreement content.
[0058] Specifically, the user agreement content to be released can be read from the database, and the html file name is the agreement file name + platform, and the user agreement content is the content of the html file, so as to generate the html page corresponding to each platform.
[0059] Step 150, push the html page to a preset OSS repository so that the build platform can pull the html page and distribute it to the business CDN for release.
[0060] Specifically, the generated html pages of the 3 release platforms are pushed to the OSS (Object Storage Service) repository dedicated to the agreement, and the build platform pulls the html pages and distributes them to the business CDN (Content Delivery Network) for release. Thus, the automatic generation and release of the user agreement html page are completed. The whole process is simple to operate. There is no need for technical developers to newly develop html pages, and there is no need to submit them to the code repository for the build platform to release to the business CDN. Operational personnel, legal personnel, etc. who do not understand code can easily create and modify the user agreement in the APP, greatly improving work efficiency and reducing development costs.
[0061] In some embodiments, after step 140, it may further include:
[0062] Add and save the agreement basic information and time information of the user agreement content in the historical record table.
[0063] In this embodiment, the protocol basic information (protocol name, version information, release platform, project name) and time information (timestamp recorded when generating the html page) of the user agreement content submitted each time are recorded in the historical record table for subsequent differential comparison.
[0064] In some embodiments, after adding and saving the time information of the user agreement content in the historical record table, it includes:
[0065] In response to the preview protocol instruction, display the user agreement content on the preview page;
[0066] According to the protocol basic information and time information of the previous version of the user agreement content saved in the historical record table, retrieve the previous version of the user agreement content from the database and display it on the preview page;
[0067] Perform a differential comparison between the user agreement content and the previous version of the user agreement content, and display the differential points on the preview page.
[0068] In this embodiment, the user agreement management background also provides an online differential comparison function, which can perform a differential comparison between the newly created or newly modified user agreement content and the previous version of the user agreement content, and display the differential points between the two versions on the preview page, facilitating the user to compare and confirm. After the user confirms that there is no error, step 150 can be executed for automatic release.
[0069] In some embodiments, it further includes:
[0070] In response to the restore protocol instruction, obtain the protocol basic information of the target restored user agreement content;
[0071] According to the protocol basic information of the target restored user agreement content, retrieve the target restored user agreement content from the database;
[0072] Generate the target restored html page corresponding to the release platform according to the target restored user agreement content;
[0073] Push the target restored html page to the preset OSS repository so that the build platform can pull the target restored html page and distribute it to the business CDN for release.
[0074] In this embodiment, the user agreement management background also provides a protocol restoration function, which can read the information of the old version of the user agreement to be restored from the historical record table, retrieve the old version of the user agreement content from the database, and regenerate the html pages of each release platform for automatic release.
[0075] In some embodiments, the method further includes:
[0076] In response to a protocol replication instruction, obtain the project name of the target project and the protocol name of the first user protocol content;
[0077] Retrieve and display the first user protocol content according to the protocol name of the first user protocol content;
[0078] Obtain the original keyword and the replacement keyword entered;
[0079] Batch replace the original keyword in the first user protocol content with the replacement keyword to generate the second user protocol content;
[0080] Save the second user protocol content to the field corresponding to the publishing platform in the database.
[0081] In this embodiment, the user protocol management background also provides a function to support cloning all protocols within a project, that is, copying the user protocols used in an application project to a new project for publishing. Obtain the name of the new project to be copied and the name of the user protocol to be copied through the http interface, and obtain the replacement keyword entered by the user. Generate the user protocol content of the new project through keyword replacement and save it to the database. Subsequently, an html page can be automatically generated according to the user protocol content of the new project for publishing.
[0082] In some embodiments, the batch replacing the original keyword in the first user protocol content with the replacement keyword to generate the second user protocol content includes:
[0083] Substitute the original keyword and the replacement keyword into a preset regular expression to obtain a replacement result;
[0084] Generate the second user protocol content according to the replacement result.
[0085] Specifically, substituting keywords into a regular expression realizes the protocol content replacement function. In addition, it is also possible to clone all user protocols within the entire project and generate all user protocols of the new project through keyword replacement.
[0086] The above-mentioned user agreement automatic generation method provided by the present invention can automatically parse the user agreement content in the document uploaded by the user (operation and legal personnel), or the user agreement content edited online by the user, automatically save it to the fields corresponding to each release platform in the database, and automatically generate the html page corresponding to each release platform according to the user agreement content, and automatically push the html page to the preset OSS repository, so that the construction platform can pull the html page and distribute it to the business CDN for release. Thus, the present invention realizes the automatic generation and release of the agreement, without the need for technical personnel to develop, making it convenient for operation and legal personnel who do not understand code to create and modify the user agreement in the APP, greatly improving work efficiency.
[0087] In some embodiments, after the user agreement is released, when the client accesses the released user agreement, it will preferentially load the default page (the html page of the iOS system is loaded by default). By judging the browser UA (User Agent), the system accessed by the user is determined. If it is the Android system or PC, it will jump to the protocol page of the corresponding platform to display the protocol content of the specified platform.
[0088] The client can also judge whether the page is the latest generated page by comparing the time stamp recorded when the html page is generated, and refresh the browser page cache by changing the URL (Uniform Resource Locator) parameter to ensure that the user accesses the latest released user agreement content.
[0089] Next, the user agreement automatic generation device provided by the present invention will be described. The user agreement automatic generation device described below can be mutually referred to the user agreement automatic generation method described above.
[0090] As Figure 2 shown, the present invention also provides a user agreement automatic generation device, including:
[0091] The first acquisition module 210 is used to acquire the protocol basic information entered on the protocol editing page, where the protocol basic information includes the protocol name, version information, release platform, and project name;
[0092] The second acquisition module 220 is used to receive the user agreement document uploaded by the user, parse it according to the user agreement document to obtain the user agreement content; or, acquire the user agreement content edited online on the protocol editing page;
[0093] The saving module 230 is used to save the user agreement content and the protocol basic information to the fields corresponding to the release platform in the database;
[0094] A generation module 240, configured to generate an html page corresponding to the publishing platform according to the content of the user agreement;
[0095] A push module 250, configured to push the html page to a preset OSS repository, so that a construction platform can pull the html page and distribute it to a business CDN for publishing.
[0096] Figure 3 An example of a schematic physical structure diagram of an electronic device is shown as Figure 3 shown. The electronic device may include: a processor 310, a communication interface 320, a memory 330, and a communication bus 340. Among them, the processor 310, the communication interface 320, and the memory 330 communicate with each other through the communication bus 340. The processor 310 can call the logical instructions in the memory 330 to execute the method for automatically generating a user agreement. The method includes: obtaining the basic protocol information entered on a protocol editing page, where the basic protocol information includes a protocol name, a version information, a publishing platform, and a project name; receiving a user agreement document uploaded by a user, and parsing the user agreement document to obtain user agreement content; or obtaining the user agreement content edited online on the protocol editing page; saving the user agreement content and the basic protocol information to fields corresponding to the publishing platform in a database; generating an html page corresponding to the publishing platform according to the user agreement content; pushing the html page to a preset OSS repository, so that a construction platform can pull the html page and distribute it to a business CDN for publishing.
[0097] In addition, when the logical instructions in the above-mentioned memory 330 are implemented in the form of a software functional unit and sold or used as an independent product, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that makes a contribution to the prior art, or a part of this technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: various media such as a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk, or an optical disc that can store program codes.
[0098] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the user agreement automatic generation method provided by each of the above methods. The method includes: obtaining the protocol basic information entered on the protocol editing page, where the protocol basic information includes a protocol name, version information, release platform, and project name; receiving a user agreement document uploaded by a user, parsing the user agreement document to obtain user agreement content; or obtaining the user agreement content edited online on the protocol editing page; saving the user agreement content and the protocol basic information to the corresponding fields of the release platform in a database; generating an html page corresponding to the release platform according to the user agreement content; pushing the html page to a preset OSS repository so that a construction platform can pull the html page and distribute it to a business CDN for release.
[0099] In another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it is configured to execute the user agreement automatic generation method provided by each of the above methods. The method includes: obtaining the protocol basic information entered on the protocol editing page, where the protocol basic information includes a protocol name, version information, release platform, and project name; receiving a user agreement document uploaded by a user, parsing the user agreement document to obtain user agreement content; or obtaining the user agreement content edited online on the protocol editing page; saving the user agreement content and the protocol basic information to the corresponding fields of the release platform in a database; generating an html page corresponding to the release platform according to the user agreement content; pushing the html page to a preset OSS repository so that a construction platform can pull the html page and distribute it to a business CDN for release.
[0100] The device embodiments described above are merely illustrative. 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 to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. A person of ordinary skill in the art can understand and implement it without creative labor.
[0101] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the above technical solution, in essence, or the part that contributes to the prior art can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0102] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for automatically generating a user agreement, characterized in that: include: Obtain the basic information of the agreement entered on the agreement editing page, wherein the basic information of the agreement includes the agreement name, version information, publishing platform, and project name; Receive a user agreement document uploaded by a user, parse the user agreement document, and obtain the content of the user agreement; or obtain the content of the user agreement edited online on the agreement editing page; The user agreement content and the basic agreement information are saved in the field corresponding to the publishing platform in the database; Generate an HTML page corresponding to the publishing platform according to the content of the user agreement; The html page is pushed to the preset OSS warehouse so that the construction platform pulls the html page and distributes it to the business CDN for publishing.
2. The method for automatically generating a user agreement according to claim 1, characterized in that: The publishing platforms include Android platform, iOS platform and PC platform.
3. The method for automatically generating a user agreement according to claim 1, characterized in that: After generating the HTML page corresponding to the publishing platform according to the user agreement content, it also includes: The basic information of the agreement and the time information of the user agreement content are newly saved in the history record table.
4. The method for automatically generating a user agreement according to claim 3, characterized in that: After the time information of the user agreement content is newly added to the history record table, the following steps are included: In response to the preview agreement instruction, displaying the user agreement content on the preview page; According to the basic information of the agreement and the time information of the previous version of the user agreement content stored in the history record table, the previous version of the user agreement content is retrieved from the database and displayed on the preview page; A difference comparison is performed between the user agreement content and the previous version of the user agreement content, and the difference points are displayed on the preview page.
5. The method for automatically generating a user agreement according to claim 3, characterized in that: Also includes: In response to the restore protocol instruction, acquiring protocol basic information of the target restored user protocol content; Retrieving the target restoration user agreement content from the database according to the agreement basic information of the target restoration user agreement content; Generate a target restoration html page corresponding to the publishing platform according to the target restoration user agreement content; The target restored html page is pushed to the preset OSS warehouse, so that the construction platform pulls the target restored html page and distributes it to the business CDN for publishing.
6. The method for automatically generating a user agreement according to claim 1, characterized in that: Also includes: In response to the protocol copy instruction, obtaining the project name of the target project and the protocol name of the first user protocol content; Retrieving and displaying the first user agreement content according to the agreement name of the first user agreement content; Obtain the input original keyword and replacement keyword; replacing the original keywords of the first user agreement content in batches according to the replacement keywords to generate second user agreement content; The second user agreement content is saved in the field corresponding to the publishing platform in the database.
7. The method for automatically generating a user agreement according to claim 6, characterized in that: The step of batch-replacing the original keywords of the first user agreement content according to the replacement keywords to generate the second user agreement content includes: Substituting the original keyword and the replacement keyword into a preset regular expression to obtain a replacement result; The second user agreement content is generated according to the replacement result.
8. A user agreement automatic generation device, characterized in that: include: The first acquisition module is used to acquire the basic information of the protocol entered on the protocol editing page, wherein the basic information of the protocol includes the protocol name, version information, publishing platform, and project name; The second acquisition module is used to receive a user agreement document uploaded by a user, parse the user agreement document, and obtain the user agreement content; or obtain the user agreement content edited online on the agreement editing page; A saving module, used to save the user agreement content and the basic agreement information into a field corresponding to the publishing platform in a database; A generation module, used to generate an HTML page corresponding to the publishing platform according to the content of the user agreement; The push module is used to push the HTML page to the preset OSS warehouse so that the construction platform can pull the HTML page and distribute it to the business CDN for publishing.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method for automatically generating a user agreement as described in any one of claims 1 to 7 is implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for automatically generating a user agreement as claimed in any one of claims 1 to 7 is implemented.