Method, apparatus, electronic device, and storage medium for data processing
By calculating the mean interval and pixel vector of the terminal page image, the location information of the area to be processed is determined, which solves the problem of inconsistent page content on terminals with different resolutions and improves the accuracy and efficiency of page testing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING WODONG TIANJUN INFORMATION TECH CO LTD
- Filing Date
- 2025-01-10
- Publication Date
- 2026-07-10
AI Technical Summary
In application page testing scenarios, the inconsistent page content displayed on terminals with different resolutions makes accurate comparison impossible, leading to page test failure.
By receiving page processing requests, the system obtains the page image displayed on the terminal, calculates the mean range of each pixel channel, filters the target mean range, determines the location information of the area to be processed based on the pixel vector, and extracts the area to be processed from the page image.
It enables accurate extraction of the area to be processed in page testing on terminals with different resolutions, improving the accuracy and efficiency of page testing.
Smart Images

Figure CN122364058A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a data processing method, apparatus, electronic device, and storage medium. Background Technology
[0002] In application page testing scenarios, it is often necessary to test pages displayed on terminals with different resolutions. Related technologies typically employ automated testing methods; however, due to inconsistencies in the page content displayed on terminals with different resolutions, accurate comparison of page content becomes impossible, leading to page testing failure. Summary of the Invention
[0003] In view of this, embodiments of the present invention provide a data processing method, apparatus, electronic device, and storage medium that can solve the problem that page content cannot be accurately compared due to inconsistencies in the page content displayed by terminals with different resolutions, thus preventing page testing and causing page testing failure.
[0004] To achieve the above objectives, according to one aspect of the present invention, a data processing method is provided.
[0005] A data processing method according to an embodiment of the present invention includes: receiving a page processing request and obtaining a page image of the corresponding page displayed on the terminal;
[0006] Obtain the pixel values of each pixel channel corresponding to the page image, call the preset calculation model, calculate the mean interval corresponding to each pixel channel, and filter the target mean interval from the mean interval corresponding to each pixel channel.
[0007] Based on the pixels of the page image and the target mean interval, the pixel vector corresponding to the page image is calculated to determine the position information of each region to be processed in the page image;
[0008] The area to be processed is extracted from the page image based on the location information.
[0009] In one embodiment, calculating the pixel vector corresponding to the page image based on the pixels of the page image and the target mean interval includes:
[0010] The page image is converted into a preset format, and a corresponding pixel matrix is generated based on the page image in the preset format;
[0011] The pixel vector corresponding to the page image is calculated by concatenating the pixel matrix with the one-dimensional vector of the page image and combining it with the target mean-normalized interval.
[0012] In yet another embodiment, determining the location information of each region to be processed in the page image includes:
[0013] The target pixel value corresponding to the region to be processed is determined based on the target mean interval;
[0014] The position information of each region to be processed in the page image is determined based on the position of the target pixel value in the pixel vector.
[0015] In another embodiment, determining the position information of each region to be processed in the page image based on the position of the target pixel value in the pixel vector includes:
[0016] Identify the target element in the pixel vector that is equal to the target pixel value, and determine the number of non-target elements between two adjacent target elements according to the arrangement order of the elements in the pixel vector;
[0017] In response to the number being less than a preset threshold, the non-target element is changed into a target element to obtain an updated pixel vector, and the position information of each area to be processed in the page image is determined based on the updated pixel vector.
[0018] In another embodiment, the step of calling a preset calculation model to calculate the mean interval corresponding to each pixel channel, so as to filter the target mean interval from the mean interval corresponding to each pixel channel, includes:
[0019] For each pixel channel, the pixel mean of the pixel channel is calculated, and a preset meanization model is invoked to calculate the corresponding meanization interval.
[0020] The averaging interval with the largest number of averaging intervals among all pixel channels is determined as the target averaging interval.
[0021] In yet another embodiment, after extracting the area to be processed from the page image based on the location information, the method further includes:
[0022] Obtain the page image displayed on other terminals, extract the corresponding comparison area, and call the preset comparison program to process the processing area and the comparison area.
[0023] To achieve the above objectives, according to another aspect of the present invention, a data processing apparatus is provided.
[0024] An embodiment of the present invention provides a data processing apparatus comprising: an acquisition unit, configured to receive a page processing request and acquire a page image of the corresponding page displayed on a terminal;
[0025] The filtering unit is used to obtain the pixel values of each pixel channel of the page image, call the preset calculation model, calculate the mean interval corresponding to each pixel channel, and filter the target mean interval from the mean interval corresponding to each pixel channel.
[0026] The determining unit is used to calculate the pixel vector corresponding to the page image based on the pixels of the page image and the target mean interval, so as to determine the position information of each region to be processed in the page image;
[0027] An extraction unit is used to extract the area to be processed from the page image based on the location information.
[0028] In one embodiment, the determining unit is specifically used for:
[0029] The page image is converted into a preset format, and a corresponding pixel matrix is generated based on the page image in the preset format;
[0030] The pixel vector corresponding to the page image is calculated by concatenating the pixel matrix with the one-dimensional vector of the page image and combining it with the target mean-normalized interval.
[0031] In yet another embodiment, the determining unit is specifically used for:
[0032] The target pixel value corresponding to the region to be processed is determined based on the target mean interval;
[0033] The position information of each region to be processed in the page image is determined based on the position of the target pixel value in the pixel vector.
[0034] In yet another embodiment, the determining unit is specifically used for:
[0035] Identify the target element in the pixel vector that is equal to the target pixel value, and determine the number of non-target elements between two adjacent target elements according to the arrangement order of the elements in the pixel vector;
[0036] In response to the number being less than a preset threshold, the non-target element is changed into a target element to obtain an updated pixel vector, and the position information of each area to be processed in the page image is determined based on the updated pixel vector.
[0037] In yet another embodiment, the filtering unit is specifically used for:
[0038] For each pixel channel, the pixel mean of the pixel channel is calculated, and a preset meanization model is invoked to calculate the corresponding meanization interval.
[0039] The averaging interval with the largest number of averaging intervals among all pixel channels is determined as the target averaging interval.
[0040] In yet another embodiment, the apparatus further includes:
[0041] The comparison unit is used to acquire page images displayed on other terminals, extract the corresponding comparison areas, and call a preset comparison program to process the processing areas and the comparison areas.
[0042] To achieve the above objectives, according to another aspect of the present invention, an electronic device is provided.
[0043] An electronic device according to an embodiment of the present invention includes: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the data processing method provided in the embodiment of the present invention.
[0044] To achieve the above objectives, according to another aspect of the present invention, a computer-readable medium is provided.
[0045] An embodiment of the present invention provides a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the data processing method provided in the embodiment of the present invention.
[0046] To achieve the above objectives, according to another aspect of the present invention, a computer program product is provided.
[0047] A computer program product according to an embodiment of the present invention includes a computer program that, when executed by a processor, implements the data processing method provided in the embodiment of the present invention.
[0048] One embodiment of the above invention has the following advantages or beneficial effects:
[0049] In this embodiment of the invention, after receiving a page processing request, the page image displayed on the terminal can be obtained. The pixel values of each pixel channel corresponding to the page image are extracted. The mean value interval corresponding to each pixel channel is calculated based on each pixel channel, and then the target mean value interval is selected, which is the mean value interval for processing the page image. Based on the pixels of the page image and the target mean value interval, the pixel vector corresponding to the page image can be calculated. The pixel vector represents the distribution of pixels in the page image. Therefore, the pixel distribution in the page image can be determined based on the values of each element in the pixel vector, and thus the location information of each area to be processed in the page image can be determined, so as to extract the area to be processed from the page image. Thus, in this embodiment of the invention, the page image can be processed based on pixels, and the area to be processed can be determined from the page image. Therefore, in page testing scenarios, even if different terminals display inconsistent content on the same page, the page area to be tested can be extracted by extracting the area to be processed, thereby achieving test comparison between the areas to be processed corresponding to terminals with different resolutions, improving the accuracy and efficiency of page testing.
[0050] The further effects of the aforementioned unconventional alternative methods will be explained below in conjunction with specific implementation methods. Attached Figure Description
[0051] The accompanying drawings are provided to better understand the invention and are not intended to unduly limit the scope of the invention. Wherein:
[0052] Figure 1 This is a schematic diagram of a main flow of a data processing method according to an embodiment of the present invention;
[0053] Figure 2 This is a schematic diagram illustrating the pixel vector correspondence display effect according to an embodiment of the present invention;
[0054] Figure 3 This is a schematic diagram of another main flow of a data processing method according to an embodiment of the present invention;
[0055] Figure 4 This is a schematic diagram of another main flow of a data processing method according to an embodiment of the present invention;
[0056] Figure 5 This is a schematic diagram of the main units of a data processing apparatus according to an embodiment of the present invention;
[0057] Figure 6 This is an exemplary system architecture diagram in which embodiments of the present invention can be applied;
[0058] Figure 7 This is a schematic diagram of the structure of a computer system suitable for implementing embodiments of the present invention. Detailed Implementation
[0059] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of the present invention, including various details to aid understanding. These details should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0060] It should be noted that, unless otherwise specified, the embodiments and features described in this invention can be combined with each other. The acquisition, transmission, storage, use, and processing of data in this application comply with relevant national laws and regulations. In the embodiments of this application, certain existing industry solutions such as software, components, and models may be mentioned. These should be considered exemplary, intended only to illustrate the feasibility of implementing the technical solution of this application, and do not imply that the applicant has already used or necessarily used such solutions.
[0061] This invention provides a data processing system that can be used to process page images, specifically for processing page images displayed on terminals with different resolutions in a page testing scenario.
[0062] This invention provides a data processing method, which can be executed by a data processing system, such as... Figure 1 As shown, the method includes the following steps.
[0063] S101: Receive a page processing request and obtain the page image displayed on the terminal for the corresponding page.
[0064] A page processing request can refer to the processing of a page image displayed on the terminal. A page processing request can include page information to determine which page needs to be processed, and thus obtain the page image displayed on the terminal.
[0065] Because the page images displayed on different terminals are not completely consistent, page testing, especially compatibility comparison testing, cannot be performed. Therefore, this embodiment of the invention can extract the areas to be processed from the page images displayed on each terminal, and then perform the corresponding page tests based on the extracted results. Thus, after receiving a page processing request, this step can obtain the page images displayed on the terminal for the corresponding page. Multiple page images can be obtained, and subsequent steps are executed sequentially to extract the corresponding areas to be processed, thereby performing the corresponding page tests.
[0066] It should be noted that the page images can be obtained from a preset data source, and the obtained page images can be the landing page displayed on terminals with different resolutions.
[0067] S102: Obtain the pixel values of each pixel channel of the page image, call the preset calculation model, calculate the mean interval corresponding to each pixel channel, and filter the target mean interval from the mean interval corresponding to each pixel channel.
[0068] Here, the mean range represents the range of values an element takes during the mean-averaging process. In this embodiment of the invention, the processing is based on the pixels of the page image, so mean-averaging is required. However, the mean-averaging parameters are different for different page images. Therefore, in this step, the mean-averaging parameters, i.e., the target mean-averaging range, are determined by analyzing the pixels in the page image.
[0069] It should be noted that, in order to improve the accuracy of determining the target mean interval, this step obtains the corresponding pixel values for each pixel channel separately, and performs mean interval analysis on each pixel channel, thereby obtaining multiple mean intervals. Then, the target mean interval is selected from these mean intervals. In this embodiment of the invention, the pixel channels can be set according to requirements; for example, R, G, and B channels can be selected to perform this step.
[0070] Specifically, for each pixel channel, the corresponding pixel value can be obtained based on the page image. Then, the corresponding mean interval can be calculated based on the pixel value of each pixel channel. After obtaining the mean intervals for each pixel channel, the target mean interval can be determined from them according to a preset algorithm. The preset algorithm can be set according to needs, such as selecting the mean interval with the most votes, or using random forest to vote and select the mean interval with the most votes.
[0071] It should be noted that, in order to make the calculation more convenient and enhance the regularity of the data, the mean interval is usually selected as [0,1] or [1,0]. Therefore, in this step, the selection can be determined based on the pixel values of each pixel channel. As shown in Formula 1, this is the formula for pixel mean processing of a certain pixel channel when the mean interval is usually selected as [0,1].
[0072]
[0073] X 0-1 This represents the vector obtained after mean normalization. i This indicates that the pixel channel corresponds to the value of the i-th pixel. This represents the average pixel value corresponding to a pixel channel. For example, x... i Greater than the mean Then assign the current pixel value to 1; for example, x i Not greater than the mean Then the current pixel value will be assigned to 0.
[0074] The experiment revealed that not all images can be processed according to Formula 1; some images require the opposite approach. The value is 0. Select 1. If an accurate mean range is not selected, the page images cannot be processed accurately. Therefore, in this embodiment of the invention, this step determines whether to select [0,1] or [1,0] to improve the accuracy of data processing.
[0075] In one implementation, the corresponding mean interval can be calculated based on the pixel mean of each pixel channel. Specifically, this can be done by: calculating the pixel mean of each pixel channel, and then calling a preset mean interval model to calculate the corresponding mean interval.
[0076] The mean-averaging model can be pre-trained and can be implemented using a logistic regression algorithm. For example, as shown in Table 1, after obtaining the pixel mean of each pixel channel, inputting it into the logistic regression model can determine the corresponding mean-averaging interval, and thus determine the target mean-averaging interval.
[0077] Table 1
[0078]
[0079] It should be noted that, in order to improve the image resolution and facilitate subsequent processing, this step involves enhancing the page image first. The processing method is not limited.
[0080] S103: Based on the pixel values of the page image and the target mean range, calculate the pixel vector corresponding to the page image to determine the location information of each region to be processed in the page image.
[0081] In this pixel vector, each element represents the state and region of pixel distribution. After determining the target averaging interval, the pixels of the page image can be processed. In this step, the pixels of each point in the page image can be averaged within the target averaging interval. The processed result can be stored as a vector, i.e., the pixel vector. Changes in the values of each element in the pixel vector represent changes in the pixels of each point in the page image. Therefore, based on the patterns of change in the values of each element, changes in the displayed content in the page image can be determined. Furthermore, by combining the positional relationships between each element and the pixels in the page image, the positional information of each region in the page image can be determined. The region to be processed represents the region in the page image corresponding to subsequent processing. For example, if the page image needs to be tested later, the areas where each floor is located on the page are all regions to be processed.
[0082] Specifically, the pixel vector calculation in this step can be performed as follows: convert the page image to a preset format, generate a corresponding pixel matrix based on the page image in the preset format; concatenate the one-dimensional vector of the page image according to the pixel matrix, and calculate the pixel vector corresponding to the page image by combining the target mean range.
[0083] The preset format can be set according to requirements. In this step, to simplify calculations, the preset format can be set to grayscale, that is, the page image is first converted to grayscale, which generates the corresponding two-dimensional pixel matrix. To facilitate the generation of pixel vectors, a one-dimensional vector of the page image can be concatenated based on the pixel matrix. Specifically, the elements of each row in the pixel matrix can be concatenated sequentially to obtain a one-dimensional vector. The one-dimensional vector is then averaged according to the target averaging interval to obtain the pixel vector corresponding to the page image. When the target averaging interval is [0,1] or [1,0], the value of each element in the pixel vector is 0 or 1, that is, the pixel vector is a vector composed of 0s and 1s, such as... Figure 2 The figure shows a schematic diagram of the display effect of pixel vector correspondence. As shown in the figure, the display effect can be seen to show that the data has more regularity.
[0084] After obtaining the pixel vector, the location information of the region to be processed can be determined based on the changes in the element values in the pixel vector.
[0085] Taking a page image testing scenario as an example, it is usually necessary to compare and test the content of each floor in different page images. Therefore, the area of each floor in the page image is the area to be processed. As can be seen from the page layout rules, the floors in the page are usually divided by color areas with significant differences in color from the floor content. Therefore, in this embodiment of the invention, the position of the area to be processed can be determined based on the element values in the pixel vector.
[0086] Specifically, the target pixel value corresponding to the area to be processed can be determined first based on the target mean range. The target pixel value represents the pixel value of the area to be processed in the pixel vector. When the target mean range is [0,1], the target pixel value is usually 1; when the target mean range is [1,0], the target pixel value is usually 0. After determining the target pixel value, the position of the corresponding target pixel value in the pixel vector can be determined as the position information of each area to be processed in the page image.
[0087] It's important to note that the area to be processed corresponds to multiple pixels, resulting in multiple consecutive elements in the pixel vector that are the target pixel values. Therefore, in this step, we can determine the elements with consecutive target pixel values based on the order of the elements in the pixel vector, and then use the positions of these elements to determine the location information of the area to be processed. The elements in the pixel vector are obtained by concatenating the elements from the pixel matrix corresponding to the page image. Therefore, after identifying the elements with consecutive target pixel values, we can map them into the pixel matrix, thereby determining the location information of the corresponding area to be processed.
[0088] In some scenarios, errors may cause the calculation of individual elements in the pixel vector to be incorrect, leading to errors in determining elements whose values are consecutively the target pixel value. To avoid this problem, the pixel vector can be repaired before determining the position information in this step. Specifically, this can be done as follows: identify the target elements in the pixel vector that are equal to the target pixel value; determine the number of non-target elements between two adjacent target elements according to the arrangement order of the elements in the pixel vector; if the number is less than a preset threshold, change the non-target elements to target elements to obtain an updated pixel vector; and determine the position information of each area to be processed in the page image based on the updated pixel vector.
[0089] For example, taking a target mean interval of [0, 1] and a pixel vector of [0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0] as an example, traversing from the first element and recording the target elements with consecutive 1s, we can determine the number of non-target elements (i.e., 0s) between adjacent target elements. We can conclude that the number of 0s between the first and second 1s is 1; and the number of 0s between the 7th and 8th 1s is 1. Setting a preset threshold of 3, we can update the 0s between the first and second 1s to 1s; and update the 0s between the 7th and 8th 1s to 1s. This results in an updated pixel vector of [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0]. Subsequently, the positional information of each area to be processed in the page image can be determined based on the updated pixel vector. For example, if the values of the second to the thirteenth elements of an updated pixel vector are all 1, then the second to the thirteenth elements can be mapped to a pixel matrix, and their positions in the corresponding page image can be determined.
[0090] S104: Extract the area to be processed from the page image based on location information.
[0091] Once the location information is determined, the area corresponding to the location information can be extracted from the page image, i.e., the area to be processed. This area can then be used for comparison and testing with other page images. This not only improves the accuracy of page image comparison but also avoids the inconsistency of content in page images of different resolutions, which would otherwise lead to unreasonable compatibility comparisons.
[0092] In this embodiment of the invention, page images can be processed at the pixel level to determine the area to be processed from the page image. Therefore, in page testing scenarios, even if different terminals display inconsistent content on the same page, the page area to be tested can be extracted by extracting the area to be processed, thereby enabling test comparison between the areas to be processed corresponding to different resolution terminals, improving the accuracy and efficiency of page testing.
[0093] The following is combined with Figure 1 The illustrated embodiments provide a detailed description of the data processing methods in the embodiments of the present invention, such as... Figure 3 As shown, the method includes the following steps.
[0094] S301: Receive page processing request and obtain the page image displayed on the terminal for the corresponding page.
[0095] S302: Get the pixel values of each pixel channel of the page image.
[0096] S303: For each pixel channel, calculate the pixel mean of the pixel channel, and then call the preset meanization model to calculate the corresponding meanization interval.
[0097] S304: Determine the averaging interval with the largest number of averaging intervals among all pixel channels as the target averaging interval.
[0098] S305: Based on the pixel values of the page image and the target mean range, calculate the pixel vector corresponding to the page image to determine the location information of each region to be processed in the page image.
[0099] S306: Extract the area to be processed from the page image based on location information.
[0100] It should be noted that the data processing principle in the embodiments of the present invention is the same as... Figure 1 The data processing principles in the illustrated embodiments are the same and will not be repeated here.
[0101] The following is combined with Figure 1 The illustrated embodiments provide a detailed description of the data processing methods in the embodiments of the present invention, such as... Figure 4 As shown, the method includes the following steps.
[0102] S401: Receive a page processing request and obtain the page image displayed on the terminal for the corresponding page.
[0103] S402: Obtain the pixel values of each pixel channel of the page image, call the preset calculation model, calculate the mean interval corresponding to each pixel channel, and filter the target mean interval from the mean interval corresponding to each pixel channel.
[0104] S403: Convert the page image to a preset format and generate a corresponding pixel matrix based on the page image in the preset format.
[0105] S404: Construct a one-dimensional vector of the page image from the pixel matrix, and calculate the corresponding pixel vector of the page image by combining the target mean range.
[0106] S405: Determine the target pixel value corresponding to the region to be processed based on the target mean interval; determine the position information of each region to be processed in the page image based on the position of the corresponding target pixel value in the pixel vector.
[0107] S406: Extract the area to be processed from the page image based on location information.
[0108] It should be noted that the data processing principle in the embodiments of the present invention is the same as... Figure 1 The data processing principles in the illustrated embodiments are the same and will not be repeated here.
[0109] To address the problems existing in the prior art, embodiments of the present invention provide a data processing apparatus 500, such as... Figure 5 As shown, the device 500 includes: an acquisition unit 501, configured to receive a page processing request and acquire the page image of the corresponding page displayed on the terminal;
[0110] The filtering unit 502 is used to obtain the pixel values of each pixel channel corresponding to the page image, call the preset calculation model, calculate the mean interval corresponding to each pixel channel, and filter the target mean interval from the mean interval corresponding to each pixel channel.
[0111] The determining unit 503 is used to calculate the pixel vector corresponding to the page image based on the pixels of the page image and the target mean interval, so as to determine the position information of each region to be processed in the page image;
[0112] Extraction unit 504 is used to extract the area to be processed from the page image based on the location information.
[0113] It should be understood that the manner in which embodiments of the present invention are implemented is different from the implementation method. Figure 1 The embodiments shown are the same and will not be described again here.
[0114] In one embodiment, the determining unit 503 is specifically used for:
[0115] The page image is converted into a preset format, and a corresponding pixel matrix is generated based on the page image in the preset format;
[0116] The pixel vector corresponding to the page image is calculated by concatenating the pixel matrix with the one-dimensional vector of the page image and combining it with the target mean-normalized interval.
[0117] In yet another embodiment, the determining unit 503 is specifically used for:
[0118] The target pixel value corresponding to the region to be processed is determined based on the target mean interval;
[0119] The position information of each region to be processed in the page image is determined based on the position of the target pixel value in the pixel vector.
[0120] In yet another embodiment, the determining unit 503 is specifically used for:
[0121] Identify the target element in the pixel vector that is equal to the target pixel value, and determine the number of non-target elements between two adjacent target elements according to the arrangement order of the elements in the pixel vector;
[0122] In response to the number being less than a preset threshold, the non-target element is changed into a target element to obtain an updated pixel vector, and the position information of each area to be processed in the page image is determined based on the updated pixel vector.
[0123] In yet another embodiment, the filtering unit 502 is specifically used for:
[0124] For each pixel channel, the pixel mean of the pixel channel is calculated, and a preset meanization model is invoked to calculate the corresponding meanization interval.
[0125] The averaging interval with the largest number of averaging intervals among all pixel channels is determined as the target averaging interval.
[0126] In yet another embodiment, the device 500 further includes:
[0127] The comparison unit is used to acquire page images displayed on other terminals, extract the corresponding comparison areas, and call a preset comparison program to process the processing areas and the comparison areas.
[0128] It should be understood that the manner in which embodiments of the present invention are implemented is different from the implementation method. Figure 1 , 3 The same method is used in the embodiments shown in 4, and will not be described again here.
[0129] In this embodiment of the invention, page images can be processed at the pixel level to determine the area to be processed from the page image. Therefore, in page testing scenarios, even if different terminals display inconsistent content on the same page, the page area to be tested can be extracted by extracting the area to be processed, thereby enabling test comparison between the areas to be processed corresponding to different resolution terminals, improving the accuracy and efficiency of page testing.
[0130] According to embodiments of the present invention, an electronic device and a readable storage medium are also provided.
[0131] An electronic device according to an embodiment of the present invention includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to cause the at least one processor to perform the data processing method provided in the embodiment of the present invention.
[0132] Figure 6 An exemplary system architecture 600 is shown, in which a data processing method or data processing apparatus to which embodiments of the present invention can be applied is illustrated.
[0133] like Figure 6 As shown, system architecture 600 may include terminal devices 601, 602, and 603, a network 604, and a server 605. Network 604 serves as the medium for providing communication links between terminal devices 601, 602, and 603 and server 605. Network 604 may include various connection types, such as wired or wireless communication links or fiber optic cables, etc.
[0134] Users can use terminal devices 601, 602, and 603 to interact with server 605 via network 604 to receive or send messages, etc. Various client applications can be installed on terminal devices 601, 602, and 603.
[0135] Terminal devices 601, 602, and 603 can be various electronic devices with displays and web browsing capabilities, including but not limited to smartphones, tablets, laptops, and desktop computers.
[0136] Server 605 can be a server that provides various services. The server can analyze and process data such as received product information query requests, and feed back the processing results (such as product information - just an example) to the terminal device.
[0137] It should be noted that the data processing method provided in the embodiments of the present invention is generally executed by server 605, and correspondingly, the data processing device is generally disposed in server 605.
[0138] It should be understood that Figure 6 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0139] The following is for reference. Figure 7 It shows a schematic diagram of the structure of a computer system 700 suitable for implementing embodiments of the present invention. Figure 7 The computer system shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.
[0140] like Figure 7 As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 702 or programs loaded from storage section 708 into random access memory (RAM) 703. The RAM 703 also stores various programs and data required for the operation of the system 700. The CPU 701, ROM 702, and RAM 703 are interconnected via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0141] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, mouse, etc.; an output section 707 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 710 as needed so that computer programs read from it can be installed into the storage section 708 as needed.
[0142] In particular, according to the embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 709, and / or installed from removable medium 711. When the computer program is executed by central processing unit (CPU) 701, it performs the functions defined above in the system of this invention.
[0143] It should be noted that the computer-readable medium shown in this invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0144] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a unit, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0145] The units described in the embodiments of the present invention can be implemented in software or hardware. The described units can also be housed in a processor; for example, a processor can be described as including an acquisition unit, a filtering unit, a determining unit, and an extraction unit. The names of these units do not necessarily limit the specific unit; for example, an acquisition unit can also be described as a "unit with acquisition function."
[0146] In another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist independently and not assembled into the device. The computer-readable medium carries one or more programs that, when executed by the device, cause the device to perform the data processing method provided by the present invention.
[0147] In another aspect, the present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the data processing method provided in the embodiments of the present invention.
[0148] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A data processing method, characterized in that, include: Receive page processing requests and obtain the corresponding page images displayed on the terminal; Obtain the pixel values of each pixel channel corresponding to the page image, call the preset calculation model, calculate the mean interval corresponding to each pixel channel, and filter the target mean interval from the mean interval corresponding to each pixel channel. Based on the pixels of the page image and the target mean interval, calculate the pixel vector corresponding to the page image to determine the position information of each region to be processed in the page image; The area to be processed is extracted from the page image based on the location information.
2. The method according to claim 1, characterized in that, Based on the pixels of the page image and the target mean range, calculate the pixel vector corresponding to the page image, including: The page image is converted into a preset format, and a corresponding pixel matrix is generated based on the page image in the preset format; The pixel vector corresponding to the page image is calculated by concatenating the pixel matrix with the one-dimensional vector of the page image and combining it with the target mean range.
3. The method according to claim 1, characterized in that, Determining the location information of each area to be processed in the page image includes: The target pixel value corresponding to the region to be processed is determined based on the target mean interval; The position information of each region to be processed in the page image is determined based on the position of the target pixel value in the pixel vector.
4. The method according to claim 3, characterized in that, Determining the position information of each region to be processed in the page image based on the position of the target pixel value in the pixel vector includes: Identify the target element in the pixel vector that is equal to the target pixel value, and determine the number of non-target elements between two adjacent target elements according to the arrangement order of the elements in the pixel vector; In response to the number being less than a preset threshold, the non-target element is changed into a target element to obtain an updated pixel vector, and the position information of each area to be processed in the page image is determined based on the updated pixel vector.
5. The method according to claim 1, characterized in that, The step of calling a preset calculation model to calculate the mean interval corresponding to each pixel channel, and then filtering the target mean interval from the mean intervals corresponding to each pixel channel, includes: For each pixel channel, the pixel mean of the pixel channel is calculated, and a preset meanization model is invoked to calculate the corresponding meanization interval. The averaging interval with the largest number of averaging intervals among all pixel channels is determined as the target averaging interval.
6. The method according to claim 1, characterized in that, After extracting the area to be processed from the page image based on the location information, the process further includes: Obtain the page image displayed on other terminals, extract the corresponding comparison area, and call the preset comparison program to process the processing area and the comparison area.
7. A data processing apparatus, characterized in that, include: The acquisition unit is used to receive page processing requests and acquire the page image displayed on the terminal for the corresponding page. The filtering unit is used to obtain the pixel values of each pixel channel of the page image, call the preset calculation model, calculate the mean interval corresponding to each pixel channel, and filter the target mean interval from the mean interval corresponding to each pixel channel. The determining unit is used to calculate the pixel vector corresponding to the page image based on the pixels of the page image and the target mean interval, so as to determine the position information of each region to be processed in the page image; An extraction unit is used to extract the area to be processed from the page image based on the location information.
8. The apparatus according to claim 7, characterized in that, The determining unit is specifically used for: The page image is converted into a preset format, and a corresponding pixel matrix is generated based on the page image in the preset format; The pixel vector corresponding to the page image is calculated by concatenating the pixel matrix with the one-dimensional vector of the page image and combining it with the target mean range.
9. An electronic device, characterized in that, include: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-6.
10. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-6.