CN116263660A - Page processing method, device, equipment, medium and program product - Google Patents
Page processing method, device, equipment, medium and program product Download PDFInfo
- Publication number
- CN116263660A CN116263660A CN202111532023.3A CN202111532023A CN116263660A CN 116263660 A CN116263660 A CN 116263660A CN 202111532023 A CN202111532023 A CN 202111532023A CN 116263660 A CN116263660 A CN 116263660A
- Authority
- CN
- China
- Prior art keywords
- attribute
- target page
- target
- tag
- display platform
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 19
- 238000011161 development Methods 0.000 claims abstract description 103
- 230000001960 triggered effect Effects 0.000 claims abstract description 67
- 238000000034 method Methods 0.000 claims abstract description 60
- 238000009877 rendering Methods 0.000 claims abstract description 20
- 238000012545 processing Methods 0.000 claims description 74
- 238000004590 computer program Methods 0.000 claims description 20
- 230000000977 initiatory effect Effects 0.000 claims description 6
- 230000004044 response Effects 0.000 claims description 4
- 230000006870 function Effects 0.000 description 162
- 230000001771 impaired effect Effects 0.000 description 25
- 238000013515 script Methods 0.000 description 24
- 230000008569 process Effects 0.000 description 22
- 238000012856 packing Methods 0.000 description 18
- 238000005516 engineering process Methods 0.000 description 14
- 238000002372 labelling Methods 0.000 description 14
- 238000010586 diagram Methods 0.000 description 11
- 238000004806 packaging method and process Methods 0.000 description 11
- 230000000694 effects Effects 0.000 description 5
- 230000004888 barrier function Effects 0.000 description 4
- 238000004891 communication Methods 0.000 description 4
- 238000013461 design Methods 0.000 description 4
- 238000013473 artificial intelligence Methods 0.000 description 3
- 230000000981 bystander Effects 0.000 description 3
- 230000003238 somatosensory effect Effects 0.000 description 3
- 230000003213 activating effect Effects 0.000 description 2
- 239000012634 fragment Substances 0.000 description 2
- 230000014509 gene expression Effects 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 238000006467 substitution reaction Methods 0.000 description 2
- 230000000007 visual effect Effects 0.000 description 2
- 206010011878 Deafness Diseases 0.000 description 1
- 241000282326 Felis catus Species 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 230000006735 deficit Effects 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 238000009499 grossing Methods 0.000 description 1
- 230000010370 hearing loss Effects 0.000 description 1
- 231100000888 hearing loss Toxicity 0.000 description 1
- 208000016354 hearing loss disease Diseases 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 230000037230 mobility Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000008520 organization Effects 0.000 description 1
- 238000012858 packaging process Methods 0.000 description 1
- 230000008447 perception Effects 0.000 description 1
- 238000007781 pre-processing Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 208000029257 vision disease Diseases 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/38—Creation or generation of source code for implementing user interfaces
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/958—Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/73—Program documentation
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- Human Computer Interaction (AREA)
- Library & Information Science (AREA)
- Data Mining & Analysis (AREA)
- Stored Programmes (AREA)
Abstract
The embodiment of the application discloses a page processing method, a device, equipment, a medium and a program product, wherein the method comprises the following steps: acquiring a source code of a target page, wherein the source code supports cross-platform operation in a first display platform and a second display platform, the source code comprises a first tag attribute written for target page elements in the target page based on a page development specification followed by the first display platform, and the tag attribute is used for indicating the display platform to output a trigger prompt when the target page elements are detected to be triggered; identifying a target label to which the first label attribute belongs in the source code, and setting a second label attribute which can be identified by a second display platform in the target label to obtain a new source code; and generating an executable file matched with the second display platform based on the new source code, wherein the executable file is used for rendering and displaying the target page. By adopting the embodiment of the application, the coding efficiency of page development can be improved.
Description
Technical Field
The present application relates to the field of computer technology, and in particular, to the field of artificial intelligence, and more particularly, to a page processing method, a page processing apparatus, a page processing device, a computer readable storage medium, and a computer program product.
Background
The vast amount of information in the internet is typically presented visually, such as a user may browse information from an open page; in order to improve the perception effect of a user on page elements contained in a page, the method currently supports outputting a trigger prompt to prompt the user that the page elements are being triggered when the page elements are triggered. For example, some intelligent devices (or application programs deployed in the intelligent devices) provide an unobstructed mode to help visually impaired people read and broadcast page elements in a page, where the unobstructed mode refers to that after information in the page is read by the intelligent devices, the read information is broadcast in a voice broadcast manner, so that the visually impaired people can receive the information through hearing.
According to different page development standards (or specifications) followed by the display platform, the required tag attributes when the trigger prompt (such as the barrier-free mode) of the page element is started are different, for example, the tag attributes required by the Web (World Wide Web) platform and the android platform for starting the barrier-free mode are different; the method leads to the development of the same page, developers need to adopt different tag attributes to carry out triggering prompt annotation (such as barrier-free annotation), double repeated work is needed, the encoding workload is increased, and the encoding efficiency is reduced.
Disclosure of Invention
The embodiment of the application provides a page processing method, device, equipment, medium and program product, which can improve the coding efficiency of page development.
In one aspect, an embodiment of the present application provides a page processing method, where the method includes:
acquiring a source code of a target page, wherein the source code supports cross-platform operation in a first display platform and a second display platform, the source code comprises a first tag attribute written for target page elements in the target page based on a page development specification followed by the first display platform, and the tag attribute is used for indicating the display platform to output a trigger prompt when the target page elements are detected to be triggered;
identifying a target label to which the first label attribute belongs in the source code, and setting a second label attribute which can be identified by a second display platform in the target label to obtain a new source code;
and generating an executable file matched with the second display platform based on the new source code, wherein the executable file is used for rendering and displaying the target page.
In another aspect, an embodiment of the present application provides a page processing apparatus, including:
the system comprises an acquisition unit, a trigger prompt generation unit and a trigger prompt generation unit, wherein the acquisition unit is used for acquiring a source code of a target page, the source code is supported to run in a first display platform and a second display platform in a cross-platform manner, the source code comprises a first tag attribute written for target page elements in the target page based on page development specifications followed by the first display platform, and the tag attribute is used for indicating the display platform to output the trigger prompt when the target page elements are detected to be triggered;
The processing unit is used for identifying a target label to which the first label attribute belongs in the source code, and setting a second label attribute which can be identified by the second display platform in the target label to obtain a new source code;
and the processing unit is also used for generating an executable file matched with the second display platform based on the new source code, and the executable file is used for rendering and displaying the target page.
In one implementation, the trigger prompt includes prompt audio that matches semantic description information of the target page element, the semantic description information being used to semantically describe the target page element;
the semantic description information includes at least one of: describing information of a style presented to the target page element, describing information of a function executed after the target page element is triggered, and describing information of an object contained in the target page element;
the prompt audio is used for prompting at least one of the following: a style for prompting presentation of the target page element, a function executed after the target page element is triggered, and an object contained in the target page element.
In one implementation manner, the processing unit is configured to set a second tag attribute that can be identified by the second display platform in the target tag, and when obtaining the new source code, the processing unit is specifically configured to:
Acquiring a first attribute value of a first tag attribute from the source code, and determining a second tag attribute which can be identified by a second display platform;
generating a second attribute value of the second tag attribute according to the first attribute value and the attribute rule of the second tag attribute;
and setting a second tag attribute and a second attribute value in the target tag to obtain a new source code.
In one implementation, the page development specification followed by the first display platform indicates that the first tag attribute includes an element function attribute and an element role attribute, the element function attribute is used for setting description information of a function executed after the target page element is triggered, and the element role attribute is used for setting description information of a style presented by the target page element;
the processing unit is configured to, when generating the second attribute value of the second tag attribute according to the first attribute value and the attribute rule of the second tag attribute, specifically:
acquiring a function attribute value of an element function attribute and a role attribute value of an element role attribute;
splicing the function attribute value and the role attribute value according to the attribute rule of the second tag attribute to obtain a spliced character string;
and determining the spliced character string as a second attribute value of the second tag attribute.
In one implementation, the page development specification followed by the second display platform indicates that the second tag attribute includes a function start attribute and an element description attribute, the function start attribute is used for setting whether the display platform outputs a trigger prompt when detecting that the target page element is triggered, and the element description attribute is used for setting description information of functions and styles of the target page element;
the processing unit is configured to set a second tag attribute and a second attribute value in the target tag, and when a new source code is obtained, the processing unit is specifically configured to:
adding the function starting attribute in the target label, and setting an attribute value of the function starting attribute as function starting information, wherein the function starting information indicates that a target page element is set as an element capable of triggering prompt; the method comprises the steps of,
and adding the element description attribute in the target label, and determining the spliced character string as an attribute value of the element description attribute.
In one implementation, the page development specification followed by the first display platform indicates that the first tag attribute includes a function start attribute and an element description attribute, the function start attribute is used for setting whether to output a trigger prompt when the display platform detects that the target page element is triggered, and the element description attribute is used for setting description information of functions and styles of the target page element;
The processing unit is configured to, when generating the second attribute value of the second tag attribute according to the first attribute value and the attribute rule of the second tag attribute, specifically:
acquiring an attribute value of a function starting attribute;
if the attribute value of the function starting attribute is the function starting information, acquiring the attribute value of the element description attribute;
splitting the attribute value of the element description attribute according to the attribute rule of the second tag attribute to obtain a functional attribute value and a role attribute value;
the function attribute value and the role attribute value are determined as second attribute values of the second tag attribute.
In one implementation, the page development specification followed by the second display platform indicates that the second tag attribute includes an element function attribute and an element role attribute, the element function attribute is used for setting description information of a function executed after the target page element is triggered, and the element role attribute is used for setting description information of a style presented by the target page element;
the processing unit is configured to set a second tag attribute and a second attribute value in the target tag, and when a new source code is obtained, the processing unit is specifically configured to:
adding the element function attribute in the target label, and determining the function attribute value as the attribute value of the element function attribute; the method comprises the steps of,
And adding the character attribute of the element in the target label, and determining the character attribute value as the attribute value of the character attribute of the element.
In one implementation, the target page belongs to any service page in the target application program, and the processing unit is further configured to:
adding the executable file adapted by the second display platform into a program package of the target application program;
in response to an issuing instruction for a package of the target application program, issuing the package of the target application program to cause the terminal device to install the target application program based on the package of the target application program;
when the terminal equipment displays the target page through the second display platform, rendering and displaying the target page according to the executable file adapted by the second display platform; and when the target page element in the target page is triggered, outputting a trigger prompt according to the second tag attribute.
In another aspect, an embodiment of the present application provides a page processing apparatus, including:
a processor adapted to execute a computer program;
a computer readable storage medium having a computer program stored therein, which when executed by a processor, implements a page processing method as described above.
In another aspect, embodiments of the present application provide a computer readable storage medium storing a computer program adapted to be loaded by a processor and to perform a page processing method as described above.
In another aspect, embodiments of the present application provide a computer program product or computer program comprising computer instructions stored in a computer-readable storage medium. The processor of the page processing apparatus reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions so that the page processing apparatus performs the above-described page processing method.
According to the method and the device for generating the source code, the source code which is established for the target page can be obtained, and when the source code contains the first tag attribute which is written for the target page element in the target page based on the page development specification which is followed by the first display platform, the second tag attribute which can be identified by the second display platform can be set in the target tag to which the first tag attribute belongs, so that the new source code is obtained. By adding the second tag attribute which can be identified by the second display platform into the source code written based on the page development specification followed by the first display platform, a new source code which can be operated by the second display platform can be obtained, so that a developer can obtain corresponding source codes of different display platforms by developing a set of source codes based on the page development specification of one display platform, the indifferent trigger prompt of different display platforms to target page elements is achieved, the workload of tag attribute labeling is reduced, and the coding efficiency is improved.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 illustrates a schematic view of a scene of a barrier-free annotation provided in an exemplary embodiment of the present application;
FIG. 2 is a flow chart illustrating a method for processing a page according to an exemplary embodiment of the present application;
FIG. 3 is a flowchart illustrating a method for setting a second tag attribute identifiable by a second display platform in a target tag according to an exemplary embodiment of the present application;
FIG. 4 is a flowchart illustrating a method for setting a second tag attribute identifiable by a second display platform in a target tag according to an exemplary embodiment of the present application;
FIG. 5 is a flow chart illustrating a method for processing a page according to an exemplary embodiment of the present application;
FIG. 6 is a schematic diagram of a scenario in which a second display platform according to an exemplary embodiment of the present application displays a target page and outputs a trigger prompt that the target page element matches;
FIG. 7 is a schematic diagram of a scenario in which a second display platform according to an exemplary embodiment of the present application displays a target page and outputs trigger prompts matching target page elements;
FIG. 8 illustrates a schematic diagram of an on barrier-free mode provided by an exemplary embodiment of the present application;
FIG. 9 is a schematic diagram of a page processing apparatus according to an exemplary embodiment of the present application;
fig. 10 shows a schematic structural diagram of a page processing apparatus according to an exemplary embodiment of the present application.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The embodiment of the application provides a page processing scheme, and technical terms and concepts related to the page processing scheme are described below, wherein:
1. cross-platform technology.
May be simply referred to as cross-platform, which refers to a technology in which a set of written code can run on different display platforms (or simply referred to as platforms) at the same time. For example: the written set of codes can be simultaneously operated on three ends of Android, IOS (iPhone Operation System, apple operating system) and H5; if a set of codes of a target page (such as any page) is created by adopting a cross-platform technology, the codes can be run in the android platform and the H5 platform to render the target page; this allows code developed for android or IOS platforms to also be written in the form of H5 tags. Wherein, H5 is an abbreviation of HTML5 (hypertext 5.0), which is a technical standard developed by the Web (World Wide Web) platform, and is a language description mode for constructing Web pages (or Web pages). Current cross-platform technologies may include Hippy frameworks, react-native frameworks, and the like; the objective of the Hippy framework is that a developer (or called developer) can directly run on different platforms (such as iOS, android and Web) by writing only one set of codes, and the design of the Hippy framework is mainly directed to traditional Web developers, especially developers who have previous experience of reaction-native and Vue development, so that the Hippy framework is easier for front-end development of cross-end applications. Embodiments of the present application are not limited to the type of cross-platform framework, and are specifically described herein.
2. And (3) an unobstructed mode.
The method can be called an unobstructed screen reading mode, an unobstructed screen reading mode or a bystander mode, and is a screen reading mode for broadcasting contents contained in a page by adopting voice (or audio). The barrier-free mode is a mode developed by the disabled people with vision defects, hearing loss and mobility impairment, especially the blind people and the like who cannot see eyes; the visually impaired people need to browse the web pages by aid of auxiliary equipment, such as a screen reader, and the screen reader can read aloud or output braille. When the barrier-free mode is started in the intelligent device (such as a smart phone, a personal computer and the like), a screen reading function can be realized, that is, after the barrier-free function is started in the intelligent device, any element is touched on the screen (or called a terminal screen, a display screen and the like) of the intelligent device, a voice prompt is output to broadcast the touched element, such as broadcasting the type, the function and the like of the touched element.
The unobstructed screen reading may include: and identifying the content contained in the page, and outputting voice matched with the identified content in a voice broadcasting mode, wherein the voice can be used for describing the semantics of the identified content. Since most of information on the internet is presented in a visual manner, the barrier-free screen reading function has important significance for visually impaired people. For example: under the scene that the visually impaired people browse the webpage by adopting the browser, the webpage content on the webpage can be read based on the barrier-free screen reading function, and the webpage content is played in a voice broadcasting mode, so that the visually impaired people can be helped to conveniently acquire the webpage content contained in the webpage. And the following steps: under the scene of collaborative office by using online documents, the visually impaired people can read the document content in the online documents based on the barrier-free screen reading function and broadcast the document content in a voice way, so that the visually impaired people can conveniently conduct office and communication through the Internet; wherein, the online document is a document tool which can be edited, checked and cooperated by multiple persons online. Another example is: under the scene that the visually impaired people browse the service interface of any client by using the intelligent equipment (such as a smart phone), the page content in the service interface can be read based on the barrier-free screen reading function. The unobstructed screen reading relates to a voice processing technology in the field of artificial intelligence (Artificial Intelligence, AI), and specifically, the page content identified by the unobstructed screen reading function can be output in a voice manner through the voice processing technology.
In order to realize that a target page element (such as any content in the target page, such as a key, a word, an icon and the like) in the target page can be read without barriers, description information needs to be added to the target page element by adopting a non-barrier tag attribute in the process of writing a source code (or simply called a code) for the target page, so that a display platform can identify a tag to which the non-barrier tag attribute (or simply called a tag attribute) belongs when an executable file (such as a file for rendering the target page) corresponding to the source code of the target page is operated, and acquire the description information added by the non-barrier tag attribute as the target page element, thereby realizing voice broadcasting of the description information of the target page element. The following description describes a number of points to be noted, wherein: (1) the barrier-free tag attribute may be simply referred to as a tag attribute, and is used for indicating that the display platform outputs a trigger prompt when detecting that the target page element is triggered. (2) The executable file (or called executable code segment) corresponding to the source code is obtained by adopting weback rule to package the source code; weback is a static module packaging tool for JavaScript applications; when the weback processes an application program, it constructs a dependency graph (dependency graph) internally from one or more entry points, and then combines each module required in the project into one or more executable files (such as bundles or Jsbundle, a js file packaged by the weback can be directly executed by a browser or android or ios), where the one or more executable files are all static resources for rendering a display page. (3) The description information added to the target page element mentioned above may be information that semantically describes the target page element, for example, if the target page element is a button for activating a member, the description information added to the target page may include "activating a member" and "button"; when the display platform recognizes the barrier-free tag attribute written for the target page, voice broadcasting can be performed according to the description information added for the target page (if the broadcasting content is that a member key is opened), so that a visually impaired person can know the page elements touched by the visually impaired person in time, and the visually impaired person can browse the target page.
It is found through practice that, since the page development standards followed by different display platforms are not the same, such as android, IOS platforms generally follow the standard given by act-native, i.e. the standard defined by facebook, while web (or H5) platforms generally follow the W3C standard (World Wide Web Consortium ); the method and the device enable the development of the same target page to be carried out by adopting page development standards followed by different display platforms, and carry out barrier-free marking on target page elements to be barrier-free screen reading in the target page, in particular to carry out barrier-free marking by adopting barrier-free tag attributes of different page development standards. For example: if a target page element to be subjected to barrier-free screen reading exists in the target page and the target page is required to be rendered and displayed in different display platforms, when a cross-platform technology (such as the aforementioned Hippy frame or the aforementioned act-active frame) is adopted as a target page development source code, barrier-free labeling is required to be carried out on the target page element according to page development standards followed by different display platforms, so that source codes corresponding to the display platforms are obtained; when each display platform needs to display the target page, the target page can be rendered and displayed by adopting executable files corresponding to various source codes, and then the indiscriminate bystander effect (such as voice broadcasting effect) of the target page elements in the target page by different display platforms can be realized.
The variability of the standard is developed for the page followed by the different display platforms described above, such as allowing the android, IOS end that originally followed the react-native standard to run on the H5 standard, or allowing the H5 end that followed the W3C standard to run on the android, IOS standard. The embodiment of the application provides a page processing scheme, which designs an unobstructed script (or called a rule script) that can be used as a plug-in of weback; namely, the embodiment of the application designs a weback script plug-in, and the weback script plug-in is used for smoothing the differences of page development standards followed by different display platforms. Specifically, when source codes written for a target page by adopting a cross-platform framework enter weback for packaging, the source codes can be preprocessed by adopting a designed barrier-free script, and then the preprocessed source codes are packaged to generate executable files of the source codes.
In a specific implementation, the general principle of preprocessing source code created for a target page using barrier-free scripts may include: if the source code contains a first tag attribute written for a target page element in the target page based on a page development specification (such as a W3C standard) followed by a first display platform (such as an H5 platform), after identifying a target tag to which the first tag attribute belongs in the source code, setting a second tag attribute which can be identified by a second display platform (such as an android or IOS platform) in the target tag, and obtaining a new source code. The first tag attribute and the second tag attribute are barrier-free tag attributes under different page development standards, for example, the first tag attribute is a tag attribute in the page development standard followed by the first display platform, and the second tag attribute is a tag attribute in the page development standard followed by the second display platform; by adding the second tag attribute which can be identified by the second display platform into the source code written based on the page development specification followed by the first display platform, a new source code which can be operated by the second display platform can be obtained, so that a developer can obtain corresponding source codes of different display platforms by developing a set of source codes based on the page development specification of one display platform, the indifferent trigger prompt of different display platforms to target page elements is achieved, the workload of tag attribute labeling is reduced, and the coding efficiency is improved.
It should be noted that, according to different page development standards, weback packing rules adopted when source codes are packed are different; for example, if the source code is developed according to the page development standard followed by the H5 platform, the source code is packaged by adopting the weback rule of H5 to obtain an executable code segment after the source code is packaged; for another example, if the source code is developed using the Hippy framework, the source code is packaged according to the weback rule of Hippy, so as to obtain the executable code segment after the source code is packaged. Furthermore, according to the difference of the weback packing rules, the barrier-free script plug-ins designed in the weback are also different; in order to unify three ends (such as iOS, android and Web), in the embodiment of the application, a page development standard is taken as a W3C standard followed by Web, that is, weback is taken as an example of a packing rule for packing source codes under the W3C standard, and an unobstructed script is designed; in the implementation manner, in the process of packing the source code by adopting the weback of the W3C standard, the barrier-free script can adjust the barrier-free tag attribute in the source code (such as the code created for the target page) developed by adopting the W3C standard to obtain a new source code, and when the executable code segment of the new source code after packing is operated by the android or IOS terminal, barrier-free screen reading can be carried out on the target page element in the target page.
Of course, if the page development standard is the exact-native standard followed by android and IOS, that is, weback is an example of a packing rule for packing source codes under the exact-native standard, when the barrier-free script is designed, in this implementation manner, in the process of packing the source codes by using weback of the exact-native standard, the barrier-free script can adjust the barrier-free tag attribute in the source codes (such as the code created for the target page) developed by using the exact-native standard, so as to obtain a new source code, and when the executable code fragment after packing the new source code is run by the H5 end, barrier-free screen reading can be performed on the target page element in the target page. The embodiments of the present application will be described by taking, as an example, a scenario designed based on the W3C standard followed by the Web as an example, but the embodiments of the present application are not limited thereto, and are specifically described herein.
The page processing scheme provided by the embodiment of the application can be executed by computer equipment, and the computer equipment can refer to a development terminal used by a developer or a background server corresponding to the development terminal used by a development human eye. An exemplary barrier-free annotation scenario is illustrated in fig. 1, where a developer only needs to develop a set of source codes for a target page based on the page development standard of the first display platform in a development tool (e.g., hippy framework) in the development terminal 101, as shown in fig. 1; then, packing the source code by adopting weback corresponding to the type (such as H5) of the source code to obtain an executable file adapted to the first display platform; meanwhile, in the process of packaging the source codes by adopting the weback corresponding to the second display platform, the source codes can be preprocessed by adopting the unobstructed script to obtain new source codes, and then the executable file adapted to the second display platform is obtained based on the new source codes. The development terminal 101 may send the executable file adapted to the first display platform and the executable file adapted to the second display platform to the server 102 for storage, so as to implement publishing of the executable file adapted to the first display platform and the executable file adapted to the second display platform. The terminal device 102 used by the visually impaired can obtain the published executable file adapted to the first display platform and the published executable file adapted to the second display platform from the server 103, and can render and display the target page by adopting the corresponding executable file according to the type of the display platform. Through the above process, when the embodiment of the application is implemented, a developer only needs to develop a set of source codes based on the page development standard followed by one display platform, so that executable files matched with other display platforms can be obtained, multiple ends are kept uniform on the code level, the workload of the developer is reduced, multiple display platforms can be compatible, and the compatibility is improved.
It should be noted that, when the embodiments of the present application are applied to specific products or technologies, for example, in the process of rendering and displaying a target page based on executable files, if user data (such as related data of a nickname, an account number, a gender, etc. of a user) is inevitably required to be acquired, user permission or consent is required to be obtained, and the collection, use and processing of the related data are required to comply with related laws and regulations and standards of related countries and regions.
Based on the above-described page processing scheme, the embodiments of the present application provide a more detailed page processing method, and the detailed description of the page processing method provided by the embodiments of the present application will be given below with reference to the accompanying drawings.
FIG. 2 is a flow chart illustrating a method for processing a page according to an exemplary embodiment of the present application; the page processing method may be performed by a computer device, and may include, but is not limited to, steps S201-S203:
s201: the source code of the target page is obtained.
The source code of the target page refers to: a set of codes written for a target page by a developer; the page template and the page data of the target page are set in the code, such as the style of the page template and the acquisition path of the page data of the target page written in the code. The page data refers to contents or elements contained in the target page, such as text, rich text, pictures, links, audios and videos, keys and the like; the page template is an organization form of page data and can be simply understood as a template for displaying the page data; the page data and the page template are combined to obtain a complete page. Specifically, if the source code created for the target page is developed using a cross-platform technique, the source code created for the target page supports cross-platform operation in different display platforms. For example: the source code is written by adopting a Hippy framework, so that the source code supports cross-platform operation in the first display platform and the second display platform; the first display platform and the second display platform are different display platforms, and the specific implementation is that the page development standard followed by the first display platform is different from the page development standard followed by the second display platform. For convenience of explanation, in the embodiment of the present application, the different display platforms include a first display platform and a second display platform, where the first display platform is a web platform, and the second display platform is an android or IOS platform for example, which is specifically described herein.
As described above, when the target page includes the target page element requiring barrier-free screen reading, in the process of writing the source code for the target page by using the cross-platform technology, the barrier-free tag attribute is added to the target page element by using the page development standard followed by the display platform, so as to start the barrier-free screen reading of the target page element. For example, in the process of writing the source code of the target page, the page development specification followed by the first display platform is adopted to set the barrier-free tag attribute for the target page element in the target page, so that the written source code contains the first tag attribute (such as the barrier-free tag attribute belonging to the page development specification followed by the first display platform) written for the target page element in the target page based on the page development specification followed by the first display platform. When the first display platform operates the executable file rendering display corresponding to the source code to obtain a target page, if a target page element in the target page is triggered (e.g. touched or touched) and the terminal equipment is in an unobstructed mode, a trigger prompt corresponding to the target page element can be output, and at the moment, the trigger prompt is used for prompting the description information of the target page element, so that visually impaired people can know the content in the target page in time.
Further, the trigger prompt may include a somatosensory prompt in addition to the descriptive information indicating the target page element, such as when the target page element is triggered, the outputted somatosensory prompt may include, but is not limited to: vibration generated by the terminal device, a prompting sound effect (such as a prompting bell), and the like, and in this implementation manner, the terminal device may not be in an unobstructed mode. That is, when the terminal device is not in the barrier-free mode, the embodiment of the application still supports that when the target page element is triggered, the somatosensory prompt described above is output to prompt the user that the target page element is currently being triggered. For convenience of explanation, the following description will take the example that the trigger prompt includes description information for prompting the target page element.
It should be noted that, the types of tag attributes (i.e., barrier-free tag attributes) in the page development standards followed by different display platforms are rich; the embodiment of the application mainly takes three-terminal unification as an example of a tag attribute aria-label field (or attribute) and a roles field (or attribute) in the W3C standard. That is, in the embodiment of the present application, the first display platform is used as a Web platform, the page development standard followed by the Web platform is the W3C standard, and the tag attribute in the W3C standard includes an aria-label field and a roles field; correspondingly, the second display platform is an android or IOS platform, the page development standard followed by the android or IOS platform is a standard given by the action-native, and the tag attribute contained in the standard given by the action-native comprises an accessability Label field and an accessable field as examples to introduce barrier-free labeling of target page elements in the source code.
Wherein: (1) the aria-label attribute is an H5 front-end tag attribute and can be used for adding tag description to the target page element, wherein the tag description is used for semantically describing the target page, and the tag description can be specifically semantic description information aiming at a function which can be triggered by the target page element; the aria-label attribute accepts a string as a parameter, and tags an element (e.g., a target page element) in a non-visual manner. (2) The roles attribute is an H5 front end tag attribute that can be used to define element roles, i.e., styles for defining elements. For example: the element role of the target page element is a button role, and when the attribute value of the roles attribute is button, the button role is used for identifying the style in which the target page element is a button. And the following steps: if the element role of the target page element is a list role, when the attribute value of the roles attribute is a list, the list role can be used for identifying the target page element as a style of the item list. When the aria-label attribute and the roles attribute are combined, the output bystander mode can more accurately express the information of the target page element, so that the visually impaired can better understand the page content in the target page. (3) The accessable attribute is an attribute set for the H5 label in the cross-platform technology; when the attribute value of the accessable attribute is true, the touched content (or called view) in the target page is an element with the barrier-free screen reading function enabled. (4) The accessability Label attribute is an attribute set for the H5 label in the cross-platform technology; for giving target pages The tag description comprises semantic description information of a function which can be triggered by the target page element and description information of an element role of the target page element, namely, an attribute value accepted by the accessibilitieLabel attribute can be obtained by splicing an attribute value of the aria-label attribute and an attribute value of the role attribute, otherwise, the attribute value of the aria-label attribute and the attribute value of the role attribute can be obtained by splitting the attribute value of the accessibilitieLabel attribute 。
Based on the above-described exemplary tag attributes, taking an element role of a target page element in a target page as a button and a function triggered by the target page element as an opening member as an example, respectively giving code fragments for performing barrier-free annotation on the target page element according to the android and web-recognizable tag attributes; wherein:
the code segments obtained by performing barrier-free annotation on the target page element according to the web identifiable tag attribute (which can be called as a first tag attribute in the embodiment of the application) in the cross-platform technology are as follows:
the method comprises the steps that an aria-label attribute defines a function which can be triggered by a target page element, namely an attribute value "open member" of the aria-label attribute is semantic description information which can trigger the function for the target page element; the roles attribute defines that the element role of the target page element is a button (button) role, i.e., the presentation style of the target page element in the target page is a button. If the code segments are packaged into executable code segments (jsbundle) through weback (such as a packaging rule corresponding to the first display platform), when the first display platform (such as a web browser for opening a target page) is running the executable code segments, the first display platform can read attribute values of an aria-label attribute and a role attribute, so that when a terminal device (such as a device running the web browser) opens an unobstructed mode and moves a cursor to a display area where a target page element is located, the terminal device can output a trigger prompt corresponding to the target page element according to the attribute value of the aria-label attribute and the attribute value of the role attribute, such as a trigger prompt being an "open member button".
Similarly, in the cross-platform technology, the code segments obtained by performing barrier-free labeling according to the android identifiable tag attribute (which can be called as a second tag attribute in the embodiment of the application) as the target page element are as follows:
the accessable attribute defines that the target page element is marked as an element requiring barrier-free screen reading, namely when the attribute value of the accessable attribute is true, the marked target page element is marked as the element requiring barrier-free screen reading; that is, when the cursor moves to the display area where the target page element is located, the trigger prompt matched with the target page element needs to be played. The accessibilitylabel attribute defines the element roles and the triggered functions of the target page element, for example, the attribute value of the accessibilitylabel attribute is an "open member button", the function triggered by the target page element is an open member, and the style presented by the target page element in the target page is a button. If the code segments are packaged into executable code segments (jsbundle) through weback (such as a packaging rule corresponding to the second display platform), when the second display platform (such as a client installed in an android system and used for opening a target page) runs the executable code segments, the second display platform can read the attribute value of the accessable attribute and the attribute value of the accessable attribute, so that when the terminal device opens the barrier-free mode and moves the cursor to the display area where the target page element is located, the terminal device can output a trigger prompt corresponding to the target page element according to the attribute value of the accessable attribute and the attribute value of the accessable attribute, for example, the trigger prompt is "open member button".
Based on the above description, the obtained source code of the target page only includes tag attributes written for target page elements in the target page based on a page development standard followed by a display platform, for example, the source code only includes first tag attributes (such as an aria-label attribute and a roles attribute) written for target page elements in the target page based on a page development standard (W3C standard) followed by a first display platform (such as a web platform). In order to enable a set of source codes developed for a target page to be operated on other display platforms (such as a second display platform) and enable barrier-free screen reading of target page elements in the target page to be achieved, in the embodiment of the present application, after the source codes of the target page are obtained, step S202 is continuously executed.
S202: and identifying the target label to which the first label attribute belongs in the source code, and setting a second label attribute which can be identified by the second display platform in the target label to obtain a new source code.
In the specific implementation, after the source code of the target page is acquired, weback can be adopted to package the source code; for example, the source code is a source code belonging to H5 code, i.e. written based on a page development standard followed by a web platform (such as a first display platform), and after the source code is acquired, the source code may be packaged by using a weback rule corresponding to a second display platform (such as an android or IOS platform), so that the second display platform may render and display a target page based on executable code segments obtained by the packaging. As described above, the weback corresponding to the second display platform includes the barrier-free script plug-in, and when the source code is used as the input information of the barrier-free script plug-in, the barrier-free script plug-in can detect whether the source code includes the target tag to which the first tag attribute belongs; specifically, the barrier-free script plug-in is matched with the attribute value of the first tag attribute in the target tag regularly; so-called regular matches, or regular expressions, are typically used to retrieve or replace text that meets certain rules or patterns, such that the first tag attribute may be identified in the source code by the regular matches.
For example: if the source code comprises the following code segments:
then, the barrier-free script can be regularly matched with the attribute value of the aria-label attribute and the attribute value of the roles attribute contained in the target tag < div/>, the target page element in the target page is set to be an element needing barrier-free screen reading, and the barrier-free script can acquire and store the attribute value of the aria-label attribute and the attribute value of the roles attribute.
Further, when the target tag to which the first tag attribute belongs is identified from the source code, it means that when the developer develops the source code of the target page, the target page element in the target page is set to be an element requiring barrier-free screen reading, and when the executable file obtained by packing the source code by adopting the weback rule corresponding to the first display platform is operated by the first display platform, if the display area where the target page element is located is touched, a trigger prompt can be output to prompt the content of the target page element touched by the visually impaired person. In order to enable the executable file obtained by packing the source code by adopting the weback rule corresponding to the second display platform to be operated by the second display platform, if the display area where the target page element is located is touched, a trigger prompt can also be output, a second tag attribute for identifying the second tag attribute is required to be set in the source code, so that barrier-free labeling of the target page element by adopting the page development standard followed by the second display platform is realized. The implementation manner of setting the second tag attribute of the second tag attribute identification in the source code may include: and setting a second tag attribute which can be identified by the second display platform in the identified target tag.
Wherein the process of setting the second tag attribute recognizable by the second display platform in the target tag may include: firstly, acquiring a first attribute value of a first tag attribute which is identified from source codes, and determining a second tag attribute which can be identified by a second display platform; secondly, generating a second attribute value of the second tag attribute according to attribute rules of the first tag attribute and the second tag attribute; and finally, setting a second label attribute and a second attribute value in the target expression to obtain a new source code. It should be noted that, the second tag attribute is determined according to the first tag attribute, specifically, the meaning expressed by the description information added by the second tag attribute for the target page element should be consistent with the meaning expressed by the description information added by the first tag attribute for the target page element.
The method comprises the steps of providing two realization modes of setting a second tag attribute which can be identified by a second display platform in a target tag according to different page development standards followed by the display platform by taking a function which can be triggered by a target page element as an opening member and taking an element role of the target page element as a button, wherein:
1) The page development standard followed by the first display platform is the W3C standard, and the page development standard followed by the second display platform is the standard given by react-native. The first tag attribute comprises an element function attribute and an element role attribute, wherein the element function attribute is used for setting description information of a function executed after the target page element is triggered, and the element role attribute is used for setting description information of a style presented by the target page element. The first display platform described above is a web platform, and the page development standard followed by the first display platform is a W3C standard, where the W3C standard indicates that the first tag attribute includes an aria-label attribute (i.e., an element function attribute) and a roles attribute (i.e., an element role attribute). Similarly, the page development specification followed by the second display platform indicates that the second tag attribute includes a function starting attribute and an element description attribute, the function starting attribute is used for setting whether the display platform outputs a trigger prompt when detecting that the target page element is triggered, and the element description attribute is used for setting description information of functions and styles of the target page element. The second display platform described above is an android platform or an IOS platform, and the page development standard that it follows is a standard given by react-native, where the standard given by react-native indicates that the second tag attribute includes an accessable attribute (function initiation attribute) and an accessable attribute (element description attribute).
In a specific implementation, first, a function attribute value of an element function attribute and a role attribute value of an element function role attribute may be obtained. Then, according to the attribute rule of the second tag attribute, splicing the function attribute value and the role attribute value to obtain a spliced character string; then the splice string may be determined to be a second attribute value for a second tag attribute. Finally, adding a function starting attribute in the target label, and setting an attribute value of the function starting attribute as function starting information, wherein the function starting information indicates that the target page element is set as an element capable of triggering prompt; and adding the element description attribute in the target label, and determining the spliced character string as an attribute value of the element description attribute. In the implementation process, the spliced character string obtained by splicing the function attribute value and the role attribute value is used as a second attribute value and is determined according to the attribute rule of the second tag attribute; when the second tag attribute includes an accessable attribute and an accessable attribute, the attribute rule of the second tag attribute defines a composition rule of a second attribute value of the second tag attribute, for example, the second tag attribute is an accessable attribute, and then the attribute rule of the second tag attribute may be used to define that the second attribute value of the second tag attribute is formed by an element role of the target page element and a function that can be triggered by the target page element; for example, if the function triggered by the target page element is "open member" and the element role of the target page element is "button", the attribute value of the accessibilitylabel attribute is "open member button".
The process of setting the second tag attribute in the target tag, which can be recognized by the second display platform, is described in more detail below in conjunction with specific codes; assume that a code segment in source code for barrier-free annotation of a target page element in a target page is as follows:
then the attribute values "open member" of the aria-label attribute and the attribute values "button" of the roles attribute will be acquired and stored; and then according to the attribute rule of the second tag attribute, splicing the attribute value of the aria-label attribute and the attribute value of the roles attribute, and specifically splicing according to the semantic relation between the two attribute values to obtain a spliced character string of 'open session button'. The semantic relationship between two attribute values may be used to define a concatenation order of concatenation of the two attribute values, for example, a concatenation order indicated by a semantic relationship between an attribute value "open member" of an aria-label attribute and an attribute value "button" of a roles attribute is: the attribute value "open member" is spliced before the attribute value "button", but not before the attribute value "button" is spliced before the attribute value "open member".
Further, adding an accessable attribute and an accessability attribute in the target tag < div/>; and setting the attribute value of the accessable attribute as function starting information (such as true) according to the acceptable parameters of the accessable attribute and the accessable attribute, wherein the function starting information indicates that the target page element is set as an element capable of triggering prompt, and determining the spliced character string obtained by splicing as the attribute value of the accessibilityl abel attribute to obtain a new source code. The new source code comprises the following code segments:
As shown in the new source code, the new source code is added with a second tag attribute and a second attribute value which can be identified by the second display platform, namely, an accessable attribute, an attribute value "true" of the accessable attribute, an accessable attribute and an attribute value "open member button" of the accessable attribute, compared with the source code developed by a developer. If the new source code is packaged to obtain an executable code segment, when the second display platform runs the executable code segment to render and display a target page, and a target page element in the target page is touched, a trigger prompt (or prompt audio) of the target page element can be output to turn on a member button.
It should be noted that, in addition to adding or adding a second tag attribute that can be identified by the second display platform in the target tag of the source code, the embodiment of the present application further supports replacing the first tag attribute with the second tag attribute in the target tag, so as to achieve the objective of performing barrier-free labeling on the target page element by adopting the page development standard followed by the second display platform. Specifically, after acquiring a spliced character string "member opening button" spliced by an attribute value "member opening" based on an aria-label attribute and an attribute value "button" of a role attribute, deleting the aria-label attribute, the role attribute, the attribute value "member opening" of the aria-label attribute and the attribute value "button" of the role attribute from a target label; and, an accessable attribute, an attribute value "true" of the accessable attribute, an accessable property, and an attribute value "open member button" of the accessable property are added to the target label. In this implementation, the obtained new source code includes the following code segments:
A flow diagram of the implementation manner of the above description is given below through fig. 3, and as shown in fig. 3, the source code includes writing the first tag attribute for the target page element in the target page based on the page development standard followed by the first display platform; after the source code enters the barrier-free script for processing, the second label attribute which can be identified by the second display platform can be set in the target label, and then a new source code is obtained.
2) The page development standard followed by the first display platform is a standard given by react-native, and the page development standard followed by the second display platform is a W3C standard. The first tag attribute comprises a function starting attribute and an element description attribute, wherein the function starting attribute is used for setting whether a trigger prompt is output when the display platform detects that the target page element is triggered, and the element description attribute is used for setting description information of functions and styles of the target page element. The first display platform described above is an android platform or an IOS platform, and the page development standard that the first display platform follows is a standard given by react-native, where the standard given by react-native indicates that the first tag attribute includes an accessable attribute (function initiation attribute) and an accessable attribute (element description attribute). Similarly, the page development specification followed by the second display platform indicates that the second tag attribute includes an element function attribute and an element role attribute, the element function attribute is used for setting description information of a function executed after the target page element is triggered, and the element role attribute is used for setting description information of a style presented by the target page element. The second display platform described above is a web platform, and the page development standard that it follows is the W3C standard, where the W3C standard indicates that the second tag attribute includes an aria-label attribute (i.e., an element function attribute) and a roles attribute (i.e., an element role attribute).
In the specific implementation, firstly, the attribute value of the function starting attribute can be obtained, and if the attribute value of the function starting attribute is the function starting information, the attribute value of the element description information is obtained; then, according to the attribute rule of the second tag attribute, splitting the attribute value of the element description attribute to obtain a function attribute value and a role attribute value; and determining the function attribute value and the role attribute value as a second attribute value of the second tag attribute. After a second attribute value of the second tag attribute is obtained, adding the element function attribute into the target tag, and determining the function attribute value as an attribute value of the element function attribute; and adding the character attribute of the element in the target label, and determining the character attribute value as the attribute value of the character attribute of the element. In the implementation process, splitting the attribute value of the element description attribute is determined according to the attribute rule of the second tag attribute; when the second tag attribute includes an aria-label attribute and a role attribute, at this time, an attribute rule of the second tag attribute defines an attribute value acceptable by the aria-label attribute and the role attribute, for example, the aria-label attribute defines that the attribute value acceptable by the aria-label attribute is descriptive information of a function that can be triggered by the target page element, and the role attribute defines that the attribute value acceptable by the role attribute is an element role of the target page element. For example, if the function triggered by the target page element is "on member" and the element role of the target page element is "button", the attribute value of the aria-label attribute is "on member" and the attribute value of the roles attribute is "button".
The process of setting the second tag attribute in the target tag, which can be recognized by the second display platform, is described in more detail below in conjunction with specific codes; assume that a code segment obtained by the barrier-free annotation of a target page element in a target page in a source code is as follows:
acquiring and storing an attribute value of ac cessibilitylabel attribute as an "open member button" when the acquired attribute value of the accessable attribute is determined to be "true"; and then splitting the attribute value opening member button of the accessibiliticabel attribute according to the attribute rule of the second tag attribute, and particularly splitting according to the semantic meaning of the attribute value of the accessibiliticabel attribute to obtain the split function attribute value opening member and role attribute value button. The semantics of the attribute value of the accessibilitiylabel attribute may be used to specify a rule for splitting the attribute value of the accessibilitiylabel attribute, for example, when the attribute value of the accessibilitylabel attribute is "open member button", the "open member" should be split into one character string according to the semantics of the attribute value, and the "button" is split into one character string, instead of being split into two character strings, namely "open member" and "member button".
Further, an aria-label attribute and a roles attribute are added in a target tag < div/>, a function attribute value is determined to be an attribute value of the aria-label attribute, and a role attribute value is determined to be an attribute value of the roles attribute, so that a new source code is obtained. The new source code comprises the following code segments:
as shown in the new source code, compared with the source code written by the developer, the new source code is added with a second label attribute and a second attribute value which can be identified by the second display platform, namely, an attribute value of an aria-label attribute, an opening member, a role attribute and an attribute value of a role attribute, namely, a button, are added. If the new source code is encoded to obtain an executable code segment, when the second display platform runs the executable code segment to render and display a target page, and a target page element in the target page is touched, a trigger prompt (or prompt audio) of the target page element can be output to turn on a member button.
Similar to the related description, the embodiment of the application supports the adoption of the second tag attribute to replace the first tag attribute in the target tag in addition to the new or added second tag attribute which can be identified by the second display platform in the target tag of the source code, so as to achieve the aim of performing barrier-free marking on the target page element by adopting the page development standard followed by the second display platform. Specifically, when the attribute value of the acquired accessable attribute is determined to be true, splitting an attribute value of an opening member button of the acquired accessable attribute to obtain a function attribute value of an opening member and a role attribute value of a button; and deleting the accessable attribute, the attribute value "true" of the accessable attribute, the attribute value "open member button" of the accessable attribute and the accessable attribute, and adding the aria-label attribute, the roles attribute, the attribute value "open member" of the aria-label attribute and the attribute value "button" of the roles attribute. In this implementation, the obtained new source code includes the following code segments:
A schematic flow chart of the implementation manner of the foregoing description is given in fig. 4, and the specific implementation flow refers to the foregoing description and is not repeated herein.
Through the process, the source code developed based on one display platform can be quickly modified into a new source code which can be identified by other display platforms by adopting the barrier-free script, so that the encoding workload is reduced, and the barrier-free labeling efficiency of target page elements is improved. And according to different page development standards, different barrier-free scripts can be created to modify source codes developed based on different page development standards, so that the barrier-free marking modification requirements corresponding to various page development standards are met.
S203: and generating an executable file adapted to the second display platform based on the new source code.
Based on the implementation shown in steps S201-S202, new source code may be obtained. The embodiment of the application supports the packaging processing of the new source code to obtain the executable file adapted to the second display platform. Specifically, a weback rule corresponding to the second display platform is adopted to package the new source code, so as to obtain an executable file adapted to the second display platform. When the executable file matched with the second display platform is released, the second display platform responds to an opening instruction for opening the target page, the executable file matched with the second display platform can be obtained, and the executable file is operated to render the target page. If the terminal device displaying the target page opens the barrier-free mode, when the target page element in the target page is touched, the terminal device can output a trigger prompt of the target page element (if the trigger prompt is an open member button), so that the visually impaired people can know the content of the triggered element in time.
In the embodiment of the application, the source code created for the target page can be obtained, and when the source code contains the first tag attribute written for the target page element in the target page based on the page development specification followed by the first display platform, the second tag attribute which can be identified by the second display platform can be set in the target tag to which the first tag attribute belongs, so that the new source code is obtained. By adding the second tag attribute which can be identified by the second display platform into the source code written based on the page development specification followed by the first display platform, a new source code which can be operated by the second display platform can be obtained, so that a developer can obtain corresponding source codes of different display platforms by developing a set of source codes based on the page development specification of one display platform, the indifferent trigger prompt of different display platforms to target page elements is achieved, the workload of tag attribute labeling is reduced, and the coding efficiency is improved.
FIG. 5 is a flow chart illustrating a method for processing a page according to an exemplary embodiment of the present application; the page processing method may be performed by a computer device, and may include, but is not limited to, steps S501-S514:
S501: the source code of the target page is obtained.
S502: and packing the source codes according to webck rules corresponding to the first display platform to generate an executable file adapted to the first display platform.
S503: and responding to the request for triggering the display of the target page, and rendering the display target page according to the executable file.
S504: and when the target page element in the target page is triggered, playing a trigger prompt matched with the target page element.
In step S501-S504, if the obtained source code of the target page includes a first tag attribute written for a target page element in the target page based on a page development specification followed by the first display platform, it indicates that the source code is written using the page development specification followed by the first display platform; in this implementation manner, the weback rule corresponding to the first display platform may be used to package the source code, so as to obtain an executable file (or called an executable code segment) adapted to the first display platform. Further, the executable file adapted to the first display platform may be added to a package of the target application program, and when responding to an issue instruction for the package of the target application program, issue the package of the target application program, so that the terminal device installs the target application program based on the package of the target application program. The target application mentioned above is any application program (or simply referred to as an application) including a target page, that is, the target page is any service page in the target application program.
When the vision-impaired person triggers to display the target page contained in the target application program through the first display platform, an executable file which is matched with the first display platform and related to the target page can be obtained from a program package of the target application program, and therefore the terminal equipment runs the executable file to render and display the target page. For example, the first display platform is a web platform, when the vision-impaired person opens the target page by using the browser, the browser can acquire an executable file adapted to the web platform from a program package of the target application program, and run the executable file to render the target page.
Operating an executable file adapted to the first display platform, wherein the obtained target page contains target page elements marked as a target page element requiring barrier-free screen reading; when the target page element (or the display area where the target element is) in the target page is touched (such as by a finger, an electronic pen, a cursor, etc.), the semantic description information of the target page element can be obtained, and the semantic description information is played, so that the triggering prompt of the target page element is realized.
The trigger prompt corresponding to the target page element may include prompt audio matched with semantic description information of the target page element, where the semantic description information is used to describe the target page element semantically. The semantic description information includes at least one of: description information of a style presented to the target page element, description information of a function executed by the target page element triggered, and description information of an object contained in the target page element; the style of the target page element presentation may include a list, a key, a picture, etc., the functions executed after the target page element can be triggered may include return, confirm, cancel, etc., the object contained in the target page element may refer to a category individual contained in the target page element, for example, the target page element is an image, and the object contained in the image may be a cat, a person, an umbrella, a sofa, etc.
Further, after the semantic description information of the target page element is obtained, the prompt audio matched with the semantic description information of the target page element can be played in a voice broadcasting mode, so that visually impaired people can understand the semantic to be expressed by the target page element through hearing. Wherein the alert audio that matches (or corresponds to) the semantic description information may be used to alert at least one of: a style for prompting presentation of the target page element (the corresponding semantic description information of which comprises description information of the style presented by the target page element), a function for prompting execution of the target page element by triggering (the corresponding semantic description information of which comprises description information of the function executed after triggering of the target page element), and an object for prompting inclusion of the target page element (the corresponding semantic description information of which comprises description information of the object included by the target page element).
A scene schematic diagram of a trigger prompt for displaying a target page through a first display platform and outputting target page elements matched with each other is given below by combining with FIG. 6; as shown in fig. 6, the developer writes the source code for the target page according to the page development specification followed by the first display platform, where the source code includes a first tag attribute written for a target page element in the target page. Then, packing the source codes by adopting weback rules corresponding to the first display platform to generate an executable file matched with the first display platform; and then issuing the executable file. When the visually impaired triggers to display the target page through the first display platform (such as inputting the website of the target page in the browser), the executable file adapted to the first display platform is obtained, and the target page 601 is rendered based on the executable file adapted to the first display platform. When the vision-impaired person touches the target page element 602 in the target page 601, semantic description information of the target page element 602 is obtained, and a trigger prompt 603 matched with the target page element 602 is played according to the semantic description information, if the played trigger prompt 603 is an "open member button", the vision-impaired person can know the function and the presentation style which can be triggered by the target page element in time.
S505: and packing according to weback rules corresponding to the second display platform, and processing the source code by entering an unobstructed script.
S506: whether the target tag contains the first tag attribute is detected.
S507: if the target tag contains the first tag attribute, a first attribute value of the first tag attribute is obtained, and a second attribute value of the second tag attribute is generated according to the first attribute value and the attribute rule of the second tag attribute.
S508: and setting a second tag attribute and a second attribute value in the target tag.
S509: and continuously packaging the new source codes to generate executable files adapted to the second display platform.
S510: and responding to the request for triggering the display of the target page, and rendering the display target page according to the executable file.
S511: and when the target page element in the target page is triggered, playing a trigger prompt matched with the target page element.
In step S505-S511, if the obtained source code of the target page includes a first tag attribute written for a target page element in the target page based on a page development specification followed by the first display platform, it indicates that the source code is written using the page development specification followed by the first display platform; in this implementation manner, the embodiment of the application further supports the adoption of weback rules corresponding to the second display platform to package the source code. In the specific implementation, in the packaging process, a barrier-free script is adopted to process the source code, specifically, whether a target tag to which a first tag attribute belongs in the source code is judged, if the source code contains the target tag to which the first tag attribute belongs, which indicates that a developer marks a target page element as an element needing barrier-free screen reading when encoding the target page, the steps S507-S508 are continuously executed by adopting the barrier-free script, and a new source code is obtained; the specific implementation process shown in steps S507-S508 may refer to the description of the specific implementation process shown in step S202 in the embodiment shown in fig. 2, which is not repeated herein.
Further, the executable file adapted to the second display platform may be added to a package of the target application program, and when responding to an issue instruction for the package of the target application program, issue the package of the target application program, so that the terminal device installs the target application program based on the package of the target application program. The target application mentioned above is any application program (or simply referred to as an application) including a target page, that is, the target page is any service page in the target application program. When the vision-impaired person triggers to display the target page contained in the target application program through the second display platform, the executable file, which is matched with the second display platform and related to the target page, can be obtained from the program package of the target application program, so that the terminal equipment runs the executable file to render and display the target page. For example, the second display platform is an android platform, and when the vision-impaired person opens the target page by adopting the client (such as a target application program installed in an android mobile phone), the client can obtain the executable file adapted to the android platform and run the executable file to render to obtain the target page. When a target page element (or a display area where the target element is) in the target page is touched (such as by a finger, an electronic pen, a cursor and the like), semantic description information of the target page element can be obtained, and the semantic description information is played, so that triggering prompt of the target page element is realized.
A scene schematic diagram of a trigger prompt for displaying a target page through a second display platform and outputting target page elements matched with each other is given below by combining with FIG. 7; as shown in fig. 7, the developer writes the source code for the target page according to the page development specification followed by the first display platform, where the source code includes a first tag attribute written for a target page element in the target page. Then, packing the source codes by adopting weback rules corresponding to the second display platform to generate executable files adapted to the second display platform; and then issuing the executable file. When the vision-impaired person triggers to display the target page through the second display platform (such as through an entrance of the target page in the client), the executable file matched with the second display platform is obtained, and the target page is rendered based on the executable file matched with the second display platform. When a visually impaired person touches a target page element in the target page, semantic description information of the target page element is obtained, and a trigger prompt matched with the target page element is played according to the semantic description information, if the played trigger prompt is an 'open member button', the visually impaired person can know the function and the presented style which can be triggered by the target page element in time.
It should be noted that, the steps S501-S504, and the steps S501 and S505-S511 are two schemes that can be executed in parallel; in other words, after the source code of the target page is obtained, the embodiment of the application may respectively package the source code by adopting the weback rule corresponding to the first display platform and the weback rule corresponding to the second display platform, so as to respectively generate an executable file adapted to the first display platform and an executable file adapted to the second display platform. On the user side, according to different modes of opening the target page by visually impaired people, a corresponding executable file rendering display target page can be obtained; if the target page is opened by the visually impaired person through the browser, the executable file rendering display target page matched with the first display platform can be obtained; and if the vision-impaired person opens the target page through the client, the executable file rendering display target page matched with the second display platform can be obtained. Of course, after the source code is obtained, the source code can be packaged by adopting a weback rule corresponding to the first display platform, so as to generate an executable file adapted to the first display platform; and then adopting a weback rule corresponding to the second display platform to pack the source codes, and generating an executable file adapted to the second display platform. Or after the source code is obtained, the source code can be packaged by adopting a weback rule corresponding to the second display platform, so as to generate an executable file adapted to the second display platform; and then, packing the source codes by adopting weback rules corresponding to the first display platform to generate an executable file matched with the first display platform. The execution sequence of steps S501-S504, and steps S501 and steps S505-S511 is not limited in this embodiment.
S512: and if the target label does not contain the first label attribute, continuing to pack the source code to generate an executable file matched with the second display platform.
S513: and responding to the request for triggering the display of the target page, and rendering the display target page according to the executable file.
S514: when the target page element in the target page is triggered, the trigger prompt matched with the target page element is not played.
In step S512-S514, if the target tag does not include the first tag attribute in the process of packaging the source code by adopting the weback rule corresponding to the second display platform, which indicates that the target page element in the target page is not marked as an element requiring barrier-free screen reading when the developer writes the source code for the target page, the process of packaging the source code by adopting the weback rule corresponding to the second display platform is continued to obtain the executable file adapted to the second display platform. It will be appreciated that the executable file adapted to the second display platform herein is not the same as the executable file adapted to the second display platform described in step S509; specifically, when the user side triggers the display of the target page through the second display platform, an executable file adapted to the second display platform can be obtained, and the target page is rendered and displayed according to the executable file adapted to the second display platform; because the source code does not have the barrier-free tag attribute (such as the first tag attribute) marked for the target page element, when the target page element in the rendered target page is triggered, the target page element is not broadcasted.
It is to be understood that the trigger prompt matched with the target page element is only broadcast when the target page element in the target page is triggered after the terminal device used by the visually impaired person starts the barrier-free mode. In other words, the barrier-free screen reading function is provided with a switch item, and only the screen reading mode is started, the barrier-free screen reading function is started, so that the screen reading mode can not be started for people with non-vision disorders. Specifically, the embodiment of the application supports starting an unobstructed mode in the terminal equipment; for example, the manner in which the barrier-free mode is turned on in the IOS operating system may include: triggering a setting option in a function configuration interface, selecting an auxiliary function option, and opening a white-out switch; for another example, the method for starting the barrier-free mode in the android operating system may include: triggering a setting option in a function configuration interface, selecting an auxiliary function option, and opening a talk back switch or a white-out switch. It should be noted that, the foregoing is merely an exemplary manner of opening the barrier-free mode, and the embodiment of the present application does not limit the name and flow of the switch for opening the barrier-free mode. An exemplary interface diagram for turning on the barrier-free mode in an android operating system can be seen in fig. 8. When the barrier-free mode is started, if the barrier-free mode is started, and the barrier-free mode is started, when a target page element in the target page is touched (such as by a cursor, a finger or an electronic pen, and the like), the terminal equipment can acquire semantic description information of the target page element, and automatically report a trigger prompt (or prompt audio) matched with the target page element according to the semantic description information, so that a visually impaired person can know the content of the currently touched target page element in the target page in time.
In this embodiment, after the source code created for the target page is obtained, the source code may be packaged by using a weback rule corresponding to the first display platform and a weback rule corresponding to the second display platform, so as to generate an executable file adapted to the first display platform and an executable file adapted to the second display platform. In addition, in the process of packaging the source code by adopting the weback rule corresponding to the second display platform, a second tag attribute which can be identified by the second display platform is also set in the target tag, so that the target page element in the target page rendered according to the executable file adapted to the second display platform still supports barrier-free screen reading. The barrier-free labeling mode provided by the embodiment of the application can realize the unification of barrier-free labeling of different display platforms, namely, a developer can obtain corresponding source codes of different display platforms only by developing a set of source codes based on page development specifications of one display platform, so that the non-differential triggering prompt of different display platforms on target page elements is achieved, the workload of label attribute labeling is reduced, and the coding efficiency is improved.
The foregoing details of the method of embodiments of the present application are set forth in order to provide a better understanding of the foregoing aspects of embodiments of the present application, and accordingly, the following provides a device of embodiments of the present application.
FIG. 9 is a schematic diagram of a page processing apparatus according to an exemplary embodiment of the present application; the page processing means may be for example a computer program (including program code) running in the page processing device, for example the page processing means may be a target application (such as any application) in the page processing device; the page processing means may be adapted to perform some or all of the steps of the method embodiments shown in fig. 2 and 5. Referring to fig. 9, the page processing apparatus includes the following units:
the acquiring unit 901 is configured to acquire a source code of a target page, where the source code supports cross-platform running in a first display platform and a second display platform, and includes a first tag attribute written for a target page element in the target page based on a page development specification followed by the first display platform, where the tag attribute is used to instruct the display platform to output a trigger prompt when the target page element is detected to be triggered;
a processing unit 802, configured to identify, in the source code, a target tag to which the first tag attribute belongs, and set, in the target tag, a second tag attribute that can be identified by the second display platform, to obtain a new source code;
The processing unit 802 is further configured to generate, based on the new source code, an executable file adapted to the second display platform, where the executable file is used to render the display target page.
In one implementation, the trigger prompt includes prompt audio that matches semantic description information of the target page element, the semantic description information being used to semantically describe the target page element;
the semantic description information includes at least one of: describing information of a style presented to the target page element, describing information of a function executed after the target page element is triggered, and describing information of an object contained in the target page element;
the prompt audio is used for prompting at least one of the following: a style for prompting presentation of the target page element, a function executed after the target page element is triggered, and an object contained in the target page element.
In one implementation, the processing unit 802 is configured to set a second tag attribute that can be identified by the second display platform in the target tag, and when obtaining the new source code, specifically is configured to:
acquiring a first attribute value of a first tag attribute from the source code, and determining a second tag attribute which can be identified by a second display platform;
Generating a second attribute value of the second tag attribute according to the first attribute value and the attribute rule of the second tag attribute;
and setting a second tag attribute and a second attribute value in the target tag to obtain a new source code.
In one implementation, the page development specification followed by the first display platform indicates that the first tag attribute includes an element function attribute and an element role attribute, the element function attribute is used for setting description information of a function executed after the target page element is triggered, and the element role attribute is used for setting description information of a style presented by the target page element;
the processing unit 802 is configured to, when generating the second attribute value of the second tag attribute according to the first attribute value and the attribute rule of the second tag attribute, specifically:
acquiring a function attribute value of an element function attribute and a role attribute value of an element role attribute;
splicing the function attribute value and the role attribute value according to the attribute rule of the second tag attribute to obtain a spliced character string;
and determining the spliced character string as a second attribute value of the second tag attribute.
In one implementation, the page development specification followed by the second display platform indicates that the second tag attribute includes a function start attribute and an element description attribute, the function start attribute is used for setting whether the display platform outputs a trigger prompt when detecting that the target page element is triggered, and the element description attribute is used for setting description information of functions and styles of the target page element;
The processing unit 802 is configured to set a second tag attribute and a second attribute value in the target tag, and when obtaining a new source code, specifically configured to:
adding the function starting attribute in the target label, and setting an attribute value of the function starting attribute as function starting information, wherein the function starting information indicates that a target page element is set as an element capable of triggering prompt; the method comprises the steps of,
and adding the element description attribute in the target label, and determining the spliced character string as an attribute value of the element description attribute.
In one implementation, the page development specification followed by the first display platform indicates that the first tag attribute includes a function start attribute and an element description attribute, the function start attribute is used for setting whether to output a trigger prompt when the display platform detects that the target page element is triggered, and the element description attribute is used for setting description information of functions and styles of the target page element;
the processing unit 802 is configured to, when generating the second attribute value of the second tag attribute according to the first attribute value and the attribute rule of the second tag attribute, specifically:
acquiring an attribute value of a function starting attribute;
if the attribute value of the function starting attribute is the function starting information, acquiring the attribute value of the element description attribute;
Splitting the attribute value of the element description attribute according to the attribute rule of the second tag attribute to obtain a functional attribute value and a role attribute value;
the function attribute value and the role attribute value are determined as second attribute values of the second tag attribute.
In one implementation, the page development specification followed by the second display platform indicates that the second tag attribute includes an element function attribute and an element role attribute, the element function attribute is used for setting description information of a function executed after the target page element is triggered, and the element role attribute is used for setting description information of a style presented by the target page element;
the processing unit 802 is configured to set a second tag attribute and a second attribute value in the target tag, and when obtaining a new source code, specifically configured to:
adding the element function attribute in the target label, and determining the function attribute value as the attribute value of the element function attribute; the method comprises the steps of,
and adding the character attribute of the element in the target label, and determining the character attribute value as the attribute value of the character attribute of the element.
In one implementation, the target page belongs to any service page in the target application program, and the processing unit 802 is further configured to:
Adding the executable file adapted by the second display platform into a program package of the target application program;
in response to an issuing instruction for a package of the target application program, issuing the package of the target application program to cause the terminal device to install the target application program based on the package of the target application program;
when the terminal equipment displays the target page through the second display platform, rendering and displaying the target page according to the executable file adapted by the second display platform; and when the target page element in the target page is triggered, outputting a trigger prompt according to the second tag attribute.
According to an embodiment of the present application, each unit in the page processing apparatus shown in fig. 9 may be separately or completely combined into one or several other units to form a structure, or some unit(s) thereof may be further split into a plurality of units with smaller functions to form a structure, which may achieve the same operation without affecting the implementation of the technical effects of the embodiments of the present application. The above units are divided based on logic functions, and in practical applications, the functions of one unit may be implemented by a plurality of units, or the functions of a plurality of units may be implemented by one unit. In other embodiments of the present application, the page processing apparatus may also include other units, and in practical applications, these functions may also be implemented with assistance from other units, and may be implemented by cooperation of multiple units. According to another embodiment of the present application, a page processing apparatus as shown in fig. 9 may be constructed by running a computer program (including program code) capable of executing the steps involved in the respective methods as shown in fig. 2 and 5 on a general-purpose computing device such as a computer including a processing element such as a Central Processing Unit (CPU), a random access storage medium (RAM), a read only storage medium (ROM), and the like, and a storage element, and the page processing method of the embodiments of the present application may be implemented. The computer program may be recorded on, for example, a computer-readable recording medium, and loaded into and run in the above-described computing device through the computer-readable recording medium.
In this embodiment of the present application, the obtaining unit 901 may obtain a source code created for a target page, and when the source code includes a first tag attribute written for a target page element in the target page based on a page development specification followed by the first display platform, the processing unit 902 may set a second tag attribute capable of being identified by the second display platform in a target tag to which the first tag attribute belongs, so as to obtain a new source code. By adding the second tag attribute which can be identified by the second display platform into the source code written based on the page development specification followed by the first display platform, a new source code which can be operated by the second display platform can be obtained, so that a developer can obtain corresponding source codes of different display platforms by developing a set of source codes based on the page development specification of one display platform, the indifferent trigger prompt of different display platforms to target page elements is achieved, the workload of tag attribute labeling is reduced, and the coding efficiency is improved.
Fig. 10 shows a schematic structural diagram of a page processing apparatus according to an exemplary embodiment of the present application. Referring to fig. 10, the page processing apparatus includes a processor 1001, a communication interface 1002, and a computer-readable storage medium 1003. Wherein the processor 1001, the communication interface 1002, and the computer-readable storage medium 1003 may be connected by a bus or other means. Wherein the communication interface 1002 is for receiving and transmitting data. The computer readable storage medium 1003 may be stored in a memory of the page processing apparatus, the computer readable storage medium 1003 is used to store a computer program including program instructions, and the processor 1001 is used to execute the program instructions stored in the computer readable storage medium 1003. The processor 1001, or CPU (Central Processing Unit ), is a computing core and a control core of the page processing device, which are adapted to implement one or more instructions, in particular to load and execute one or more instructions to implement a corresponding method flow or a corresponding function.
The embodiments of the present application also provide a computer-readable storage medium (Memory), which is a Memory device in a page processing device, for storing programs and data. It will be appreciated that the computer readable storage medium herein may include both built-in storage media in the page processing device and extended storage media supported by the page processing device. The computer readable storage medium provides a memory space that stores a processing system of the page processing device. Also stored in this memory space are one or more instructions, which may be one or more computer programs (including program code), adapted to be loaded and executed by the processor 1001. Note that the computer readable storage medium can be either a high-speed RAM memory or a non-volatile memory (non-volatile memory), such as at least one magnetic disk memory; alternatively, it may be at least one computer-readable storage medium located remotely from the aforementioned processor.
In one embodiment, the page processing device may be a computer device as mentioned in the previous embodiment; the computer-readable storage medium having one or more instructions stored therein; one or more instructions stored in a computer-readable storage medium are loaded and executed by the processor 1001 to implement the corresponding steps in the page processing method embodiments described above; in particular implementations, one or more instructions in a computer-readable storage medium are loaded by the processor 1001 and perform the steps of:
Acquiring a source code of a target page, wherein the source code supports cross-platform operation in a first display platform and a second display platform, the source code comprises a first tag attribute written for target page elements in the target page based on a page development specification followed by the first display platform, and the tag attribute is used for indicating the display platform to output a trigger prompt when the target page elements are detected to be triggered;
identifying a target label to which the first label attribute belongs in the source code, and setting a second label attribute which can be identified by a second display platform in the target label to obtain a new source code;
and generating an executable file matched with the second display platform based on the new source code, wherein the executable file is used for rendering and displaying the target page.
In one implementation, the trigger prompt includes prompt audio that matches semantic description information of the target page element, the semantic description information being used to semantically describe the target page element;
the semantic description information includes at least one of: describing information of a style presented to the target page element, describing information of a function executed after the target page element is triggered, and describing information of an object contained in the target page element;
The prompt audio is used for prompting at least one of the following: a style for prompting presentation of the target page element, a function executed after the target page element is triggered, and an object contained in the target page element.
In one implementation, one or more instructions in the computer-readable storage medium are loaded by the processor 1001 and when executed to set a second tag attribute in the target tag that is recognizable by the second display platform, to obtain the new source code, specifically perform the following steps:
acquiring a first attribute value of a first tag attribute from the source code, and determining a second tag attribute which can be identified by a second display platform;
generating a second attribute value of the second tag attribute according to the first attribute value and the attribute rule of the second tag attribute;
and setting a second tag attribute and a second attribute value in the target tag to obtain a new source code.
In one implementation, the page development specification followed by the first display platform indicates that the first tag attribute includes an element function attribute and an element role attribute, the element function attribute is used for setting description information of a function executed after the target page element is triggered, and the element role attribute is used for setting description information of a style presented by the target page element;
One or more instructions in the computer-readable storage medium are loaded by the processor 1001 and, when executing the attribute rule according to the first attribute value and the second tag attribute, generate a second attribute value for the second tag attribute, specifically perform the steps of:
acquiring a function attribute value of an element function attribute and a role attribute value of an element role attribute;
splicing the function attribute value and the role attribute value according to the attribute rule of the second tag attribute to obtain a spliced character string;
and determining the spliced character string as a second attribute value of the second tag attribute.
In one implementation, the page development specification followed by the second display platform indicates that the second tag attribute includes a function start attribute and an element description attribute, the function start attribute is used for setting whether the display platform outputs a trigger prompt when detecting that the target page element is triggered, and the element description attribute is used for setting description information of functions and styles of the target page element;
one or more instructions in the computer-readable storage medium are loaded by the processor 1001 and when executed to set a second tag attribute and a second attribute value in the target tag, result in a new source code, specifically perform the following steps:
Adding the function starting attribute in the target label, and setting an attribute value of the function starting attribute as function starting information, wherein the function starting information indicates that a target page element is set as an element capable of triggering prompt; the method comprises the steps of,
and adding the element description attribute in the target label, and determining the spliced character string as an attribute value of the element description attribute.
In one implementation, the page development specification followed by the first display platform indicates that the first tag attribute includes a function start attribute and an element description attribute, the function start attribute is used for setting whether to output a trigger prompt when the display platform detects that the target page element is triggered, and the element description attribute is used for setting description information of functions and styles of the target page element;
one or more instructions in the computer-readable storage medium are loaded by the processor 1001 and, when executing the attribute rule according to the first attribute value and the second tag attribute, generate a second attribute value for the second tag attribute, specifically perform the steps of:
acquiring an attribute value of a function starting attribute;
if the attribute value of the function starting attribute is the function starting information, acquiring the attribute value of the element description attribute;
splitting the attribute value of the element description attribute according to the attribute rule of the second tag attribute to obtain a functional attribute value and a role attribute value;
The function attribute value and the role attribute value are determined as second attribute values of the second tag attribute.
In one implementation, the page development specification followed by the second display platform indicates that the second tag attribute includes an element function attribute and an element role attribute, the element function attribute is used for setting description information of a function executed after the target page element is triggered, and the element role attribute is used for setting description information of a style presented by the target page element;
one or more instructions in the computer-readable storage medium are loaded by the processor 1001 and when executed to set a second tag attribute and a second attribute value in the target tag, result in a new source code, specifically perform the following steps:
adding the element function attribute in the target label, and determining the function attribute value as the attribute value of the element function attribute; the method comprises the steps of,
and adding the character attribute of the element in the target label, and determining the character attribute value as the attribute value of the character attribute of the element.
In one implementation, the target page belongs to any service page in the target application, and one or more instructions in the computer-readable storage medium are loaded by the processor 1001 and further perform the steps of:
Adding the executable file adapted by the second display platform into a program package of the target application program;
in response to an issuing instruction for a package of the target application program, issuing the package of the target application program to cause the terminal device to install the target application program based on the package of the target application program;
when the terminal equipment displays the target page through the second display platform, rendering and displaying the target page according to the executable file adapted by the second display platform; and when the target page element in the target page is triggered, outputting a trigger prompt according to the second tag attribute.
In this embodiment of the present application, the processor 1001 may obtain a source code created for a target page, and when the source code includes a first tag attribute written for a target page element in the target page based on a page development specification followed by the first display platform, a second tag attribute that can be identified by the second display platform may be set in a target tag to which the first tag attribute belongs, so as to obtain a new source code. By adding the second tag attribute which can be identified by the second display platform into the source code written based on the page development specification followed by the first display platform, a new source code which can be operated by the second display platform can be obtained, so that a developer can obtain corresponding source codes of different display platforms by developing a set of source codes based on the page development specification of one display platform, the indifferent trigger prompt of different display platforms to target page elements is achieved, the workload of tag attribute labeling is reduced, and the coding efficiency is improved.
Embodiments of the present application also provide a computer program product or computer program comprising computer instructions stored in a computer-readable storage medium. The processor of the page processing apparatus reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions so that the page processing apparatus performs the above-described page processing method.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in accordance with embodiments of the present invention are produced in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable devices. The computer instructions may be stored in or transmitted across a computer-readable storage medium. The computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by a wired (e.g., coaxial cable, fiber optic, digital Subscriber Line (DSL)), or wireless (e.g., infrared, wireless, microwave, etc.). Computer readable storage media can be any available media that can be accessed by a computer or data storage devices, such as servers, data centers, etc., that contain an integration of one or more available media. The usable medium may be a magnetic medium (e.g., a floppy Disk, a hard Disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a Solid State Disk (SSD)), or the like.
The foregoing is merely specific embodiments of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art can easily think about changes or substitutions within the technical scope of the present disclosure, and all changes and substitutions are intended to be covered by the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims (12)
1. A method of processing a page, comprising:
acquiring source codes of a target page, wherein the source codes support cross-platform operation in a first display platform and a second display platform, the source codes comprise first tag attributes written for target page elements in the target page based on page development specifications followed by the first display platform, and the tag attributes are used for indicating the display platform to output trigger prompts when the target page elements are detected to be triggered;
identifying a target label to which the first label attribute belongs in the source code, and setting a second label attribute which can be identified by a second display platform in the target label to obtain a new source code;
and generating an executable file matched with the second display platform based on the new source code, wherein the executable file is used for rendering and displaying the target page.
2. The method of claim 1, wherein the trigger prompt includes prompt audio matching semantic description information of the target page element, the semantic description information being used to semantically describe the target page element;
the semantic description information includes at least one of: descriptive information of a style presented by the target page element, descriptive information of a function executed after the target page element is triggered, and descriptive information of an object contained by the target page element;
the prompt audio is used for prompting at least one of the following: a style for prompting the presentation of the target page element, a function for prompting the execution of the target page element after being triggered, and an object contained in the target page element.
3. The method of claim 1, wherein setting a second tag attribute in the target tag that is recognizable by the second display platform, to obtain a new source code, comprises:
acquiring a first attribute value of the first tag attribute from the source code, and determining a second tag attribute which can be identified by the second display platform;
Generating a second attribute value of the second tag attribute according to the attribute rules of the first attribute value and the second tag attribute;
and setting the second tag attribute and the second attribute value in the target tag to obtain a new source code.
4. The method of claim 3, wherein the page development specification followed by the first display platform indicates that the first tab attribute includes an element function attribute and an element role attribute, the element function attribute being used to set description information of a function performed after the target page element is triggered, the element role attribute being used to set description information of a style presented by the target page element;
the generating a second attribute value of the second tag attribute according to the attribute rule of the first attribute value and the second tag attribute includes:
acquiring a function attribute value of the element function attribute and a role attribute value of the element role attribute;
performing splicing processing on the function attribute value and the role attribute value according to the attribute rule of the second tag attribute to obtain a spliced character string;
and determining the spliced character string as a second attribute value of the second tag attribute.
5. The method of claim 4, wherein the page development specification followed by the second display platform indicates that the second tag attributes include a function initiation attribute and an element description attribute, the function initiation attribute being used to set whether a trigger prompt is output when the display platform detects that the target page element is triggered, the element description attribute being used to set description information of a function and a style of the target page element;
setting the second tag attribute and the second attribute value in the target tag to obtain a new source code, including:
adding the function starting attribute in the target tag, and setting an attribute value of the function starting attribute as function starting information, wherein the function starting information indicates that the target page element is set as an element capable of triggering prompt; the method comprises the steps of,
and adding the element description attribute in the target label, and determining the spliced character string as an attribute value of the element description attribute.
6. The method of claim 3, wherein the page development specification followed by the first display platform indicates that the first tag attributes include a function initiation attribute and an element description attribute, the function initiation attribute being used to set whether a trigger prompt is output when the display platform detects that the target page element is triggered, the element description attribute being used to set description information of a function and a style of the target page element;
The generating a second attribute value of the second tag attribute according to the attribute rule of the first attribute value and the second tag attribute includes:
acquiring an attribute value of the function starting attribute;
if the attribute value of the function starting attribute is the function starting information, acquiring the attribute value of the element description attribute;
splitting the attribute value of the element description attribute according to the attribute rule of the second tag attribute to obtain a function attribute value and a role attribute value;
and determining the function attribute value and the role attribute value as second attribute values of the second tag attributes.
7. The method of claim 6, wherein the page development specification followed by the second display platform indicates that the second tab attribute includes an element function attribute and an element role attribute, the element function attribute being used to set description information of a function performed after the target page element is triggered, the element role attribute being used to set description information of a style presented by the target page element;
setting the second tag attribute and the second attribute value in the target tag to obtain a new source code, including:
Adding the element function attribute in the target label, and determining the function attribute value as an attribute value of the element function attribute; the method comprises the steps of,
and adding the element role attribute in the target label, and determining the role attribute value as the attribute value of the element role attribute.
8. The method of claim 1, wherein the target page belongs to any service page in the target application, the method further comprising:
adding the executable file adapted by the second display platform into a program package of the target application program;
in response to an issuing instruction for the package of the target application program, issuing the package of the target application program to enable the terminal device to install the target application program based on the package of the target application program;
when the terminal equipment displays the target page through the second display platform, rendering and displaying the target page according to an executable file adapted by the second display platform; and when the target page element in the target page is triggered, outputting a trigger prompt according to the second tag attribute.
9. A page processing apparatus, comprising:
the system comprises an acquisition unit, a trigger prompt generation unit and a trigger prompt generation unit, wherein the acquisition unit is used for acquiring source codes of a target page, the source codes support cross-platform operation in a first display platform and a second display platform, the source codes comprise first tag attributes written for target page elements in the target page based on page development specifications followed by the first display platform, and the tag attributes are used for indicating the display platform to output the trigger prompt when the target page elements are detected to be triggered;
the processing unit is used for identifying the target tag of the first tag attribute in the source code, setting a second tag attribute which can be identified by a second display platform in the target tag, and obtaining a new source code;
and the processing unit is also used for generating an executable file matched with the second display platform based on the new source code, and the executable file is used for rendering and displaying the target page.
10. A page processing apparatus, characterized by comprising:
a processor adapted to execute a computer program;
a computer readable storage medium having stored therein a computer program which, when executed by the processor, implements the page processing method of any of claims 1-8.
11. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program adapted to be loaded by a processor and to perform the page processing method according to any of claims 1-8.
12. A computer program product comprising computer instructions which, when executed by a processor, implement the page processing method of claims 1-8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111532023.3A CN116263660A (en) | 2021-12-15 | 2021-12-15 | Page processing method, device, equipment, medium and program product |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111532023.3A CN116263660A (en) | 2021-12-15 | 2021-12-15 | Page processing method, device, equipment, medium and program product |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116263660A true CN116263660A (en) | 2023-06-16 |
Family
ID=86722480
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111532023.3A Pending CN116263660A (en) | 2021-12-15 | 2021-12-15 | Page processing method, device, equipment, medium and program product |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116263660A (en) |
-
2021
- 2021-12-15 CN CN202111532023.3A patent/CN116263660A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11029815B1 (en) | Modular systems and methods for selectively enabling cloud-based assistive technologies | |
US11176141B2 (en) | Preserving emotion of user input | |
US20170286390A1 (en) | Dynamic and automatic generation of interactive text related objects | |
US12086532B2 (en) | Generating cascaded text formatting for electronic documents and displays | |
KR101962980B1 (en) | Informed partitioning of data in a markup-based document | |
US9575940B2 (en) | Provision of alternative text for use in association with image data | |
CN104156421B (en) | The page shows method, apparatus and system | |
US11126410B2 (en) | Method and apparatus for building pages, apparatus and non-volatile computer storage medium | |
US10685670B2 (en) | Web technology responsive to mixtures of emotions | |
CN116263660A (en) | Page processing method, device, equipment, medium and program product | |
CN117435106A (en) | Page generation method and device, electronic equipment and storage medium | |
CN108664511B (en) | Method and device for acquiring webpage information | |
Larsen | Learning Microsoft Cognitive Services | |
CN116701604A (en) | Question and answer corpus construction method and device, question and answer method, equipment and medium | |
JP4448724B2 (en) | Web browser accessibility inspection program | |
CN115905759A (en) | Barrier-free webpage generation method, device, medium and equipment | |
US10203865B2 (en) | Document content reordering for assistive technologies by connecting traced paths through the content | |
US8983827B2 (en) | Linguistical analytic consolidation for mobile content | |
Akhter et al. | Conceptual framework: How to engineer online trust for disabled users | |
CN112068826A (en) | Text input control method, system, electronic device and storage medium | |
JP2020154050A (en) | Voice output method, voice output system and program | |
US20240126978A1 (en) | Determining attributes for elements of displayable content and adding them to an accessibility tree | |
US10990362B1 (en) | Converting programs to visual representation with reading complied binary | |
CN117041660A (en) | Image-text video generation method and device, electronic equipment and storage medium | |
CN117008807A (en) | Keyboard theme switching method, device, equipment and readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
REG | Reference to a national code |
Ref country code: HK Ref legal event code: DE Ref document number: 40087288 Country of ref document: HK |
|
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |